Operating System - HP-UX
1834650 Members
2265 Online
110069 Solutions
New Discussion

Re: Secondary IP on same subnet and already in use.

 
Nikhil_6
Occasional Advisor

Secondary IP on same subnet and already in use.

hello,
I am using a hpux 11i. I am trying to configure a secondary IP on lan0. I can add a secondary IP on secondary interface i.e. lan0:1
however, the problem is when I try to add this secondary IP which is already in use by some other machine and hp machine doesn't care if the IP address is in use or not. (It takes this IP and then the other machine using this IP becomes unresponsive as a consequence).
Does hpux 11i has something (some command, some configuration param) which will first check if the IP is in use and if it is then it won't allow me to 'UP' the secondary interface with this IP?
And if such a thing is not available then can anyone suggest a workaround?
11 REPLIES 11
KapilRaj
Honored Contributor

Re: Secondary IP on same subnet and already in use.

Do a ping to the address before it is brought up

Kaps
Nothing is impossible
Sanjay Kumar Suri
Honored Contributor

Re: Secondary IP on same subnet and already in use.

I don't think there is some command or configuration param which will first check if the IP is in use.

Use ping to test ip connectivity.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Mobeen_1
Esteemed Contributor

Re: Secondary IP on same subnet and already in use.

Nikhil,
I don't think that there is any command to check if the secondary ip that you are defining is already taken.

As folks before me have suggested you can

1. Ping the IP given to you before you
assign the same as secondary to your HPUX
server

2. Also you could do a nslookup

Apart from this, i cannot think that you can do much of testing.

I think the onus is on your DNS administrator to give you an IP that is not in use. One of the DNS admins job is to make sure that there is no IP duplication. Also i thought some DNS server softwares don't allow duplication of IPs.

rgds
Mobeen
Mobeen_1
Esteemed Contributor

Re: Secondary IP on same subnet and already in use.

Nikhil,
Also just wanted to let you know that, i have seen a couple of times that IP collisions causing the server to become non-responsive....just a word of caution

rgds
Mobeen
Nikhil_6
Occasional Advisor

Re: Secondary IP on same subnet and already in use.

Ok,
one more to thing to this. the primary IP and the secondary IP are on totally different networks. So unless I configure my interface (IP) to be in that subnet I cannot really ping the other IP (No router present to connect these networks.)
To give you clear idea, this is the network setup I wish to do.

I/F IP netmask
machine 1:
lan0: 10.32.1.202 255.255.255.0
lan0:1 10.32.5.217 255.255.255.0

machine 2:
lan0: 10.32.5.217 255.255.255.0

Now bringing up lan0:1 renders machine 2 useless. So machine 1 should first check if this IP address is in use or not. If it is not then it should proceed and make the lan0:1 'UP'.
Ravi_8
Honored Contributor

Re: Secondary IP on same subnet and already in use.

Hi,

any unix doesn't have such facility to check the IP assigned whether it's in use or not. they accept it as it is. after the lan interface comes up with the supplied IP. if the same exist, then there will be clash else it works.
never give up
Mobeen_1
Esteemed Contributor

Re: Secondary IP on same subnet and already in use.

Nikhil,
I still think that its not possible to do any checking in the scenario mentioned on the OS side.

Can u please tell me what name you have defined to your IP in DNS. If you have a name for this IP, then i fail to understand how come the DNS takes duplication. I know that you can have one IP and a name for that ip and additionally aliases for that name. But i don't think you can have multiple names for one IP.

Another question i have is "Is there any specific reason why you are trying to do this ?"

I am sorry for asking too many questions, i hope i will be forgiven :-)

rgds
Mobeen
Nikhil_6
Occasional Advisor

Re: Secondary IP on same subnet and already in use.

Hey thank you all,
But in that case should it not be possible to fire a query which the machines prior to 'UP' their interfaces on network at the boot time do to check if the IP address is already in use or not?
and what I think is not correct then are there some tools available which will do a RARP query and compare the MAC addresses received in reply with its own MAC address and then return the reply that such a IP address is not in use or in use by another machine?
Note that both IP addresses are on same ethernet segment but on different logical subnets.
Nikhil_6
Occasional Advisor

Re: Secondary IP on same subnet and already in use.

Andrew Cowan
Honored Contributor

Re: Secondary IP on same subnet and already in use.

This may sound dim, but could you not simply setup a Linux/pc on the second network that simply pings once every couple of seconds and then displays the MAC address that currently holds the IP Address. Since you can use lanadmin to discover your MAC address, you would know which machine was active. In this way you could at least see, whether it was safe to bring up the other interface.

The other simpler solution would be to bring up this interface on a temporary address, ping to see if the other machine was using it, if not down it, switch addresses, and bring it up again. The whole operation should take less than 10 seconds.
Nikhil_6
Occasional Advisor

Re: Secondary IP on same subnet and already in use.

Thanks Andrew,
The thing is I need a IP address which will not be used by anybody else for pinging and hence the IP should be owned by me.
Actually, I was exercising the whole thing to check another machine's status and if it is not running some processes then grab that IP and continue offering same services here
(HA) but a simple one.
Thanks.