Operating System - HP-UX
1834936 Members
2221 Online
110071 Solutions
New Discussion

Outbound connection through floating IP

 
Pramod_4
Trusted Contributor

Outbound connection through floating IP

Hi,

I have a MCSG cluster with two nodes.
All incoming traffic comes to the system through the floating IP.

Is there any way to ensure that all outbound connections from the system ( where ever the package is running ) use the floating IP rather than the system IP.

Thanks in advance to all those who can reply.

Pramod

4 REPLIES 4
Anthony deRito
Respected Contributor

Re: Outbound connection through floating IP

Pramod, take a look at your routing tables. Run the command netstat -nr. Check out the "Interface" field. Each entry in your routing table will use the specified interface to route outbound traffic.

Tony
John Palmer
Honored Contributor

Re: Outbound connection through floating IP

Hi,

There is an interesting discussion about this at:-
http://docs.hp.com/hpux/onlinedocs/B3936-90026/B3936-90026.html

The section that is significant is the following:-

Call bind() before connect()

When an application initiates its own connection, it should first call bind(2), specifying the application IP address before calling connect(2). Otherwise the connect request will be sent using the stationary IP address of the system's outbound LAN interface rather than the desired relocatable application IP address. The client will receive this IP address from the accept(2) call, possibly confusing the client software and preventing it from working correctly.
-----------------------------------------------

Thus you must code your application to use the relocatable IP address if it is initiating connections.

If you are need to force 'standard applications' (such as ftp for instance) to use the relocatable address then it seems that your only option is to ensure that the relocatable address is the only address on that interface (also discussed at the above URL).

Regards,
John
Dietmar Konermann
Honored Contributor

Re: Outbound connection through floating IP

Hi, folks!

Generally, the application should be configurable to bind() itself to a specific relocatable IP-address instead of binding to INADDR_ANY.

Using 11.x You may use a static route to force outgoing traffic to be stamped with the 'right' source address...

# route add 0

You could add such a route during pkg start and remove during halt. But be careful, not to disturb heartbeat traffic using this trick!

Regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Pramod_4
Trusted Contributor

Re: Outbound connection through floating IP

John:

It?s a running application, which uses many third part API?s and where we don?t have any control on it.