just do it
分类: 系统运维
2012-08-07 10:37:21
bash-3.00# eeprom local-mac-address?true //使系统中网络接口使用不同的mac地址
bash-3.00# cat /etc/hosts
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.0.20 oracle loghost #浮动ip
192.168.0.21 test2 #hme0网卡接口测试ip
192.168.0.22 test1 #eri0网卡接口测试ip
bash-3.00# cat /etc/hostname.eri0
oracle
test1 netmask 255.255.255.0 broadcast 192.168.0.255 deprecated -failover group ipmptest up addif 192.168.0.20 netmask 255.255.255.0 broadcast 192.168.0.255 up
bash-3.00# cat /etc/hostname.hme0
192.168.0.21
test2 netmask 255.255.255.0 broadcast 192.168.0.250 deprecated -failover group ipmptest up standby up
reboot后:
bash-3.00# ifconfig -a
lo0:
flags=2001000849
inet 127.0.0.1 netmask ff000000
eri0:
flags=9040843
inet 192.168.0.22 netmask ffffff00 broadcast 192.168.0.255
groupname ipmptest
ether 0:3:ba:f0:c1:20
eri0:1:
flags=1000843
inet 192.168.0.20 netmask ffffff00 broadcast 192.168.0.255
hme0:
flags=69040843
inet 192.168.0.21 netmask ffffff00 broadcast 192.168.0.255
groupname ipmptest
ether 0:3:ba:1:f:7a
bash-3.00#
使用命令测试 IPMP是否配置成功也可以用拔网线的方式测试:
bash-3.00# if_mpadm -d eri0 //手动使网卡eri0 offline,看ip是否漂移到另一块网卡接口hme0上
bash-3.00# ifconfig -a //ifconfig -a 命令查看发现ip漂移到hme0接口
lo0:
flags=2001000849
inet 127.0.0.1 netmask ff000000
eri0:
flags=89040842
inet 192.168.0.22 netmask ffffff00 broadcast 192.168.0.255
groupname ipmptest
ether 0:3:ba:f0:c1:20
hme0:
flags=29040843
inet 192.168.0.21 netmask ffffff00 broadcast 192.168.0.255
groupname ipmptest
ether 0:3:ba:1:f:7a
hme0:1:
flags=21000843
inet 192.168.0.20 netmask ffffff00 broadcast 192.168.0.255
bash-3.00#
bash-3.00# tail -f /var/adm/messages //系统日志信息说明ip成功切换到了hme0网卡接口
May 19 13:41:41 oracle in.mpathd[172]: [ID 215189 daemon.error] The link has gone down on eri0
May 19 13:41:41 oracle in.mpathd[172]: [ID 168056 daemon.error] All Interfaces in group ipmptest have failed
May 19 13:41:52 oracle in.mpathd[172]: [ID 299542 daemon.error] NIC repair detected on hme0 of group ipmptest
May 19 13:41:52 oracle in.mpathd[172]: [ID 237757 daemon.error] At least 1 interface (hme0) of group ipmptest has repaired
May 19 13:41:52 oracle in.mpathd[172]: [ID 832587 daemon.error] Successfully failed over from NIC eri0 to NIC hme0
May 19 13:44:25 oracle eri: [ID 786680 kern.notice] SUNW,eri0 : 100 Mbps full duplex link up
May 19 13:44:25 oracle in.mpathd[172]: [ID 820239 daemon.error] The link has come up on eri0
May 19 13:44:40 oracle in.mpathd[172]: [ID 299542 daemon.error] NIC repair detected on eri0 of group ipmptest
May 19 13:44:40 oracle in.mpathd[172]: [ID 620804 daemon.error] Successfully failed back to NIC eri0
May 19 16:27:26 oracle in.mpathd[172]: [ID 832587 daemon.error] Successfully failed over from NIC eri0 to NIC hme0
bash-3.00# if_mpadm -r eri0 //重新将eri0网卡 online
bash-3.00# ifconfig -a //查看结果,成功切换回eri0网卡
lo0:
flags=2001000849
inet 127.0.0.1 netmask ff000000
eri0:
flags=9040843
inet 192.168.0.22 netmask ffffff00 broadcast 192.168.0.255
groupname ipmptest
ether 0:3:ba:f0:c1:20
eri0:1:
flags=1000843
inet 192.168.0.20 netmask ffffff00 broadcast 192.168.0.255
hme0:
flags=69040843
inet 192.168.0.21 netmask ffffff00 broadcast 192.168.0.255
groupname ipmptest
ether 0:3:ba:1:f:7a
bash-3.00#
bash-3.00# tail -f /var/adm/messages //观察系统日志信息,成功切换回网卡eri0
May 19 13:41:41 oracle in.mpathd[172]: [ID 168056 daemon.error] All Interfaces in group ipmptest have failed
May 19 13:41:52 oracle in.mpathd[172]: [ID 299542 daemon.error] NIC repair detected on hme0 of group ipmptest
May 19 13:41:52 oracle in.mpathd[172]: [ID 237757 daemon.error] At least 1 interface (hme0) of group ipmptest has repaired
May 19 13:41:52 oracle in.mpathd[172]: [ID 832587 daemon.error] Successfully failed over from NIC eri0 to NIC hme0
May 19 13:44:25 oracle eri: [ID 786680 kern.notice] SUNW,eri0 : 100 Mbps full duplex link up
May 19 13:44:25 oracle in.mpathd[172]: [ID 820239 daemon.error] The link has come up on eri0
May 19 13:44:40 oracle in.mpathd[172]: [ID 299542 daemon.error] NIC repair detected on eri0 of group ipmptest
May 19 13:44:40 oracle in.mpathd[172]: [ID 620804 daemon.error] Successfully failed back to NIC eri0
May 19 16:27:26 oracle in.mpathd[172]: [ID 832587 daemon.error] Successfully failed over from NIC eri0 to NIC hme0
May 19 16:33:24 oracle in.mpathd[172]: [ID 620804 daemon.error] Successfully failed back to NIC eri0