Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here is my route -n output:


Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

And if I try to add a static route by this command:

route add -net 192.168.50.0 netmask 255.255.255.0 gw 192.168.50.1

I get the following output:

SIOCADDRT: No such process

Why that? Can anybody explain my the concept of adding static routes in linux.

If I also have a route-eth0 file under the /etc/sysconfig/network-scripts/ directory, with this line in it: 123.123.123.0/24 via 123.123.124.1, no effect is achieved after I restart the network.

So, can anybody give me some explanations, links or related stuff to read on this?

Thanks!


NOTE: What I observed: if I have added the 192.168.50.0 network and points to 'default' gateway (0.0.0.0), my command works good. But if I haven't it, I got the already mentioned ERROR. So, can you show me what I need to do more and where I'm wrong?

P.S. I'm a kind of a newbie in linux networking.

share|improve this question
    
Are your IP's in network-scripts valid ? –  Lucas Kauffman Jan 13 '12 at 12:55
    
there is probably something wrongly configured in your networking. post your /etc/sysconfig/network-scripts/ifcfg-eth0 and /etc/sysconfig/network files –  thanosk Jan 13 '12 at 12:55
    
@thanosk I don't have a /etc/sysconfig/network-scripts/ifcfg-eth0 file. And my network file looks like:NETWORKING=yes HOSTNAME=artaxerxe. So, if I need more on this, just suggest me what I need to do. Thanks. –  artaxerxe Jan 13 '12 at 13:00
    
What do you have under? Also, can you run the following and paste it into your paste: "ip addr" –  Rilindo Jan 13 '12 at 13:30
1  
The posted output seems to be taken from 'route -n' not from 'ifconfig'. –  Khaled Jan 13 '12 at 17:39
show 4 more comments

1 Answer 1

up vote 1 down vote accepted

The route you're trying to add is recursive.

route add -net 192.168.50.0 netmask 255.255.255.0 gw 192.168.50.1

This translate to the following:

The next hop for 192.168.50.0/24 is 192.168.50.1

Ok. What is the next hop for 192.168.50.1?

The next hop for 192.168.50.0/24 is 192.168.50.1

> Uh? But this ain't possible. Then outputs the cryptic SIOCADDRT: No such process

This is confirmed by the second route you added:

route add -net 192.168.50.0 netmask 255.255.255.0 gw 192.168.122.x

Your default gateway should be in the 192.168.122.0/24 network to be reachable from your computer.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.