I have arch-linux-arm running on a raspberryPi.
The network I am in uses static IPs.
gateway IP is
IP for my device is

To connect to the internet I use:
ip addr add dev eth0
ip route add default via
However the latter yields
RTNETLINK answeres: Network is unreachable
What am I missing?

mtak's answer fixed the initial problem,
however I still cannot reach the gateway.
Attempting to ping result in destination host unreachable

  • Is the link up? ip link set eth0 up
    – phemmer
    Commented Jul 4, 2014 at 8:55
  • 1
    @Patrick yup. Initial problem already solved by mtak's answer.
    – Mark
    Commented Jul 4, 2014 at 8:57

4 Answers 4


You need to add a subnet mask when you add the IP address. Now the system will think the IP is a /32, which does not include the ip, therefore it's unreachable.

To add the new IP address with a subnet mask:

ip addr add dev eth0
  • 1
    Now it does not complain anymore when trying to set the route. However I still don't get to the internet. ping on the gateway itself results in destination host unreachable
    – Mark
    Commented Jul 4, 2014 at 8:51
  • 3
    same problem here.. did you manage to get it to work?
    – branquito
    Commented Feb 12, 2015 at 21:39
  • I also cannot get this to work, and am at the same point as Mark and branquito
    – Tsangares
    Commented Sep 2, 2016 at 4:14

This worked for me

ip route flush dev eth0
ip route add dev eth0
ip route add via
  • 6
    Be careful with the flush command on default interface. If you have reached the server via that interface, you will loose connection to it.
    – VanagaS
    Commented Jun 8, 2020 at 2:37

Do you not have systemd and netctl? that's what arch usually uses. If you are not bound to using ip to connect to the internet, you can paste this into /etc/netctl/ethernet

Address=('' '')
#Routes=(' via')

then execute netctl start ethernet (and if that works, netctl enable ethernet to auto-connect on bootup) this is the recommended way to connect to the internet on arch as far as I can understand.

Based on your former problems, I would guess that the issue might be that you are forgetting to define a DNS server (although it might be automated, I don't know)

If you still fail to reach the gateway, maybe you should double check your gateway's IP. Have you tried connecting with DHCP (like dhcpcd? or does your network simply not support that at all?) just to make sure that the connection can be made at all?



ip route add dev eth0 proto kernel  scope link  src

I flush my route main table, set static ip, encounter this problem.

I try to delete the static ip, readd again, observe what has been added to route table, and find this entry. Then I add default route, it works.

ip a del dev eth0
ip a add dev eth0
ip route add default via dev eth0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .