- 论坛徽章:
- 0
|
This message is response to \"哪位大侠能帮忙写一个在cluster中做网卡的failover的\r\n\r\nThe following is my owner note to setup the IPMP procedures.\r\nPlease change hme0 to ce2 and qfe0 to ce3 and also using your owner properly IP address.\r\n\r\n\r\nHave a good luck!\r\n\r\nPlease let me know if you still have problem. I can be reached at:\r\n\r\nitsrockandroll@yahoo.com\r\n\r\n-------------------------------------------------------------------------------\r\nInstall IPMP procedure\r\n\r\nPlumb the network interface if not yet. \r\n# ifconfig hme0 plumb\r\n# ifconfig qfe0 plumb \r\nAdd physical IP address to the primary network interface if not yet.\r\n# ifconfig hme0 199.199.199.130 netmask + broadcast + up\r\nlo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4>; mtu 8232 index 1\r\n inet 127.0.0.1 netmask ff000000 \r\nhme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 4\r\n inet 199.199.199.130 netmask ffffff00 broadcast 199.199.199.255\r\n ether 8:0:20:b7:df:9b \r\nqfe0: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 5\r\n inet 0.0.0.0 netmask 0 \r\n ether 8:0:20:f3:78:94 \r\n\r\nPlace each physical network interface into a multipathing group tst\r\n# ifconfig hme0 group tst\r\n# ifconfig qfe0 group tst\r\n\r\n# ifconfig -a\r\nlo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4>; mtu 8232 index 1\r\n inet 127.0.0.1 netmask ff000000 \r\nhme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 4\r\n inet 199.199.199.130 netmask ffffff00 broadcast 199.199.199.255\r\n groupname tst\r\n ether 8:0:20:b7:df:9b \r\nqfe0: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 5\r\n inet 0.0.0.0 netmask 0 \r\n groupname tst\r\n ether 8:0:20:f3:78:94 \r\n\r\nMake sure the default router has been set up\r\n\r\n# netstat -rn\r\n\r\nRouting Table: IPv4\r\n Destination Gateway Flags Ref Use Interface\r\n-------------------- -------------------- ----- ----- ------ ---------\r\n199.199.199.0 199.199.199.130 U 1 2 hme0\r\n199.199.199.0 199.199.199.130 U 1 0 hme0:1\r\n199.199.199.0 199.199.199.130 U 1 1 qfe0\r\ndefault 199.199.199.1 UG 1 0 \r\n127.0.0.1 127.0.0.1 UH 2 40 lo0\r\n\r\nAdd test address to each network interface\r\n# ifconfig hme0 addif 199.199.199.131 -failover deprecated up\r\n# ifconfig qfe0 199.199.199.132 -failover deprecated up\r\n\r\n# ifconfig -a\r\nlo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4>; mtu 8232 index 1\r\n inet 127.0.0.1 netmask ff000000 \r\nhme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 4\r\n inet 199.199.199.130 netmask ffffff00 broadcast 199.199.199.255\r\n groupname tst\r\n ether 8:0:20:b7:df:9b \r\nhme0:1: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER>; mtu 1500 index 4\r\n inet 199.199.199.131 netmask ffffff00 broadcast 199.199.199.255\r\nqfe0: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER>; mtu 1500 index 5\r\n inet 199.199.199.132 netmask ffffff00 broadcast 199.199.199.255\r\n groupname tst\r\n ether 8:0:20:f3:78:94 \r\n\r\nFrom the above \"ifconfig -a \" output, the physical IP address 199.199.199.130 is on network interface\r\nhme0. After we remove the hme0 network interface cable, the new output of \"ifconfig -a\":\r\n \r\n\r\n\r\n# ifconfig -a\r\nlo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4>; mtu 8232 index 1\r\n inet 127.0.0.1 netmask ff000000 \r\nhme0: flags=19000842<BROADCAST,RUNNING,MULTICAST,IPv4,NOFAILOVER,FAILED>; mtu 0 index 4\r\n inet 0.0.0.0 netmask 0 \r\n groupname tst\r\n ether 8:0:20:b7:df:9b \r\nhme0:1: flags=19040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,FAILED>; mtu 1500 index 4\r\n inet 199.199.199.131 netmask ffffff00 broadcast 199.199.199.255\r\nqfe0: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER>; mtu 1500 index 5\r\n inet 199.199.199.132 netmask ffffff00 broadcast 199.199.199.255\r\n groupname tst\r\n ether 8:0:20:f3:78:94 \r\nqfe0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 5\r\n inet 199.199.199.130 netmask ffffff00 broadcast 199.199.199.255\r\n\r\nThe physicall IP 199.199.199.130 address has been moved to qfe0 network interface and hme0 has FAILED flag.\r\n\r\nAfter we reconnect the hme0 network interface, the output of \"ifconfig -a\"\r\n\r\n# ifconfig -a\r\nlo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4>; mtu 8232 index 1\r\n inet 127.0.0.1 netmask ff000000 \r\nhme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4>; mtu 1500 index 4\r\n inet 199.199.199.130 netmask ffffff00 broadcast 199.199.199.255\r\n groupname tst\r\n ether 8:0:20:b7:df:9b \r\nhme0:1: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER>; mtu 1500 index 4\r\n inet 199.199.199.131 netmask ffffff00 broadcast 199.199.199.255\r\nqfe0: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER>; mtu 1500 index 5\r\n inet 199.199.199.132 netmask ffffff00 broadcast 199.199.199.255\r\n groupname tst\r\n ether 8:0:20:f3:78:94 \r\n\r\nThe physicall IP address 199.199.199.130 has been moved back to hme0 network interface.\r\n\r\nIn order to keep the same configuration after the system reboot, we create the /etc/hostname.hme0 and\r\n/etc/hostname.qfe0 files:\r\n\r\n/etc/hostname.hme0\r\n199.199.199.130 netmask + broadcast + group tst up \\\r\naddif 199.199.199.131 deprecated -failover netmask + broadcast + up\r\n\r\n/etc/hostname.qfe0 \r\n199.199.199.132 group tst deprecated -failover netmask + broadcast + up |
|