Monday, August 2, 2010

Solaris multipathing

I've got this Sun box running Solaris 8 that I've managed to get three 10/100 hme ethernet cards into. All are connected to the 100Mbit switch that runs most of our LAN. This the quick guide to how I set up multipathing on those three interfaces. As clearly stated in Sun's docs, each interface involved in failover must be assigned to a group (I use the same group for all three, it can be named about whatever you want), and assigned an additional IP address for in.mpathd to use for testing whether the interface is up or not. While these additional IPs will only be relevant to this host, they must NOT be in use anywhere else on your subnet.


Conventions

Network: 10.0.0.0/24

Hostname: acadie

Domain: internal

Interfaces: hme0 hme1 hme2

Failover group name: mofo

Main "live" address: 10.0.0.101

hme0 "test" address: 10.0.0.110

hme1 "test" address: 10.0.0.111

hme2 "test" address: 10.0.0.112

Configuration files

/etc/hosts:

#

# Internet host table

#

127.0.0.1 localhost loghost

10.0.0.101 acadie.internal acadie

10.0.0.110 acadie-hme0

10.0.0.111 acadie-hme1

10.0.0.112 acadie-hme2

/etc/netmasks:

10.0.0.0 255.255.255.0

/etc/hostname.hme0:

acadie netmask + broadcast + up \

group mofo \

addif acadie-hme0 netmask + broadcast + \

deprecated -failover up

/etc/hostname.hme1:

acadie-hme1 netmask + broadcast + \

group mofo \

deprecated -failover standby up

/etc/hostname.hme2:

acadie-hme2 netmask + broadcast + \

group mofo \

deprecated -failover standby up

Command line

The above configuration is all that is required to make this configuration persistent across reboots. If, however, you are in the position of having to implement this on a running machine without rebooting, you pretty much just run `ifconfig` for each interface, with the arguments shown in the /etc/hostname.hme? files above.

For example, if you're already up and running on hme0, and want to add hme1 and hme2 as failover interfaces to hme0:

acadie# ifconfig hme0

hme0: flags=1000843 mtu 1500 index 2

inet 10.0.0.101 netmask ffffff00 broadcast 10.0.0.255

ether 8:0:20:c5:10:15

Assign hme0 to your failover group, and add an alias to it for the testing address:

acadie# ifconfig hme0 group mofo

acadie# ifconfig hme0 addif 10.0.0.110 netmask 255.255.255.0 \

broadcast 10.0.0.255 -failover deprecated up

Then add hme1 and hme2 in:

acadie# ifconfig hme1 plumb 10.0.0.111 netmask 255.255.255.0 \

broadcast 10.0.0.255 group mofo deprecated -failover standby up

acadie# ifconfig hme2 plumb 10.0.0.112 netmask 255.255.255.0 \

broadcast 10.0.0.255 group mofo deprecated -failover standby up

Note: You can substitute in hostnames for the IP addresses in those ifconfig commands, provided they are in /etc/hosts.

acadie# ifconfig -a

lo0: flags=1000849 mtu 8232 index 1

inet 127.0.0.1 netmask ff000000

hme0: flags=1000843 mtu 1500 index 2

inet 10.0.0.101 netmask ffffff00 broadcast 10.0.0.255

groupname mofo

ether 8:0:20:c5:10:15

hme0:1: flags=9040843 mtu 1500 index 2

inet 10.0.0.110 netmask ffffff00 broadcast 10.0.0.255

hme1: flags=9040843 mtu 1500 index 3

inet 10.0.0.111 netmask ffffff00 broadcast 10.0.0.255

groupname mofo

ether 8:0:20:c5:c0:53

hme2: flags=9040843 mtu 1500 index 4

inet 10.0.0.112 netmask ffffff00 broadcast 10.0.0.255

groupname mofo

ether 0:60:5b:e:2:dd

No comments:

Post a Comment