Here is my route -n output:

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

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

route add -net netmask gw

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: via, no effect is achieved after I restart the network.

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


NOTE: What I observed: if I have added the network and points to 'default' gateway (, 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.

  • 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

The route you're trying to add is recursive.

route add -net netmask gw

This translate to the following:

The next hop for is

Ok. What is the next hop for

The next hop for is

> 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 netmask gw 192.168.122.x

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

| improve this answer | |

You can get the "SIOCADDRT: No such process" error if "You attempted to set a route for a network before setting a host route for the gateway which handles traffic for that network."

ANSWER: First create a host route, then create a net route.

e.g. for network in question: local -> -> 192.168.50.xx

route add -host dev eth0
route add -net netmask gw

This helped me https://support.symantec.com/en_US/article.TECH142841.html

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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