# vim /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:bc:60:18", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
注意网卡地址和网卡名称要保持一致
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:BC:60:18
inet addr:172.16.5.11 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::20c:29ff:febc:6018/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:895 errors:0 dropped:0 overruns:0 frame:0
TX packets:134 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:153574 (149.9 KiB) TX bytes:16729 (16.3 KiB)
配置完后,重启,ok!
转载于:https://blog.51cto.com/qiufengsong/1301391