A number of changes were made in CentOS 7 that are fairly different from previous iterations. This page will attempt to identify and address the differences and how to deal with them. Differences include:
- Default XFS filesystem (need more research on XFS and Butter FS To fill out filesystem)
- ifconfig is gone
- setup is gone
- service network restart command no longer changes the IP of an interface after it’s been reconfigured.
- IP aliases are a thing of the past
Beware CentOS 7.1 partitioner will try to use xfs by default. Most people will try and get away from xfs. We are partial to still using ext4. For larger partitions you can use btrfs (butter FS).
Ifconfig is gone
CentOS 7 has done away with our beloved ifconfig command. It has been replaced with the “ip” command. Here are some common uses:
Is like the basic ifconfig command, shows interfaces and configured IP addresses
ip addr add 10.1.2.3/27 dev enp2s0
Adds IP 10.1.2.3/27 to network interface enp2s0
You can still use ifup and ifdown commands to bring an interface up or down, respectively.
alternatively, you can use the ip command to bring an interface up or down:
# ip link set eth1 down # ip link set eth1 up
You can also always install ifconfig command by entering the following command:
yum provides ifconfig yum install net-tools
setup is gone
use the new tool:
The tool is pretty intuitive and should be pretty easy to figure out once you mess with it some. Note that instead of typing in a netmask such as 255.255.255.248 you will just put the CIDR number at the end of the IP, e.g. 192.168.1.42/29
service network restart
The command no longer automatically brings down all interfaces and bring them up with new IPs. You need to bounce the interface manually. After setting up a new ip address using nmtui issue the following commands:
systemctl restart network ip link set en01 down ip link set en01 up
This example of course assumes that the nic you configured is names en01. Interface could also be named something else run the ip command to find out the interfaces name.
CentOS 7 does away with ip interfaces (e.g. eth0:1, eth0:2, etc) and instead just allows you to add multiple IP addresses straight to the interface. the nmtui lets you do this easily by just continuing to add IPs to the interface you have selected. If you look at the config file in /etc/sysconfig/network-scripts/ the lines for multiple IPs will look like so:
IPADDR0=10.2.0.5 PREFIX0=24 IPADDR1=192.168.1.40 PREFIX1=29 IPADDR2=220.127.116.11 PREFIX2=27
This setup gives the interface a primary IP of 10.2.0.5/24, and adds IPs 192.168.1.40/29 and 18.104.22.168/27