Operating System - HP-UX
1827351 Members
6498 Online
109963 Solutions
New Discussion

Re: Changing Source address HP-UX 11.xx

 
Neil Smith_3
Occasional Contributor

Changing Source address HP-UX 11.xx

I am wondering if there is a method/application that allows the use of an application runnning on HP-UX 11.xx to use a Virtual address as the source?
The ojective here, is to be able to virtualize an application so that it can be tied to a virtual address for both outbound, and inbound traffic.

Thanks

Neil,
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: Changing Source address HP-UX 11.xx

Thats really an application issue.

You set up a virtual ip address in /etc/rc.config.d/netconf, then you tell your application what its home is.

In truth, if you look at a packet sniffer, the packets are not really going through the virtual interface. You can see them all going through the main address.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Neil Smith_3
Occasional Contributor

Re: Changing Source address HP-UX 11.xx

In response to your comment about viewing the source address from and packet sniffer. This is exactly what I would like to change. Something similar to to IP spoofing the source.
We have interface program's that communicate using specific Source and destination address's, as well as ports. What I would like to be able to do, here is the ability to use a virtual source address, that would allow me to move the interface application from server to server, with the use of the virtual Address. This works fine for destination, but the source (as it is now) will always be the physical interface address.

Thanks

Neil
Steven E. Protter
Exalted Contributor

Re: Changing Source address HP-UX 11.xx

In that case, I would suggest you change the primary IP address of the server.

Virtualization makes the IP address work for the client. You can connect to it, it even shows up in netstat -an output.

Since the IP address is completely valid, you can tell your appplication to use it. I'd have to know what the application is to provide specific advice on how to convert its configuration.

Example: httpd.conf for apache can be told to Listen on a virtualized IP address. Then you restart it and all appears to go through the virtual interface.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Tim Rotunda
Frequent Advisor

Re: Changing Source address HP-UX 11.xx

So what you are trying to do is get the outbound packet to use the virtual IP as the source address?
Neil Smith_3
Occasional Contributor

Re: Changing Source address HP-UX 11.xx

yes
Jim Keeble
Trusted Contributor

Re: Changing Source address HP-UX 11.xx

Assuming that you have control of the applications source code, the solution is to use the bind() system call to associate the local socket with the virtual IP address.

By default, a udp application, or a tcp application doing outbound "connect()" calls implicitly bind to the primary IP of the outbound interface.

The serviceguard manuals talk about this here:

http://www.docs.hp.com/en/B3936-90073/apcs03.html#d0e20909

In the section titled:

Bind to Relocatable IP Addresses

It doesn't matter that you are not using serviceguard, the principles apply.


If you do not have control of the source , you can play some games with routing in some cases. The downside is that ALL the packets to the destination IP are affected and will come from the virtual IP. Changing the source code is the best solution if you can do it.
Devesh Pant_1
Esteemed Contributor

Re: Changing Source address HP-UX 11.xx

Use the product MC Serviceguard which can be purchased separately and can help you with binding the secondary IP address.