有双网卡的服务器的IP地址使用Multipathing 技术
以一个简单的例子阐述Multipathing
其实与实际不一样的就是IP地址,以及网口类型,根据实际情况需要修改内容。
multipathing test IP 10.170.1.81
multipathing test IP 10.170.1.82
Logical IP 10.170.1.80
Group Name mswitch
Network Card ge0,ge1
一:使用命令方式(机器重新启动将失效)
1:Become superuser.
2:如果ge0,ge1被配置了IP,请使用如下命令清除ge0,ge1上配置信息
ifconfig ge0 unplumb
ifconfig ge1 unplumb
3:使用如下命令配置multipathing
ifconfig ge0 plumb 10.17.1.80 group mswitch netmask + broadcast + up
(使ge0可用,配置ge0的IP为Loical IP 10.17.1.80、使ge0为mswitch组的一块网卡)
ifconfig ge0 addif 10.170.1.81 deprecated -failover netmask + broadcast + up
(配置ge0的test ip为10.170.1.81)
ifconfig ge1 plumb 10.170.1.82 group mswitch netmask + broadcast + deprecated -failover standby up
(配置ge1为mswitch 组的另外一块网卡,它的test ip为10.170.1.82 并且这块网卡为standby)
4:以上为所有的配置命令,使用ifconfig –a命令将看到ge0、ge0:1、ge1的IP分别为10.17.1.80、10.17.1.81、10.17.1.82
5:测试。拔掉ge0的网线,使用ifconfig –a会发现10.170.1.80的地址failover到了ge1:1上。10.170.1.80这个地址可以正常使用。插回网线,会发现ge1:1没有了,10.17.1.80又回到了ge0上。
二:使用文件方式(机器重新启动后生效)
edit the /etc/hostname.ge0 file and add the following line.
10.170.1.80 netmask + broadcast + group mswitch up addif 10.170.1.81 deprecated -failover netmask + broadcast + up
edit the /etc/hostname.ge1 file and add the following line.
10.170.1.82 netmask + broadcast + group mswitch up deprecated -failover standby up
|
|