Re-naming Network Interface and Configuring Network Bonding or NIC Teaming in CentOS 7|RedHat 7 Linux
1. Previous versions of linux will have interface name like eth0 and eth1 and CentOS 7 later versions will have enp2s0f0 like that. but if you would like to rename then follow the below steps.
1. Edit file /etc/default/grub and add following
# GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap net.ifnames=0 biosdevnames=0 rhgb quiet"
2. Regenerate a GRUB configuration file
# grub2-mkconfig -o /boot/grub2/grub.cfg
3. Edit NAME and DEVICE parameter in ifcfg file /etc/sysconfig/network-scripts
# mv ifcfg-enp2s0f0 ifcfg-eth0 # mv ifcfg-enp2s0f1 ifcfg-eth1 # mv ifcfg-ens1f0 ifcfg-eth2 # mv ifcfg-ens1f1 ifcfg-eth3 # mv ifcfg-ens2f0 ifcfg-eth4 # mv ifcfg-ens2f1 ifcfg-eth5
4. Edit NAME and DEVICE parameter in ficfg file
# vi ifcfg-eth0 and rename NAME and DEVICE to eth0. similarly for all ifcfg-eth*
# systemctl disable NetworkManager
5. Then reboot the server to apply the changes.
# Shutdown -r now
Configuring Network Bonding or Teaming:
1. Edit and update each of the all physical NIC per below configuration.
# [] ifcfg-eth0 - kickstart interface TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=eth0 UUID=1c126857-adca-436d-8ffe-5cf1a6497937 DEVICE=eth0 ONBOOT=no [] ifcfg-bond0 - Bonging interface [Master] DEVICE=bond0 BONDING_OPTS="mode=4 miimon=100 updelay=6000 lacp_rate1" BONDING_MASTER=yes BOOTPROTO=none NM_CONTROLLED=no IPV6INIT=no NAME=bond0 ONBOOT=0 [] ifcfg-bond0.351 DEVICE=bond0.351 BOOTPROTO=none IPADDR=192.168.46.131 NETMASK=255.255.255.0 DOMAIN="acg.com corp.acg.com" GATEWAY=192.168.46.1 DNS1=192.168.24.30 DNS2=192.168.25.30 ONBOOT=yes NM_CONTROLLED=no IPV6INIT=no NAME=bond0.351 VLAN=yes [] ifcfg-eth1 - Slave interface TYPE=Ethernet IPV6INIT=NO NAME=eth1 UUID=1a008bd9-f21d-42f9-905e-c5dc09f87745 DEVICE=eth1 ONBOOT=yes MASTER=bond0 SLAVE=yes NM_CONTROLLED=no [] ifcfg-eth2 - Slave interface TYPE=Ethernet IPV6INIT=no NAME=eth2 UUID=9233e629-70a0-49cb-9f1d-b7deb39b1571 DEVICE=eth2 ONBOOT=yes MASTER=bond0 SLAVE=yes NM_CONTROLLED=no [] ifcfg-eth3 - iSCSI interface [Physical] TYPE=Ethernet BOOTPROTO=none IPV6INIT=no NAME=eth3 UUID=8c233834-8d55-4071-9890-839989c15f85 DEVICE=eth3 ONBOOT=yes NM_CONTROLLED=no [] ifcfg-eth3.705 - iSCSI interface DEVICE=eth3.705 BOOTPROTO=none ONBOOT=yes IPADDR=172.16.5.131 PREFIX=24 NETWORK=172.16.5.0 VLAN=yes [] ifcfg-eth4 - iSCSI interface [Physical] TYPE=Ethernet BOOTPROTO=none IPV6INIT=no NAME=eth4 UUID=9f5656af-ef5d-4073-a85f-856a3bcd1c17 DEVICE=eth4 ONBOOT=yes NM_CONTROLLED=no [] ifcfg-eth4.706 - iSCSI interface DEVICE=eth4.706 BOOTPROTO=none ONBOOT=yes IPADDR=172.16.6.131 PREFIX=24 NETWORK=172.16.6.0 VLAN=yes [] ifcfg-eth5 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=eth5 UUID=7aafaebe-dad8-4bfd-a778-f1a8e8f143b0 DEVICE=eth5 ONBOOT=no
2. Restart the server or network service
# systemctl restart network