Connect with us

Gamer4K

How to configure an IP address in Linux CentOS 7?

Tech

How to configure an IP address in Linux CentOS 7?


CentOS (Community Enterprise Enterprise System) is an enterprise-class Linux distribution based on free source code distributed by Red Hat and maintained by the CentOS project. For those who need stability, this is the ideal operating system.

Today we are going to teach you how to configure an IP address, mask, gateway and DNS in CentOS 7.

Centos / RHEL 7.0 adopted the systemd, which is a substitute for init daemon of Linux (but is compatible with init scripts SysV and LSB) and offers several improvements in process management, service dependency management, system initialization and shell performance.

This change resulted in the change of some commands, forcing users to know how to manage services, processes, etc.

How to configure an IP address in Linux CentOS 7?

Configure the network via nmtui command

To configure and view their network settings, the user has several commands in CentOS 7 such as ip, ifconfig, nmtui, nmcli, or route.

The simplest way to configure the network and machine name is to use the command I used to.
How to configure an IP address in Linux CentOS 7?

Then just go to Edit and if you wish to carry out a manual configuration you must select IPv4 and then Manual. To add the settings, click Show.

For a DHCP server configuration, choose the Automatic.

Note: For this tutorial we only show how to proceed with IPv4 configuration.
How to configure an IP address in Linux CentOS 7?

Then, indicate the network settings that you want. After setting select the OK which is at the end of the interface.

Then do Activate a connection

If you want to force the new settings, you can also use the command at any time:

To see the configuration you can use the command ip addr

In case the name can still use (additionally) the command nmtui-hostname.

Configuration via command line

In addition to the utility I used to, you can also configure network parameters via the command line. To do this, simply access the configuration file (in our case / etc / sysconfig / network-scripts / ifcfg-eth0)

To edit the file you can use a text editor such as vi, nano, or other.

For manual configuration, the following parameters must be indicated:

BOOTPROTO= static
ONBOOT=yes
 
IPADDR= 192.168.10.27
NETMASK= 255.255.240.0
GATEWAY= 192.168.31.254
DNS1= 8.8.8.8

IPADDR = 192.168.10.27
NETMASK = 255.255.240.0
GATEWAY = 192.168.31.254
DNS1 = 8.8.8.8

After you have made the settings, save the information and restart the service associated with the network.

systemctl restart network

If you want to define a name edit the file / etc / sysconfig / network

HOSTNAME= pc1.pplware.com
DNS1= 8.8.8.8
DNS2= 8.8.8.4
SEARCH= pplware.com

More tutorials on Linux, can be seen at Pplware.com –Linux.

!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version=’2.0′;n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,’script’,’https://connect.facebook.net/en_US/fbevents.js’);
fbq(‘init’, ‘1664527397186427’); // Insert your pixel ID here.
fbq(‘track’, ‘PageView’);
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “http://connect.facebook.net/pt_PT/sdk.js#xfbml=1&version=v2.3&appId=122308327859118”;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));

Comments
To Top

Log in

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy