CentOS multi-Nic renaming configuration
In CentOS7 I installed 3 network card, but the name is enoxxxxx format, let me this obsessive-compulsive of the seat is very uncomfortable, the following is I configure the network card and renamed to Ethx detailed steps
The premise work should be done well:
1. Check the network card UUID
# NMCLI Con Show
Name UUID type device
eth1 dfc9199c-7b47-4209-a396-109bf44e683a 802-3-ethernet eth1
Eth2 020d86aa-548f-49c2-9cb0-f6cfffdb8219 802-3-ethernet eth2
Eth0 a5e6ae5c-dd71-48be-b374-ad64121bd785 802-3-ethernet eth0
2. View network card information
# NMCLI device show [device name] Example:
# NMCLI Device Show eth0
General. Equipment: eth0
General. Type: Ethernet
General. HDD: 00:0c:29:94:c8:08
General. mtu:1500
General. Status: 100 (connected)
General. Connection:eth0
General. Con-path:/org/freedesktop/networkmanager/activeconnection/0
Wired-properties. Container: Open
IP4. Address [1]: 192.168.66.4/24
IP4. Gateway: 192.168.66.1
IP4. DNS[1]: 202.106.46.151
IP6. Address [1]: FE80::20C:29FF:FE94:C808/64
IP6. Gateway:
Step into the chase
Go to the network card configuration file directory
# cd/etc/sysconfig/network-scripts
Renaming the NIC
# MV ifcfg-eno16777736 Ifcfg-eth0
Modify network card information, not very understanding of the small partners please refer to my other detailed explanation http://baoer7758.blog.51cto.com/8187563/1638229
# Vim Ifcfg-eth0
hwaddr=00:0c:29:94:c8:08
Type=ethernet
Bootproto=static
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=yes
Name=eth0
uuid=a5e6ae5c-dd71-48be-b374-ad64121bd785
# device=eno16777736
Onboot=yes
ipaddr=192.168.66.4
netmask=255.255.255.0
gateway=192.168.66.1
dns1=202.106.46.151
# Device=eth0
Copy the configuration file two copies of the configuration file for the other two network cards
# CP Ifcfg-eth0 Ifcfg-eth1
# CP Ifcfg-eth0 Ifcfg-eth2
Edit changes:
# Vim Ifcfg-eth1
Hwaddr=00:0c:29:94:c8:12
Type=ethernet
Bootproto=static
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=yes
Name=eth1
uuid=dfc9199c-7b47-4209-a396-109bf44e683a
Onboot=yes
ipaddr=192.168.67.4
netmask=255.255.255.0
# Device=eth0
Edit Modify
# Vim Ifcfg-eth2
Hwaddr=00:0c:29:94:c8:1c
Type=ethernet
Bootproto=static
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=yes
Name=eth2
uuid=020d86aa-548f-49c2-9cb0-f6cfffdb8219
# device=eno16777736
Onboot=yes
ipaddr=192.168.68.4
netmask=255.255.255.0
# Device=eth0
Start to configure for renaming, not very understanding of the small partners please refer to my other detailed explanation http://baoer7758.blog.51cto.com/8187563/1638229
# Vi/etc/sysconfig/grub
Grub_timeout=5
Grub_default=saved
Grub_disable_submenu=true
grub_terminal_output= "Console"
grub_cmdline_linux= "Rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto net.ifnames=0 biosdevname=0 Net.ifnames=1 biosdevname=1 net.ifnames=2 biosdevname=2 rhgb quiet "//bold to add content
Grub_disable_recovery= "true"
Reload to Startup
# Grub2-mkconfig-o/boot/grub2/grub.cfg
Generating GRUB configuration file ...
Found Linux Image:/boot/vmlinuz-3.10.0-229.el7.x86_64
Found initrd Image:/boot/initramfs-3.10.0-229.el7.x86_64.img
Found Linux Image:/BOOT/VMLINUZ-0-RESCUE-9BEDE79B46BD4E9696B92A4EC68A97B1
Found initrd Image:/boot/initramfs-0-rescue-9bede79b46bd4e9696b92a4ec68a97b1.img
Done
Restart the system reboot
viewing network card information
# ifconfig
Eth0:flags=4163<up,broadcast,running,multicast> MTU 1500
inet 192.168.66.4 netmask 255.255.255.0 broadcast 192.168.66.255
Inet6 fe80::20c:29ff:fe94:c808 Prefixlen ScopeID 0x20<link>
Ether 00:0c:29:94:c8:08 Txqueuelen (Ethernet)
RX Packets 690 Bytes 69262 (67.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX Packets 488 Bytes 65725 (64.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Eth1:flags=4163<up,broadcast,running,multicast> MTU 1500
inet 192.168.67.4 netmask 255.255.255.0 broadcast 192.168.67.255
Inet6 fe80::20c:29ff:fe94:c812 Prefixlen ScopeID 0x20<link>
Ether 00:0c:29:94:c8:12 Txqueuelen (Ethernet)
RX packets 129 bytes 15944 (15.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX Packets bytes 3927 (3.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Eth2:flags=4163<up,broadcast,running,multicast> MTU 1500
inet 192.168.68.4 netmask 255.255.255.0 broadcast 192.168.68.255
Inet6 fe80::20c:29ff:fe94:c81c Prefixlen ScopeID 0x20<link>
Ether 00:0c:29:94:c8:1c Txqueuelen (Ethernet)
RX Packets 127 Bytes 15613 (15.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX Packets Bytes 3609 (3.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Lo:flags=73<up,loopback,running> MTU 65536
inet 127.0.0.1 netmask 255.0.0.0
Inet6:: 1 prefixlen ScopeID 0x10
Loop Txqueuelen 0 (Local Loopback)
RX Packets 4 Bytes 420 (420.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX Packets 4 Bytes 420 (420.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I found out!
This article is from the "Isuncle Technology blog" blog, make sure to keep this source http://baoer7758.blog.51cto.com/8187563/1638277
CentOS multi-Nic renaming configuration