1)编辑
/etc/udev/rules.d/70-persistent-net.rules ,把NAME="eth0"的那行配置注释掉或者删掉,把NAME="eth1"的修改成NAME="eth0"
#sudo vim
/etc/udev/rules.d/70-persistent-net.rules
编辑后为:
(行前面数字为vi设置的行号)
13 #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:e3 :38:4a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
14
15 # PCI device 0x8086:0x100e (e1000)
16 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:09:27:27", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
2)
更改网卡配置文件 /etc/sysconfig/network/ifcfg-eth0
#sudo vim /etc/sysconfig/network/ifcfg-eth0
更改后内容为:(行前面数字为vi设置的行号)
1 BOOTPROTO='static' 1 BOOTPROTO='static'
2 BROADCAST='255.255.255.0'
3 ETHTOOL_OPTIONS=''
4 IPADDR='192.168.56.101'
5 MTU=''
6 HWADDR="08:00:27:09:27:27"
7 #NAME='82540EM Gigabit Ethernet Controller'
8 NETMASK='255.255.255.0'
9 NETWORK='192.168.56.0'
10 REMOTE_IPADDR=''
11 STARTMODE='onboot'
12 _nm_name='static-0'
_nm_name='static-0'
其中ifcfg-eth0的HWADDR="08:00:27:09:27:27"与ATTR{address}=="08:00:27:09: 27:27"相同
3)reboot
附上同一台物理机上,另外一个Suse虚机的配置,(即同一物理机上装两个虚机中,另一个虚机eth0配置):
1) # vim /etc/udev/rules.d/70-persistent-net.rules
13 #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:a0:77:a0", ATTR{dev_id}=="0x0", ATTR{type }=="1", KERNEL=="eth*", NAME="eth0"
14
15 # PCI device 0x8086:0x100e (e1000)
16 SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:7b:4f:b4", ATTR{dev_id}=="0x0", ATTR{type} =="1", KERNEL=="eth*", NAME="eth0"
2) # vim /etc/sysconfig/network/ifcfg-eth0
1 BOOTPROTO='static'
2 BROADCAST='255.255.255.0'
3 ETHTOOL_OPTIONS=''
4 IPADDR='192.168.56.102'
5 MTU=''
6 HWADDR="08:00:27:35:00:ac"
7 #NAME='82540EM Gigabit Ethernet Controller'
8 NETMASK='255.255.255.0'
9 NETWORK='192.168.56.0'
10 REMOTE_IPADDR=''
11 STARTMODE='onboot'
12 _nm_name='static-1'
两虚机eth0配置区别是:
a) _nm_name='static-1' _nm_name='static-0'
b) HWADDR="08:00:27:35:00:ac" HWADDR="08:00:27:09:27:27"
阅读(2515) | 评论(0) | 转发(0) |