linux主机更换网卡,名称自动变成其他名称,mac地址没自动更新

 

表现:

# ifconfig|more

eth2      Link encap:Ethernet  HWaddr 00:50:56:21:47:F4 

          inet addr:192.168.0.103  Bcast:192.168.0.255  Mask:255.255.255

.0

          inet6 addr: fe80::250:56ff:fe21:47f4/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:364 errors:0 dropped:0 overruns:0 frame:0

          TX packets:228 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:37271 (36.3 KiB)  TX bytes:29641 (28.9 KiB)

 

 

                    

# cat ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=static

IPADDR=192.168.0.103

netmask=255.255.255.0

gateway=192.168.0.1

 

 

实际MAC地址是:

00:50:56:21:47:F4

 

修正:

# cd /etc/udev/rules.d/

# vi 70-persistent-net.rules

linux更换网卡网卡名称变化更改_第1张图片

 

重启操作系统

 

网卡名变回eth0

linux更换网卡网卡名称变化更改_第2张图片