1832412 Members
2825 Online
110041 Solutions
New Discussion

different IP address

 
Gary Seibak
Advisor

different IP address

Does 10.20 support having lan cards on 2 different subnets? And if it does can I have 2 default gateways then?
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor

Re: different IP address

You can have n lan cards as long as they are on different subnets but there is only one default route.
If it ain't broke, I can fix that.
Gary Seibak
Advisor

Re: different IP address

I guess I should have been clearer. I have lan0 on subnet A, and lan1 on subnet B. can lan0 be on a default gateway and lan1 be on its default gateway different from lan0? I have tried to put "default" in /etc/rc.config.d/netconf for each card but not sure it that is correct.
Steven E. Protter
Exalted Contributor

Re: different IP address

The default gateway can be on lan0 or lan1 or any lan.

On HP-UX you can never have two NICs on the same subnet.

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
Uday_S_Ankolekar
Honored Contributor

Re: different IP address

Two default gateway can be configured on 11.x onwards. I don't think in 10.2 you can do this.

-USA..
Good Luck..
Gary Seibak
Advisor

Re: different IP address

I have the cards on different subnets can I know leave the ROUTE_DESTINATION for lan1 blank
or does there have to be a value in there.
Uday_S_Ankolekar
Honored Contributor

Re: different IP address

you can specify multiple default routes in netconf but HP-UX 10.20 alway use only the first one.

and you don't need ROUTE_DESTINATION entry in netconf for the second lan

INTERFACE_NAME
IP_ADDRESS
SUBNET_MASK
BROADCAST_ADDRESS

entries are must.

-USA..
Good Luck..
Mel Burslan
Honored Contributor

Re: different IP address

Yes you can have two default routes on 11.x OS but it is a very confusing situation. Especially if one interface is facing outside world and the other to the local intranet, routing will be a mayhem. Try to avoid using two default routes.

Considering your default gateway on lan0 you can always provide a secondary gateway for the lan1 with the route destination being the subnet it is connected to instead of word "default" as in lan0.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Andrew Cowan
Honored Contributor

Re: different IP address

Gary,

Are you sure you mean "default" route? If you have two interfaces with different logical subnets, the OS should automatically create a "route", and will automatically send the traffic through the correct interface. E.g

Lan0 = 10.1.x.x
Lan1 = 19.55.x.x

ping 10.1.x.x will always go to Lan0 and ping 19.55.x.x will always go through Lan1.

The default route comes into play when you attempt to access an address that is outside of these subnets and thus would be require furher routing. E.g. D/G is a router with address 10.1.1.1. Now if you ping 192.168.3.1 the request is set here then forwarded by your router.

TCP/IP can never access addresses outside of its own subnet, and this is why you need a router/default route. Remember that the router(s) can only see the destination because it has an interface in this subnet.