Operating System - HP-UX
1841881 Members
3342 Online
110185 Solutions
New Discussion

Static Virtual IP Address Possible?

 
Michael Worsham
Occasional Advisor

Static Virtual IP Address Possible?

Users access the server application via X-Windows through an IP aliased address.
The problem: The data being sent goes to the eth0:1 (192.168.1.2) address, but data coming back comes from lan0 (192.168.1.1), thus failing. We are attempting to have 2 IP addresses out of the same nic (ie. IP aliasing... lan0 & lan0:1), but would like to keep the traffic on the 2 IP addresses rather than defaulting back to the primary lan0 one.

Is it possible under HP-UX 10.20 to hard code virtual IP addresses? (ie. if I send to lan0:1, data comes back along the same IP address)

Installing a 2nd NIC nor upgrading to 11.x is NOT an option.

-- M
Be lazy. Do it right the first time.
5 REPLIES 5
Jeff Schussele
Honored Contributor

Re: Static Virtual IP Address Possible?

Hi Michael,

I assume you have both IP entries in the /etc/rc.config.d/netconf files. Make sure you incremented the index number in there.
So I would then ask if you have BOTH IP/hostname entries in your name service - be it hosts file/DNS/NIS?
Do an nslookup on both & by name AND IP.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Michael Worsham
Occasional Advisor

Re: Static Virtual IP Address Possible?

All that would do is set up the interface - it would not cause it to route with that IP address.

An additional response from the user states: "We have an address Natted for that server now. And as far as I can tell it is working fine."

Is there any other possible option for a static virtual IP address?

-- M
Be lazy. Do it right the first time.
Christopher Caldwell
Honored Contributor

Re: Static Virtual IP Address Possible?

Given two IPs, the base IP A.B.C.D and a "virtual IP" A.B.C.E, I think you mean you're trying to get service that comes in on A.B.C.E to go out on A.B.C.E, instead of A.B.C.D.

If I understand what you're asking, then the answer is, it's up to the application.

Applications that bind to IPs using INADDR_ANY (like telnetd, rlogin, etc.) can go on A.B.C.E, but response will always look like they're coming from the base IP of the system (A.B.C.D). Applications that bind to specific IP addresses (e.g. modern web servers, modern sendmail), will speak on the specific IPs you configure.

From what I've seen, most of the X stuff uses INADDR_ANY by default; I'm not sure if you can configure otherwise.
sven verhaegen
Respected Contributor

Re: Static Virtual IP Address Possible?

I've got some experience with the routing table behaviour of the HP-UX implementation so here it goes :


the issue you are seeing has nothing to do with applications , it is merely the way the HP routing table is implemented , that is being one interface having 2 entries it will appear twice in the routing , the cable they are working on is physically the same so the machine doesn't differentiate on it , there are merely 2 access point tot he same network , the HP implementation of a routing table is that when request leave for a certain network the machine will scan it's routing table and go with the first entry in the routing table , despite a second being available with the exact IP the request arrived on if the network reached is the same ... there is no way of getting around this , is this a serious issue for you , normally the reply address isn't that important unless for some security issues
...knowing one ignores a greath many things is the first step to wisdom...
Michael Worsham
Occasional Advisor

Re: Static Virtual IP Address Possible?

Thanks for all that replied to this message. Here is the response I got from HP support:

Problem:
Forcing packets to leave out of the same IP or Virtual IP address that it comes in.

Solution:
The IP stack for 10.20 doesn't allow this because it by default will use the source IP address (real IP address as suppose to a virtual IP address) to send the packet back out. After discussing with my colleagues the only way it could be done is by socket programming and hard coding the Virtual IP address to be used.

A better solution would be to upgrade the OS to 11.0, which then allows you to force packets out of a particular lan interface or IP address in your case.

[contact info removed]
Be lazy. Do it right the first time.