Operating System - HP-UX
1843279 Members
2701 Online
110214 Solutions
New Discussion

Re: Add static route in HPUX11

 
SOLVED
Go to solution
Dummy_Guy
Advisor

Add static route in HPUX11

Hi all,

I try to add a static route in routing table. This is what I get:
:/data5/png_live #route add net 10.73.0.0 netmask 255.255.255.0 10.73.2.249
add net 10.73.0.0: gateway 10.73.2.249: Network is unreachable

What did I done wrong?
Both 10.73.0.0 and 10.73.2.249 are able to ping.
7 REPLIES 7
Adisuria Wangsadinata_1
Honored Contributor

Re: Add static route in HPUX11

Hi,

You need to specified whether the gateway is remote system or local system.

Check the document (docID : 3100418195) about 'Sys Adm: Adding static routes to the network' :

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000080079807

Here are examples of route add:

- Route to a subnet/network with the netmask specified, and the
gateway is a remote host:

% route add net 1.2.3.0 netmask 255.255.255.0 1.2.4.11 1

- Route to a subnet/network with the netmask specified, and the
gateway is the localhost itself:

% route add net 1.2.3.0 netmask 255.255.255.0 1.2.4.14 0

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Hanwant Verma_1
Regular Advisor

Re: Add static route in HPUX11

Try this command

#route -p add 10.73.0.0 mask 255.255.255.0 10.73.2.249

whats the result?

Hanwant
Denver Osborn
Honored Contributor

Re: Add static route in HPUX11

looks like you missed count w/ the route add syntax... default is 0 for local and I'm assuming the g/w is remote.

route add net 10.73.0.0 netmask 255.255.255.0 10.73.2.249 1

If you want this to survive a boot, add it to the /etc/rc.config.d/netconf file, then run '/sbin/init.d/net start' followed by 'netstat -rn' to see that the new route was added.

hope this helps,
-denver
Bharat Katkar
Honored Contributor

Re: Add static route in HPUX11

Hi,

Usage of route add is as:
usage: add destination [netmask mask] gateway [metric]

In your case this should work:

# route add net 10.73.0.0 netmask 255.255.255.0 10.73.2.249 1

Assuming your gateway is 1 hop count from your network and gateway ip is 10.73.2.249

Hope that helps.

Regards,
You need to know a lot to actually know how little you know
Ivan Ferreira
Honored Contributor

Re: Add static route in HPUX11

It seems that the 10.73.2.249 system is not on the same subnet, that's why you have "gateway 10.73.2.249: Network is unreachable". Verify your netmasks settings.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ranjith_5
Honored Contributor
Solution

Re: Add static route in HPUX11

Hi

Add a sequence number to your "route add net" command.


Example:-
--------------
#route add net 155.90.211.128 netmask 255.255.255.192 155.90.117.142 1

edit /etc/rc.config.d/netconf and add the following to make the changes permenent.

ROUTE_DESTINATION[1]="IP"
ROUTE_MASK[1]="NETMASK"
ROUTE_GATEWAY[1]="IP"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""


restart network services.

#/sbin/init.d/net stop
#/sbin/init.d/net start


Change the IP addresses according to your setup.

Regards,
Syam
Dummy_Guy
Advisor

Re: Add static route in HPUX11

Thank you all,

The commend:
route add net 10.73.0.0 netmask 255.255.255.0 10.73.2.249 1

Works...

I will add this in my static table /etc/rc.config.d/netconf

You guys are great!!

John