Set src ip for outgoing packages

Hi!

I'm using multipathnig on my Solaris 9. I have two network interfaces connected to the same network (having two different IPs) and I also have a virtual IP addres bind to one of these interfaces. What I would like to do is to set the src ip of the outgoing packages to this virtual IP.

Is there any way to do this?

Thanks.

[353 byte] By [pityq] at [2007-11-26 10:39:16]
# 1

In a normal IPMP configuration, the non-virtual addresses are marked as deprecated. That prevents them from being used as a source address. So only the virtual will be selected for that.

# man ifconfig

[snip]

deprecated

Marks the address as a deprecated address. Addresses

marked as deprecated will not be used as source

address for outbound packets unless either there are

no other addresses available on this interface or the

application has bound to this address explicitly. The

status display shows DEPRECATED as part of flags.

However, you've not shown your IPMP configuration, nor have you shown the running network configuration, so I'm only guessing.

--

Darren

Darren_Dunham at 2007-7-7 2:50:44 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 2

Here is my config:

bash-2.05# ifconfig -a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

inet 127.0.0.1 netmask ff000000

ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

inet 10.211.4.17 netmask ff000000 broadcast 10.255.255.255

groupname linkA

ether 0:3:ba:3:9c:75

ce0:1: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 2

inet 10.211.4.16 netmask ff000000 broadcast 10.255.255.255

ce0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

inet 10.211.4.211 netmask ffffff00 broadcast 10.211.4.255

ce1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3

inet 192.168.168.30 netmask ffffff00 broadcast 192.168.168.255

ether 0:14:4f:25:93:68

ce2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 4

inet 10.211.4.19 netmask ff000000 broadcast 10.255.255.255

groupname linkA

ether 0:14:4f:25:93:69

ce2:1: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 4

inet 10.211.4.15 netmask ff000000 broadcast 10.255.255.255

ce3: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5

inet 192.168.1.42 netmask ffffff00 broadcast 192.168.1.255

groupname lab

ether 0:14:4f:25:93:6a

ce3:1: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 5

inet 192.168.1.44 netmask ffffff00 broadcast 192.168.1.255

ce3:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5

inet 192.168.1.60 netmask ffffff00 broadcast 192.168.1.255

ce4: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 6

inet 192.168.1.43 netmask ffffff00 broadcast 192.168.1.255

groupname lab

ether 0:14:4f:25:93:6b

ce4:1: flags=9040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER> mtu 1500 index 6

inet 192.168.1.45 netmask ffffff00 broadcast 192.168.1.255

ce5: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 7

inet 192.168.168.40 netmask ffffff00 broadcast 192.168.168.255

ether 0:3:ba:3:9c:76

What I would like to achive is that all outgoing packages on interface ce0 and ce2 should have as source IP the address fro ce0:2 (10.211.4.211)

pityq at 2007-7-7 2:50:44 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 3

Okay.

I'm assuming ce0:1 and ce2:1 are your test addresses.

ce0 and ce2 are both in 'linkA'. Outbound packets may use either address. Both will be available as failover if either ce0 or ce2 fails.

However, what is ce0:2 doing? It's not part of your IPMP but it is on the same subnet. It is not protected against failure of ce0 and may be used for outbound traffic. Why is it configured?

Also, do you have your /etc/netmasks file set properly? Both ce0 and ce2 have different netmasks from the others.

--

Darren

Darren_Dunham at 2007-7-7 2:50:44 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 4

My netmask file looks ok:

10.211.4.17255.255.255.0

10.211.4.19255.255.255.0

ce0:2 is an ip managed by a third party software ( veritas cluster server) The application that configures ce0:2 checks the mpath daemon and in case of failover to ce2 it moves the ce0:2 to ce2:2.

Basically I have a cluster install and the cluster server in case of failover from a node to the other moves the IP address from the ce0:2 to the active node. What I want is that whichever is the active node the outgoing packets source ip should be the address from ce0:2

pityq at 2007-7-7 2:50:44 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 5
This is a much more complex environment. I'm not aware of how to force a default for oubound connections in Solaris 9. (Solaris 10 offers some new flags in ifconfig).-- Darren
Darren_Dunham at 2007-7-7 2:50:44 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 6
OK, Thanks anyway.
pityq at 2007-7-7 2:50:44 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 7
Don't know if this will help but you can try the metric option in ifconfig. Assign a lower value to the interface you want to use as a default. This basically "tricks" the system into thinking the "default" interface takes less hops.
schererd at 2007-7-7 2:50:44 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...