免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5923 | 回复: 5
打印 上一主题 下一主题

配置IPMP实例/Configure IPMP on a standalone host running Solaris 8 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-07 14:31 |只看该作者 |倒序浏览
This article demostrates how to set up IPMP on a Solaris 8 host and configure a virtual IP.

Environment:
SunOS denitdb37 5.8 Generic_117350-28 sun4u sparc SUNW,Sun-Fire-V490

Prerequisites:
. a Solaris 8 host is networked to one VLAN via 2 NICs.
. /etc/netmask is configured correctly. e.g.,
# cat /etc/netmasks
10.101.155.0    255.255.255.0
. /etc/defaulterouter is configured correctly. e.g.,
# cat /etc/defaultrouter
10.101.155.1
# wc -l /etc/defaultrouter
       0 /etc/defaultrouter
. mpathd is configured correctly. e.g.,
# grep -v ^# /etc/default/mpathd
FAILURE_DETECTION_TIME=10000
FAILBACK=yes
TRACK_INTERFACES_ONLY_WITH_GROUPS=yes



Procedure of IPMP setup on a Solaris 8 host
-------------------------------------------

0. modify /etc/hosts as follows:
127.0.0.1       localhost      
10.101.155.123  denitdb37        denitdb37.den.xyz.com        loghost
10.101.155.124  denitdb37-if0
10.101.155.125  denitdb37-if1

1. log onto the system console as root.

2. deconfigure the 2 NICs, e.g.:
# ifconfig ce0 unplumb
# ifconfig ce6 unplumb
# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000

3. plumb the 2 NICs.
# ifconfig ce0 plumb
# ifconfig ce6 plumb

4. configure IPMP on the 2 NICs.

4.1 configure the first interface.
# ifconfig ce0 denitdb37-if0 group denitdb37 deprecated netmask + broadcast + -failover up   
Setting netmask of ce0 to 255.255.255.0
# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 5
        inet 10.101.155.124 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:24:86:70

4.2 configure the second interface.
#  ifconfig ce6 denitdb37-if1 group denitdb37 deprecated -failover netmask + broadcast + up
Setting netmask of ce6 to 255.255.255.0
denitdb37# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 5
        inet 10.101.155.124 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:24:86:70
ce6: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 6
        inet 10.101.155.125 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:0:f4:91

4.3 configure IP of the host
# ifconfig ce0 addif denitdb37 netmask + broadcast + failover up
Created new logical interface ce0:1
Setting netmask of ce0:1 to 255.255.255.0
# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 5
        inet 10.101.155.124 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:24:86:70
ce0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
        inet 10.101.155.123 netmask ffffff00 broadcast 10.101.155.255
ce6: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 6
        inet 10.101.155.125 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:0:f4:91
# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
10.101.155.0         10.101.155.123        U        1      5  ce0:1
10.101.155.0         10.101.155.123        U        1      0  ce0
10.101.155.0         10.101.155.123        U        1      3  ce6
default              10.101.155.1          UG       1    158  
127.0.0.1            127.0.0.1             UH       2    190  lo0

5. verify IPMP is functioning

5.0 ssh the host ("ssh denitdb37" in this case), and verify the connection after the detatch & reattatch.

5.1 detatch the NIC to which the IP of the host is bound:
# if_mpadm -d ce0
Jul  6 21:37:16 denitdb37 in.mpathd[29]: Successfully failed over from NIC ce0 to NIC ce6
denitdb37# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=89040842<BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,OFFLINE> mtu 1500 index 5
        inet 10.101.155.124 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:24:86:70
ce6: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 6
        inet 10.101.155.125 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:0:f4:91
ce6:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 6
        inet 10.101.155.123 netmask ffffff00 broadcast 10.101.155.255

5.2 re-attatch the interface
# if_mpadm -r ce0
Jul  6 21:39:01 denitdb37 in.mpathd[29]: Successfully failed back to NIC ce0
# ifconfig -a   
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 5
        inet 10.101.155.124 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:24:86:70
ce0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
        inet 10.101.155.123 netmask ffffff00 broadcast 10.101.155.255
ce6: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 6
        inet 10.101.155.125 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:0:f4:91

6. create IPMP configuration files (its verification is to be done by a reboot).
#  cat /etc/hostname.ce0
denitdb37-if0 group denitdb37 deprecated -failover up addif denitdb37 netmask + failover up
#  cat /etc/hostname.ce6
denitdb37-if1 group denitdb37 deprecated -failover netmask + up


Procedure of configuring a virtual IP on a IPMP host
----------------------------------------------------

1. configure the virtual IP on /etc/hosts.
# echo -e "10.101.155.126\ttmp.vip.xyz.com" >> /etc/hosts

2. configure the VIP manually:
# ifconfig ce0 addif tmp.vip.xyz.com netmask + broadcast + failover up
Created new logical interface ce0:2
Setting netmask of ce0:2 to 255.255.255.0
# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 2
        inet 10.101.155.124 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:24:86:70
ce0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.101.155.123 netmask ffffff00 broadcast 10.101.155.255
ce0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.101.155.126 netmask ffffff00 broadcast 10.101.155.255
ce6: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 3
        inet 10.101.155.125 netmask ffffff00 broadcast 10.101.155.255
        groupname denitdb37
        ether 0:14:4f:0:f4:91

3. verify by "if_mpadm".

4. update IPMP configuration:
# cat /etc/hostname.ce0
denitdb37-if0 group denitdb37 deprecated -failover up addif denitdb37 netmask + failover up addif tmp.vip.xyz.com netmask + failover up
# cat /etc/hostname.ce6
denitdb37-if1 group denitdb37 deprecated -failover netmask + up

5. reboot the host to verify the configuration files.


欢迎指正

[ 本帖最后由 chinaux 于 2009-2-9 23:25 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-07-07 15:00 |只看该作者
如果这样的原创文章不加精的话,我会很伤心的

论坛徽章:
0
3 [报告]
发表于 2006-07-07 15:00 |只看该作者
楼上的兄弟写的真好啊

以转贴的名义放到我得blog上面去,楼上的哥哥没有意见吧?

论坛徽章:
0
4 [报告]
发表于 2006-07-07 15:11 |只看该作者
原帖由 ga0feng 于 2006-7-7 15:00 发表
楼上的兄弟写的真好啊

以转贴的名义放到我得blog上面去,楼上的哥哥没有意见吧?


My honor.

论坛徽章:
0
5 [报告]
发表于 2007-04-03 11:31 |只看该作者
兄弟,这篇文章我转载到我的blog上了.表示感谢!谢谢您提供这么好的文章!!!

论坛徽章:
0
6 [报告]
发表于 2007-07-17 11:32 |只看该作者
原帖由 chinaux 于 2006-7-7 14:31 发表
This article demostrates how to set up IPMP on a Solaris 8 host and configure a virtual IP.

Environment:
SunOS denitdb37 5.8 Generic_117350-28 sun4u sparc SUNW,Sun-Fire-V490

Prerequisite ...

好文章,最近配置IPMP,补充一个好用的方法:
如果服务器同一网段内没有网关,或者网关无法相应IPMP的icmp测试包,导致IPMP不能正常工作,提示两个网卡都是失败的。出现这种情况时,你可以添加另一台服务器的host路由,使IPMP向另一台服务器发送icmp测试包:
/usr/sbin/route add host 10.3.81.16 10.3.81.16
netstat -nr

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
10.3.81.16           10.3.81.16           UGH       1      0
这样网卡就能正常工作了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP