免费注册 查看新帖 |

Chinaunix

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

Configure IPMP on a single host running Solaris [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-09 22:14 |只看该作者 |倒序浏览
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 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 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843 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 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843 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 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 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843 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 mtu 1500 index 5
        inet 10.101.155.123 netmask ffffff00 broadcast 10.101.155.255
ce6: flags=9040843 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 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=89040842 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 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 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 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843 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 mtu 1500 index 5
        inet 10.101.155.123 netmask ffffff00 broadcast 10.101.155.255
ce6: flags=9040843 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 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
ce0: flags=9040843 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 mtu 1500 index 2
        inet 10.101.155.123 netmask ffffff00 broadcast 10.101.155.255
ce0:2: flags=1000843 mtu 1500 index 2
        inet 10.101.155.126 netmask ffffff00 broadcast 10.101.155.255
ce6: flags=9040843 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.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/5370/showart_138390.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP