Operating System - HP-UX
1833944 Members
1852 Online
110063 Solutions
New Discussion

add route to routing table

 
SOLVED
Go to solution
Todd McDaniel_1
Honored Contributor

add route to routing table

I have a situation where I rebooted a box over the weekend and now we cant connect to it over a VPN, but we can get to it from the internal corporate Lan.

I think it is a matter of adding a route to the routing table, however, I am not versed in such things.

Here is a copy of my routing information from netstat -rn.

===========================================
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.10.10.1 10.10.10.1 UH 0 lan1 4136
172.25.128.135 172.25.128.135 UH 0 lan0 4136
192.168.32.40 192.168.32.40 UH 0 lan2 4136
172.25.128.128 172.25.128.135 U 2 lan0 1500
192.168.32.0 192.168.32.40 U 2 lan2 1500
10.0.0.0 10.10.10.1 U 2 lan1 1500
198.148.130.0 192.168.32.1 UG 0 lan2 0
127.0.0.0 127.0.0.1 U 0 lo0 0
default 172.25.128.129 UG 0 lan0 0
Unix, the other white meat.
9 REPLIES 9
Bill Hassell
Honored Contributor

Re: add route to routing table

The existing routing table won't help. You need to know the subnet used by your VPN and how to reach it from your current LAN(s). Your network administrator will have to give you these details.

This was probably done a long time ago using the route command but the system administrator forgot to add the new route to the netconf file. This file must be edited to make the route permanent between reboots. It is located in /etc/rc.config.d


Bill Hassell, sysadmin
Todd McDaniel_1
Honored Contributor

Re: add route to routing table

Bill,

I have the routing info from my network admin. How do I add it to the new IP/subnet mask to my netconf?

Unix, the other white meat.
Todd McDaniel_1
Honored Contributor

Re: add route to routing table

Well I should say I have the IP and subnet mask of the VPN. Hopefully that is enough.
Unix, the other white meat.
Tim Nelson
Honored Contributor
Solution

Re: add route to routing table

route add destination/net netmask if.nee.dd.ed router 1

eg.

route add 10.1.1.0 netmask 255.255.255.0 172.20.16.1 1

edit /etc/rc.config.d/netconf to make permanent.

man route for additional details ..



Todd McDaniel_1
Honored Contributor

Re: add route to routing table

Hi thanks.

I have another question. The IP in question is already defined in the netconf file, I think it is a matter of the mask being wrong. I cant run a ifconfig on the IP b/c it is wanting a lan #... how can I tell the netmask for a TSM lan card?

ROUTE_DESTINATION[2]=198.148.130.0
ROUTE_MASK[2]=""
ROUTE_GATEWAY[2]="192.168.32.1"
ROUTE_COUNT[2]=""
ROUTE_ARGS[2]=""


The netmask for lan2 is 255.255.255.0... I dont see a mask defined for the IP listed above... would it take the default of lan2?

Can the netmasks be different or not?
Unix, the other white meat.
Eric SAUBIGNAC
Honored Contributor

Re: add route to routing table

Bonjour,

You clearly miss ROUTE_COUNT. Here is the definition :

"An integer that indicates whether the gateway is a remote host or the local host. If the route leads to a destination through a remote gateway, count should be a number greater than 0. If the route leads to destination and the gateway is the local host, count should be 0. The default for count is zero. The result is not defined if count is negative."

Withe "route" command, if you don't specify word "net" in destination the target is supposed to be a network not a host. If you don't specify the netmask it will be that corresponding to the IP class. In this case class C means "255.255.255.0"

So everything is ok but route count. You can modify netconf like this :

ROUTE_DESTINATION[2]=198.148.130.0
ROUTE_MASK[2]=""
ROUTE_GATEWAY[2]="192.168.32.1"
ROUTE_COUNT[2]="1"
ROUTE_ARGS[2]=""

But I would do like this to be more precise :

ROUTE_DESTINATION[2]="net 198.148.130.0"
ROUTE_MASK[2]="255.255.255.0"
ROUTE_GATEWAY[2]="192.168.32.1"
ROUTE_COUNT[2]="1"
ROUTE_ARGS[2]=""

After modifying netconf, you can add this route without rebooting :

route add net 198.148.130.0 netmask 255.255.255.0 192.168.32.1 1

Hope this will help

Regards

Eric

Todd McDaniel_1
Honored Contributor

Re: add route to routing table

Eric,

Thanks for all the help, however, I already have that exact route defined as such in my netstat output...

Can I just add the hop count and then it would work?

also, they keep telling me that I need to alter my subnet mask, but with the hop count in there, do I need to worry about that since it is going past the local gateway?
Unix, the other white meat.
Todd McDaniel_1
Honored Contributor

Re: add route to routing table

Eric,

Thanks for all the help, however, I already have that exact route in use...

Can I just add the hop count and then it would work?

also, they keep telling me that I need to alter my subnet mask, but with the hop count in there, do I need to worry about that since it is going past the local gateway?
Unix, the other white meat.
Eric SAUBIGNAC
Honored Contributor

Re: add route to routing table

Bonjour Todd,

Sorry for the late reply, but I was outside of office.

> "I already have that exact route defined as such in my netstat output... "

You are right, bad reading of your initial post --> "198.148.130.0 192.168.32.1 UG 0 lan2 0". May be we could verify routes' netmask with "netstat -rnv" but I guess it will be OK.

> "Can I just add the hop count and then it would work"

Since flags of this route is "UG", it means a hope count has already been entered. So it should work ... :-(

For route count I did a mistake : at startup if ROUTE_COUNT[] is empty in netconf, the script /sbin/init.d/net assumes a default count with 1 (line 310 for me). That is why the route is OK.

One idea : does your gateway answer to ping request ? If not you might be in a "dead gateway probes" situation. In a few words, HP-UX will disable a route if the gateway doesn't respond to ICMP echo requests, for security reasons for example.

If you can't ping the gateway, try this :

ndd -get /dev/ip ip_ire_gw_probe

Default value is 1. In this case "dead gateway probes" is enable. De-activate it :

ndd -set /dev/ip ip_ire_gw_probe 0

Then delete the route and add it back :

route delete 198.148.130.0 192.168.32.1
route add net 198.148.130.0 netmask 255.255.255.0 192.168.32.1 1

> "they keep telling me that I need to alter my subnet mask"

We need more informations to understand why you might do that ... What is you IP plan on both site ?

Regards

Eric