route add Network is unreachable (3495 Views)
Reply
Occasional Advisor
Tariq Subra
Posts: 6
Registered: ‎10-27-2004
Message 1 of 14 (3,495 Views)

route add Network is unreachable

[ Edited ]

I can ping the gate way, but when I try to set-up an static route I get the following. However, seting up network range to it has no probelm. Here is a listing of what I get.

rhpweb01:/$ ping 192.168.200.6
PING 192.168.200.6: 64 byte packets
64 bytes from 192.168.200.6: icmp_seq=0. time=0. ms
64 bytes from 192.168.200.6: icmp_seq=1. time=0. ms
64 bytes from 192.168.200.6: icmp_seq=2. time=0. ms

----192.168.200.6 PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0
rhpweb01:/$
rhpweb01:/$ route add host 62.141.4.235 192.168.200.6
add host 62.141.4.235: gateway 192.168.200.6: Network is unreachable

Please note tried all combination of giving netmask etc.

 

 

P.S. This thread has been moved from HP-UX > System Administration to HP-UX > networking. - Hp Forum Moderator

Please use plain text.
Honored Contributor
Chan 007
Posts: 749
Registered: ‎12-06-2005
Message 2 of 14 (3,495 Views)

Re: route add Network is unreachable

have you tried 255.255.255.0 as netmask.

Also check you netstat -nr

if possible post it.

Try with count 2

Chan
Please use plain text.
Occasional Advisor
Tariq Subra
Posts: 6
Registered: ‎10-27-2004
Message 3 of 14 (3,495 Views)

Re: route add Network is unreachable

Chan,
Thaks, but this will open the whole net range which would have severe result for other system. As I explained giving a net work range works. But not single host.
For example following works.
route add net 62.141.4.236 netmask 255.255.255.252 192.168.200.6
Please use plain text.
Honored Contributor
Rick Garland
Posts: 4,470
Registered: ‎06-25-1997
Message 4 of 14 (3,495 Views)

Re: route add Network is unreachable

You can ping the gateway but is the gateway in your routing table?

The default gateway that is.

Should be a listing in your routing table with the UG flag. Do the netstat -nr to view.
Please use plain text.
Honored Contributor
Senthil Kumar .A_1
Posts: 654
Registered: ‎11-05-2003
Message 5 of 14 (3,495 Views)

Re: route add Network is unreachable

Hi Tariq,

Could you post your current netstat -rn output in this query.

Regards
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Please use plain text.
Honored Contributor
Chan 007
Posts: 749
Registered: ‎12-06-2005
Message 6 of 14 (3,495 Views)

Re: route add Network is unreachable

Enable with 255.255.255.0, in case if you have your 192.168.200.6 is your target host and router, then on that target hosts disbale ip forwarding using NDD.

Bit confusing isn't it..:-(

Chan
Please use plain text.
Occasional Advisor
Tariq Subra
Posts: 6
Registered: ‎10-27-2004
Message 7 of 14 (3,495 Views)

Re: route add Network is unreachable


rhpweb01:/$ netstat -nr | grep default
default 192.168.200.1 UG 0 0 lan0 1500
rhpweb01:/$ netstat -nr | grep 62
62.141.4.236 192.168.200.6 UG 0 0 lan0 1500
rhpweb01:/$
Please use plain text.
Occasional Advisor
Tariq Subra
Posts: 6
Registered: ‎10-27-2004
Message 8 of 14 (3,495 Views)

Re: route add Network is unreachable

Chan,
200.6 is not the target host. It is a gateway for 62.141.4 range. Which fowards to external router.
Please use plain text.
Honored Contributor
Chan 007
Posts: 749
Registered: ‎12-06-2005
Message 9 of 14 (3,495 Views)

Re: route add Network is unreachable

Hi,

The suggestion is use a layer 3 switch or use firewall with NAT. That is the possible solution.

Where in layer 3 switch you can define what is the post which can send/route to which IP.

Chan
Please use plain text.
Honored Contributor
Chan 007
Posts: 749
Registered: ‎12-06-2005
Message 10 of 14 (3,495 Views)

Re: route add Network is unreachable

Otherwise

Add an additonal lan card and use that for your routing users. There by this will be a seperate net. Only users who has access to your system will be able to work.

Note: In this case you have to disbale IP forwarding

Chan
Please use plain text.
Honored Contributor
rick jones
Posts: 3,814
Registered: ‎12-02-1996
Message 11 of 14 (3,494 Views)

Re: route add Network is unreachable

In HP-UX, a gateway IP must be in a locally connected subnet, it cannot be an IP that is reached via another gateway.

For example, if we had systems

A-B-C-D

where the '-' is a network link. On A, we could use B as the gateway IP to reach C or D, but could not use C as the gateway IP to reach D because we only reach C via B - ie C is not local.
there is no rest for the wicked yet the virtuous have no pillows
Please use plain text.
Trusted Contributor
Basheer_2
Posts: 571
Registered: ‎09-12-2002
Message 12 of 14 (3,494 Views)

Re: route add Network is unreachable

Hello Tariq

This fixed My similar problem ( to add a default route)

route add default netmask 255.255.255.1 my-gateway_addr 1

(the 1 at the end is a must in my case)

netstan -rn ( just the last line shown here)
default my-gateway_addr UG 0 lan0 0

--------
to add other routes
route add ip-addr netmask 255.255.255.0 gw-addr 1
Please use plain text.
Occasional Advisor
Tariq Subra
Posts: 6
Registered: ‎10-27-2004
Message 13 of 14 (3,494 Views)

Re: route add Network is unreachable

Thank you all.
It appears on hpux when you are seting-up a static route for a single server, you must give a count of 1 atleast. It is not required when you specifing a network range

Man route would reveal this.

For example.
For Network range:
route add net 62.141.4.236 netmask 255.255.255.252 192.168.200.6

For Single Host:
route add host 62.141.4.235 192.168.200.6 1

thanks again to U all.
Please use plain text.
Occasional Visitor
Edwin Cleymans
Posts: 1
Registered: ‎10-22-1997
Message 14 of 14 (2,268 Views)

Re: route add Network is unreachable

When I got this error message, with route add net ...

it was not the matter of adding the metrics number at the end.

All I had to do is: arp -d gateway_ip_address and then try again.

This time, the route add net command worked correctly!

The gateway ip address had to be deleted from the arp cache, funny enough !

 

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation