Operating System - HP-UX
1833758 Members
2335 Online
110063 Solutions
New Discussion

default route on HP UX 10.20

 
Stijn_3
Occasional Advisor

default route on HP UX 10.20

I recently added a fast ethernet NIC into a HP9000 on HP-UX 10.20. The old NIC is still in the machine but disabled and no longer connected to the network. However, the default route is still linked to the old NIC (lan0). How can I link it to the new one (lan1)? I tried deleting and readding the default route, but netstat -rn still shows that the default route is linked to the old lan0 interface.
9 REPLIES 9
Robert-Jan Goossens
Honored Contributor

Re: default route on HP UX 10.20

Hi,

change the /etc/rc.config.d/netconf ROUTE_GATEWAY[0]="145.x.3.xxx" to your NIC and gateway.

HTH,
Robert-Jan
Mel Burslan
Honored Contributor

Re: default route on HP UX 10.20

Rober, right above, describes how to do it in the netconf file. To change the default route on the fly, use these in this particular order and issue them from the system console, not over a telnet connection as this will terminate your connection to the system:

route delete default a.b.c.d

where a.b.c.d. is your current default router address

route add default w.x.y.z 1

where w.x.y.z is the new default router address that you see from the lan1. The number 1 at the end is necessary if the router is not directly attached to the interface but over a different lan connectivity equipment (a.k.a. hop)

in the poor man's routing a.b.c.d may be the address of the lan0 interface itself and you can use w.x.y.z as lan1 interface's ip address but this is not a good way to do it.

for instance, lets say currently :
# ifconfig lan0
lan0: flags=843
inet 14.22.6.8 netmask ffffff00 broadcast 14.22.6.255
# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
...
default 14.22.6.8 UG 0 lan0 0


and lets assume

# ifconfig lan1:
lan1: flags=843
inet 14.22.7.8 netmask ffffff00 broadcast 147.22.7.255

in which case your commands would be :
# route delete default 14.22.6.8
# route add default 14.22.7.8

without the hop count 1 at the end. but again this is not the preferred way of doing it. Preferred way of doing it is to ask the network admins and get the ip address of the router on this network segment and specify this number as your default route.

hope this helps.
________________________________
UNIX because I majored in cryptology...
Stijn_3
Occasional Advisor

Re: default route on HP UX 10.20

Mel,

I have already tried what you suggested, but no luck. When I delete and add a new default route, it automatically links it to the disabled NIC in the machine, and not to the new one. Below you find the output of netstat -rn. The lan0 is the disabled interface, and the lan1 is the new one.

Destination Gateway Flags Refs Use Interface Pmtu PmtuTime
10.32.0.5 127.0.0.1 UH 2 2835 lo0 4608
10.32.0.222 127.0.0.1 UH 0 2856 lo0 4608
127.0.0.1 127.0.0.1 UH 0 1113 lo0 4608
default 10.32.0.1 UG 0 0 lan0 1500
10.32 10.32.0.5 U 6445695298 lan1 1500
10.32 10.32.0.222 U 0 0 lan0 1500
Mel Burslan
Honored Contributor

Re: default route on HP UX 10.20

could you please include the output from commands

ifconfig lan0
ifconfig lan1

Thanks...
________________________________
UNIX because I majored in cryptology...
Stijn_3
Occasional Advisor

Re: default route on HP UX 10.20

lan0: flags=862
inet 10.32.0.222 netmask fffff800 broadcast 10.32.7.255
# ifconfig lan1
lan1: flags=863
inet 10.32.0.5 netmask fffff800 broadcast 10.32.7.255
Helen French
Honored Contributor

Re: default route on HP UX 10.20

Since you are not using the old NIC, why does it still have an IP address and netmask assigned to it? Remove it from /etc/rc.config.d/netconf file by putting only "" on the IP address, netmask and gateway on lan0. You need to reboot the system after this and when coming up, the system will initialize both NIC, but will assign the default route to the new NIC since that's the only avialble and configured network card on the system.
Life is a promise, fulfill it!
Mel Burslan
Honored Contributor

Re: default route on HP UX 10.20


If you let hp know about your routing situation, first thing they will tell you is not to put two network interfaces on the same subnet as this will confuse the hell out of routing tables and will result in unpredictable results.

Having said that, I have seen situations similar to yours, work. But again not knowing your network topology, assuming you are going to abandon your lan0 totally, I would suggest to take it down totally, then bring it back up with a dummy address totally different from lan1, then delete the 2 network routes at the bottom of your routing table, then add the default route from your lan1.

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

Re: default route on HP UX 10.20

On old lan, do ifconfig lanx 0.0.0.0
route add default xxxx

Anil
There is no substitute to HARDWORK
Stijn_3
Occasional Advisor

Re: default route on HP UX 10.20

Mel,

I did what u suggested, i.e giving a dummy IP to the old NIC. I also put the dummy IP in the /etc/rc.config.d/netconf file. Next, I removed the default route and readded it, and it attached it to the New Nic. Rebooted the machine and everything works fine!

Thanks a million.