What’s new in RHEL7: Networking

Interface naming
You will no longer see network interface named eth0, eth1 and so on. Instead you will see ethernet device named like ensxxx for a PCI add on device and enoxxx for onboard device. Major has written a blog post on how Systemd come up with a name for a network device. If you prefer, read Red Hat documentation.

ifconfig

Depending on how your RHEL 7 server was installed, ifconfig may not be available. ifconfig has been deprecated for a while but if you like, you can still have it by installing the net-tools package. The man page of ifconfig and “yum info net-tools” will tell you it is deprecated. With ifconfig, you may miss some information such as a second IP assigned to an interface. Its time to learn ip command.

/etc/hostname
The hostname is now stored in /etc/hostname.

/etc/resolv.conf
You can still “cat /etc/resolv.conf” to check the nameserver but you should not edit this file.

# cat /etc/resolv.conf
# Generated by NetworkManager
search localdomain
nameserver 192.168.76.2

It is updated by NetworkManager service. DNS is configured in the interface configuration file for example /etc/sysconfig/network-scritps/ifcfg-ensxxx.

ip, nmcli, nmtui
There are three tools to configuration network settings- ip, nmcli and nmtui. ip is useful to look at the current configuration and quick change but the change is not persistent. To create persistent change use nmcli and nmtui. After making changes, restart the connection or NetworkManager. A connection is like a profile, for example I can maintain different IP settings for office and home network. Think of it as a connection equals a configuration file in /etc/sysconfig/network-scritps/ifcfg-*.

Down and up a connection called “System ens192”

# nmcli con  down "System ens192"; nmcli con  up "System ens192"
Connection 'System ens192' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/0)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)

Restart NetworkManager

# systemctl restart NetworkManager

I am sure there are excellent resources on the usage of nmcli out there. I just want to make a note of the general idea here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s