Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Getting the following error when trying to add a default gateway for eth1.

# route add default gw 192.168.228.2 eth1
route: SIOCADDRT: Network is unreachable

Can't figure out why.

share|improve this question

migrated from stackoverflow.com Aug 10 '10 at 21:40

This question came from our site for professional and enthusiast programmers.

    
what is the output of ip link and ip route? – msw Aug 10 '10 at 21:33

You don't have a route to 192.168.228.2. Likely your address is not in the 192.168.228 block, or your netmask is to restrictive to reach it.

share|improve this answer

The network cable could be disconnected. Try to ping a known IP first, then try to ping the IP of the gateway and see what happens.

share|improve this answer

You must log in to answer this question.