Operating System - HP-UX
1824940 Members
3982 Online
109678 Solutions
New Discussion юеВ

route add Network is unreachable

 
Tariq Subra
Occasional Advisor

route add Network is unreachable

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

14 REPLIES 14
Chan 007
Honored Contributor

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
Tariq Subra
Occasional Advisor

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
Rick Garland
Honored Contributor

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.
Senthil Kumar .A_1
Honored Contributor

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" ;)
Chan 007
Honored Contributor

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
Tariq Subra
Occasional Advisor

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:/$
Tariq Subra
Occasional Advisor

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.
Chan 007
Honored Contributor

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
Chan 007
Honored Contributor

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
rick jones
Honored Contributor

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
Basheer_2
Trusted Contributor

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
Tariq Subra
Occasional Advisor

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.
Edwin Cleymans
New Member

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 !

 

James Calfas
Advisor

Re: route add Network is unreachable

Another condition that will produce a Network unreachable error is if you try to add a route that conflicts with an existing route.  For example, if you enter the following command:

  

    route add net 1.1.0.0 netmask 255.255.0.0 2.2.2.2

 

and a route already exists for IP address 1.1.2.3, you have a conflict and this will produce the Network unreachable message.  You can check the existing routes with "netstat -rn".