查看所有接口及MAC
1 | # ifconfig -a |
修改 70-persistent-net.rules文件
01 | [root@localhost ~] # vi /etc/udev/rules.d/70-persistent-net.rules |
02 | # This file was automatically generated by the /lib/udev/write_net_rules |
03 | # program, run by the persistent-net-generator.rules rules file. |
04 | # |
05 | # You can modify it, as long as you keep each rule on a single |
06 | # line, and change only the value of the NAME= key. |
07 |
08 | # PCI device 0x8086:0x100f (e1000) |
09 | SUBSYSTEM== "net" , ACTION== "add" , DRIVERS== "?*" , ATTR{address}== "00:0c:29:45:fa:3f" , ATTR{ type }== "1" , KERNEL== "eth*" , NAME= "eth1" |
10 |
11 | # PCI device 0x8086:0x100f (e1000) |
12 | SUBSYSTEM== "net" , ACTION== "add" , DRIVERS== "?*" , ATTR{address}== "00:0c:29:45:fa:35" , ATTR{ type }== "1" , KERNEL== "eth*" , NAME= "eth0" |
修改接口配置
1 | # vi /etc/sysconfig/network-scripts/ifcfg-eth0 |
2 | ... |
3 | HWADDR= "00:0c:29:45:fa:35" |
4 | ... |
5 | # vi /etc/sysconfig/network-scripts/ifcfg-eth1 |
6 | ... |
7 | HWADDR= "00:0c:29:45:fa:3f" |
8 | ... |
重启设备reboot