LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Route problem (https://www.linuxquestions.org/questions/linux-networking-3/route-problem-640214/)

leiw 05-06-2008 02:29 AM

Route problem
 
Hello,

The following error occur when I type route add -net 10.0.0.0 netmask 255.255.255.0 gw 192.16.0.2


SIOCADDRT: Network is unreachable


OS: Centos 5


Thx

rayfordj 05-06-2008 07:30 AM

"gw 192.16.0.2", is this accurate or meant to be "gw 192.168.0.2".

In my experiences it'll need to be done one of a couple ways depending on scenario and versions.
first, make sure that your host (i'll call it 192.168.0.3) can route to your default gw (192.168.0.1) to the world. now, assuming that 192.168.0.2 is a system that has connection to 10.0.0/24 we'll want to use it as a gw for all of that traffic so you'll want to tell 0.3 host how to send 10. traffic with something like...
Code:

route add -net 10.0.0.0/24 gw 192.168.0.2 dev eth0
if this works, you can put it in a route-ethX file for your configuration in the format that ip route understands.

/etc/sysconfig/network-scripts/route-eth0:
Code:

10.0.0.0/24 via 192.168.0.2 dev eth0
then it'll be added when the interface comes up and removed when it is downed.

hope this helps.

If I'm not even close, please provide more details about your network configuration to better understand your situation and see if we are not able to identify a better solution for you. ;-)

datopdog 05-07-2008 08:30 AM

you can do this as well route is depreciated.

Code:

ip route add 10.0.0.0/24 via 192.168.0.2

tajamari 05-08-2008 02:18 AM

Quote:

Originally Posted by leiw (Post 3144246)
Hello,

The following error occur when I type route add -net 10.0.0.0 netmask 255.255.255.0 gw 192.16.0.2


SIOCADDRT: Network is unreachable


OS: Centos 5


Thx

i have two questions

1. is it 192.16.0.2 or 192.168.0.2?
2. can you ping 192.168 segment from you 10.0.0 segment?

if yes you need 10.0.0.0/24 or /125 /26 or whatever you prefer on your route command


All times are GMT -5. The time now is 08:18 PM.