Operating System - HP-UX
1832350 Members
2623 Online
110041 Solutions
New Discussion

Re: unable to add new routes

 
A.K.
Frequent Advisor

unable to add new routes

I have HPUX 11.00 L2000
I am unable to add new routes to the routes table
With route add xxx.xxx.xxx.xxx command
Also if I add the script in /etc/rc.config.d/netconf
And reboot the server it doesn???t listed when I do netstat ???rn
My problem is that the default address is missing and I don???t have network
Anyone has an idea ???

10 REPLIES 10
Patrick Wallek
Honored Contributor

Re: unable to add new routes

What is the exact command you are trying to use and what does your netconf file look like?

KCS_1
Respected Contributor

Re: unable to add new routes

hi,

SYNOPSIS
/usr/sbin/route [-f] [-n] [-p pmtu] add [net|host] destination
[netmask mask] gateway [count]

/usr/sbin/route [-f] [-n] delete [net|host] destination
[netmask mask] gateway [count]


For example)

# route add net[host] 222.223.224.0 222.223.224.254 1



Easy going at all.
steven Burgess_2
Honored Contributor

Re: unable to add new routes

Hi

Any error messages also

Steve
take your time and think things through
A.K.
Frequent Advisor

Re: unable to add new routes

i execute the route add command without any error messages but executing command netstat -rn does not show the expected new route

Thanks,
Ron Kinner
Honored Contributor

Re: unable to add new routes

netconf should have:

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="A.B.C.D"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

If you use the hostname instead, verify that it resolves to a good address on the same subnet as the HPUX.

When adding the route from the command line did you remember to put the 1 at the end of the line to show that it was 1 hop away and not a localhost destination?

Can you ping the IP address of the gateway? Can you ping its hostname? Did you check that the hostname has the correct IP address in /etc/hosts? Or that nslookup hostname works?

If you can't ping it because for security reasons it doesn't reply to ICMP echo requests then you have to make a change in ndd.

ndd -set /dev/ip ip_ire_gw_probe 0

should turn dead gateway detection off. If not you are missing a patch.

Also 11.0 enforces an obsolete RFC which banned the use of the first and last subnets. Nowadays these are often used so you may need to turn off subnet checking:

ndd -set /dev/ip ip_check_subnet_addr 0

If either of these helps be sure to edit /etc/rc.config.d to keep them after a reboot.

Ron
MANOJ SRIVASTAVA
Honored Contributor

Re: unable to add new routes

Hi AK

this is from the documentation :
PROBLEM
How do I add or delete a route both on the fly and permanently?
RESOLUTION
route add default 15.32.7.1 1
Where the last '1' signifies that this gateway is external to the host system (a
router for example). If no digit at the end a '0' is assumed which signifies
the local interface/internal to the host.

route add net 15.43.9.0 15.32.7.1 1
We are saying we want anything to the 15.43.9 subnet to use gateway 15.32.7.1

route delete default 15.32.7.1
We are deleting our default route and gateway

route delete net 15.43.9.0 15.32.7.1
We are deleting the directive for the 15.43.9 subnet.

These command statements are only good until the next reboot. Anything you
want to have permanent must be hard coded in the /etc/rc.config.d/netconf file.
Remember that you cannot back up the netconf file in the /etc/rc.config.d
directory. If you want to save a backup before modifying, move the backup
(netconf.old, .save, etc) to a different directory.

ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=15.32.7.1
ROUTE_COUNT[0]=1

ROUTE_DESTINATION[1]="net" 15.43.9
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=15.32.7.1
ROUTE_COUNT[1]=1



Manoj Srivastava
Steven E. Protter
Exalted Contributor

Re: unable to add new routes

can you ping the destination of the route?

can you traceroute to the destination of the route.

You might be failing due to external physical network issues, for example wiring, or router ios.

The netmask of the route being added should not be incompatible with the configuration of the NIC card the route is going out on.

What I mean by that, is if I try and add a route to a destination that is not reachable due to the subnet mask on the NIC card, its not going to function as a route destination whether or not I get an error from the route add command.

An actual command line and error message, plus resulting netstat output would be extremely useful in this case.

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
A.K.
Frequent Advisor

Re: unable to add new routes

OK guy???s I found that the
#/usr/sbin/route file was corrupt and was empty
this is why when I used this command noting happened
I recover it from a different server and start
#/sbin.init.d/net start
It update all the necessary IP address in the routeing table
I have now network communication
Everything is back to normal
Thanks for all the answers it was helpful
Steve Labar
Valued Contributor

Re: unable to add new routes

Your first goal should be to verify your gateway is in the same subnet as the L2000 and can be reached via ping. If your gateway is in a different subnet, the host doesn't know how to reach it without an additional gateway defined. If you are using a custom subnet mask, the netmask should match. In the netconf file, make sure you increment each number of the route in square brackets.
ROUTE_DESTINATION[0]
ROUTE_DESTINATION[1]
etc.

Good Luck.

STeve
Michael Steele_2
Honored Contributor

Re: unable to add new routes

Regarding:

"...Also if I add the script in /etc/rc.config.d/netconf
And reboot the server it doesn???t listed when I do netstat ???rn ..."

Common mistake not to increase the indices when updating the netconf file. This happens a lot.

ROUTE_DESTINATION[1]
verses
ROUTE_DESTINATION[0]

Note the [#]indice must be increased.

Also use this command from the command line, but configuration will be lost at reboot:

route add default 192.168.102.2 1 <= Note the hop count.

-or-

route add 0.0.0.0 192.168.102.2 255.255.255.0 will also work. <= Note the 0.0.0.0 is the same as default.
Support Fatherhood - Stop Family Law