Operating System - HP-UX
1838282 Members
2890 Online
110125 Solutions
New Discussion

Re: routing table with more than one NIC

 
SOLVED
Go to solution
Dermot Beirne
Frequent Advisor

routing table with more than one NIC

Hi,
I have a HPUX 10.20 box with two network cards. Each in on a different network. Lan0 is on the 193.178. network and Lan1 is on the 10.149. network.
When I view the routing table, it only shows me LAN1 routes. Can i specifically ask for the routing table for LAN0?
Also, how do I add routes for the LAN0 network, so they use LAN0 and only appear as if they came from LAN0 (i.e. 193.178. network). New routes are defaulting to LAN1's network.

I'd appreciate any help.
Thanks,
Dermot
Happy is harder than money. Anyone who thinks money will make them happy, doesn't have money.
3 REPLIES 3
Sridhar Bhaskarla
Honored Contributor
Solution

Re: routing table with more than one NIC

Hi,

It is because the default route is specified through the IP of lan1.

You can define static routes. For ex., if there is a router 193.178.x.1 that can route to another network (say 200.200.200.0 then you would add the route

route add net 200.200.200.0 netmask 255.255.255.0 193.178.x.1 1

So all the packets destined to the network 200.200.200.0 will go through lan0.

To make it permanent, you would add the above into your /etc/rc.config.d/netconf.

ROUTE_DESTINATION[1]="200.200.200.0"
ROUTE_MASK[1]="255.255.255.0"
ROUTE_GATEWAY[1]="178.x.1.1"
ROUTE_COUNT[1]=1

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
Dermot Beirne
Frequent Advisor

Re: routing table with more than one NIC

That did the trick. Thanks very much for your help.
Dermot.
Happy is harder than money. Anyone who thinks money will make them happy, doesn't have money.
rick jones
Honored Contributor

Re: routing table with more than one NIC

When/if you are able to update to 11.X, instead of having to add static routes (which you would still be able to do...) you could use ndd to set ip_strong_es_model to a value of "1" at which point route lookups include the source IP address. This tends to mean that you can have things like per-interface default routes etc etc.

ftp://ftp.cup.hp.com/dist/networking/briefs/annotated_ndd.txt
there is no rest for the wicked yet the virtuous have no pillows