Operating System - HP-UX
1832617 Members
2792 Online
110043 Solutions
New Discussion

2 ip on same network & machine

 
EML
Advisor

2 ip on same network & machine

I'm planning to add an ip address to my machine on different lan port. Is it ok if I use an ip address on the same subnet?

For example:
lan0 = 172.21.115.10
lan1 = 172.21.115.11 (new)

How will I know when I telnet to another machine that I use lan0 for the connection?
7 REPLIES 7
Bill McNAMARA_1
Honored Contributor

Re: 2 ip on same network & machine

I'd imagine you use
netstat -a
to check this out.

Later,
Bill
It works for me (tm)
Ravi_8
Honored Contributor

Re: 2 ip on same network & machine

Hi,

#netstat -rn

shows you used one is lan0 or lan1
never give up
Bill Douglass
Esteemed Contributor

Re: 2 ip on same network & machine

You can have multiple interfaces on the same subnet.

The interface used for outbound packets to that subnet will be the first one listed in the netstat -rn command.

See the routing man page (man 7 routing).

This is assuming hp-ux 11.0 or higher.
Uday_S_Ankolekar
Honored Contributor

Re: 2 ip on same network & machine

You can use multiple IP's of same subnet.

netstat -rn will show you corresponding IP address for lan0 or lan1

As per your example if you use 172.21.115.10 to telnet then you are using lan0 and if 115.11 that means lan1

-USA..


Good Luck..
Kevin Wright
Honored Contributor

Re: 2 ip on same network & machine

it goes in order of your routing table, from top down, displayed with netstat -nr.
rick jones
Honored Contributor

Re: 2 ip on same network & machine

If you want to force traffic (generally) to exit the interface through which it arrived, you might consider setting ip_strong_es_model to a value of one with ndd (and in the nddconf file). There are some side effects you may or may not want - search the forum for ip_strong_es_model for more references.

otherwise, if you want HA or load balancing across the two NICs configured into the same subnet, you should consider getting the Auto Port Aggregation software - it can trunk the two NICs together and present a single virtual NIC to the transport.
there is no rest for the wicked yet the virtuous have no pillows
Shannon Petry
Honored Contributor

Re: 2 ip on same network & machine

Rick as usual brings up a valid point of interest. Many people think that by simply adding a 2nd NIC they will double network throughput.

While this can be kind of made to work, understand that all outbound traffic will be on the same NIC.

While you can force the system to use the same NIC to send on which it received, there is another huge flaw.

Most applications will not use multi-home lookups, so however you resolve the host it will not happen 99% of the time in a round robyn fashion. DNS and sendmail are to exceptions from the top of my head. Most applications however will only take the first entry from DNS, NIS, and /etc/hosts.

You may be wasting money by simply adding a NIC, depending on what you are trying to accomplish.

Sincerely,
Shannon
Microsoft. When do you want a virus today?