Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

share|improve this question
Is the link up? ip link set eth0 up – Patrick Jul 4 '14 at 8:55
@Patrick yup. Initial problem already solved by mtak's answer. – Mark Jul 4 '14 at 8:57

1 Answer 1

up vote 2 down vote accepted

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
share|improve this answer
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 Jul 4 '14 at 8:51
same problem here.. did you manage to get it to work? – branquito Feb 12 at 21:39

Your Answer


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.