更换LINUX虚拟机网卡的名称ethX

修改eth3网口名称为eth2

# /sbin/ip add list
1: lo: mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:50:56:83:38:a4 brd ff:ff:ff:ff:ff:ff
    inet 10.43.88.43/24 brd 10.12.88.255 scope global eth0
    inet6 fe80::250:56ff:fe83:38a4/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:50:56:83:0f:61 brd ff:ff:ff:ff:ff:ff
    inet 10.43.162.102/22 brd 10.12.163.255 scope global eth1
    inet6 fe80::250:56ff:fe83:f61/64 scope link
       valid_lft forever preferred_lft forever
4: eth3: mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:50:56:83:7a:68 brd ff:ff:ff:ff:ff:ff
    inet 10.43.170.102/22 brd 10.12.171.255 scope global eth2
    inet6 fe80::250:56ff:fe83:7a68/64 scope link
       valid_lft forever preferred_lft forever

更换70-persistent-net.rules的eth3为eth2后,重启主机

 

# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:83:6b:dd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:83:13:3b", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:83:38:c0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

 

你可能感兴趣的:(LINUX)