19

After five unsuccessful Arch Linux installations, I've got two that installed correctly. The first time, the network worked fine, and I was even installing Arch Linux over SSH.

After booting from the installed system instead of the live CD, it can't connect to the network, I get the following message when I try to ping anything, even my router:

connect: Network is unreachable

I've tried installing Arch again, because nothing on the Internet seemed to fix my issue. After installing, I'm getting the same issue.

It appears it's failing to start eth0 because it times out.

  • 3
    Did you try dhcpcd eth0 ? – uzsolt Jun 24 '13 at 14:49
  • @uzsolt Yes, it gives a Failed to issue method call: No such file or directory error. I've also posted a topic over at the official forums, I will be posting the answer here if I find one. – Novicode Jun 24 '13 at 14:56
  • ifconfig eth0 up already done? Does linux see your network card (module are loaded)? Before anything please systemctl stop netctl-eth0... – uzsolt Jun 24 '13 at 14:57
  • Damn... you've no eth0, you've... I can't read it :( bbs.archlinux.org/viewtopic.php?pid=1291880#p1291880 So you should set up NO eth0, you should use instead enp1s0 (or what the hell is on your photo :) ). – uzsolt Jun 24 '13 at 15:02
  • I'm glad solved your problem. – uzsolt Jun 24 '13 at 17:27
22

The problem I was facing was that there was no eth0 (from what I can understand.) Run the command ip link, this should output your interfaces. I did not have the eth0 interface. Instead I had enp1s8.

Because I was using static, I copied the example profile with cd /etc/netctl then cp examples/ethernet-static my-network. After that, I edited my-network with nano my-network, and changed the Interface from eth0 to en1s8 (or whatever your adapter is in ip link). Finally, I enabled it to use that profile on startup with netctl enable my-network.

Enabling the profile will ensure that it starts upon boot, but there is no need to reboot the system, simply run netctl start my-network to initialize it immediately.

I was able to get help on the official Arch Linux forums, you can view my topic there.

4

Network unreachable means you don't have a route to the network. If you can't even ping the local router, either you don't have an IP address or your network interface is down.

netctl is the standard utility for managing network interfaces in Arch. If you haven't set that (or something else) up, you won't have any network. Not even DHCP.

  • I have copied an example file from examples/ethernet-static to "my-network", modified that file, then enabled it on startup with "netctl enable my-network". There are no IP conflicts on the network, either. It should be "Set up" – Novicode Jun 24 '13 at 13:40
  • To find out whether you can reach your default gateway (this is often your router), enter ip route. If it turns out you have no default gateway, you should add one either per DHCP or with ip route add default via xxx.xxx.x.xxx. To make the default gateway permanent, add the IP to /etc/network/interfaces. – Matthias Braun Dec 14 '18 at 16:05
3

Network setup for ArchLinux is well documented in the ArchLinux wiki at https://wiki.archlinux.org/index.php/Netctl

One important clarification of the answer with the highest number of votes - there is NO need to restart. If only network interface is present and proper interface name and configuration used in the profile file in /etc/netcl (let the example copy is named mynet1), then

netctl start mynet1

will start the network profile mynet1 and network route shall work.

However

netclt enable mynet1

will enable system service to be started by systemd service manager with every boot, i.e. it will create a unit file in /etc/systemd/system/netc@[mynetprofilename].service with the unit details (device binding and dependency).

Note also that if network profile is modified it would have to be netctl reenable'd.

0

Archlinux says, try dhcpcd in case your installer can't connect automatically. This worked on the spot for me AFTER installation. Just type "dhcpcd" as a command, wait a few seconds, and then "ip route" or "ping 8.8.8.8" to check if it works. I even used "watch ip address" to see how fast these inet and inet6 addresses pop up.

Instead of using dhcpcd, I can also connect from zero with:

modprobe e1000e

ip link set dev eth0 up
ip address add 192.168.0.16/24 dev eth0
ip route add 192.168.0.0/24 dev eth0
ip route add default via 192.168.0.1

e1000e is a "Network Driver", says modinfo. By loading this module I get a eth0 link (no, don't look for it in /dev). The "ip" commands activate the link, choose an address and define a local (subnet) and then a default gateway. It took me quite some time to test this out (ip link help, ip address help, ip route help...).

So this is instructive, but "dhcpcd" is faster to type, and probably more robust. And you can stop it cleanly with "dhcpcd -x".

With a working ping and the mirrorlist in /etc/pacman.d/ you have all you need for pacman or pacstrap.

And yes, I saw a kernel message renaming eth0 to enoxxx, so you have to check first with "ip link" what interfaces are already set up by systemd. It happens here:

[    3.052354] e1000e 0000:00:1f.6 eth0: (PCI Express:2.5GT/s:Width x1) 94:c6:91:a5:39:b8
[    3.052360] e1000e 0000:00:1f.6 eth0: Intel(R) PRO/1000 Network Connection
[    3.052445] e1000e 0000:00:1f.6 eth0: MAC: 13, PHY: 12, PBA No: FFFFFF-0FF
[    3.055917] e1000e 0000:00:1f.6 eno1: renamed from eth0

The .16 in my address is just any (free) number, and 192.168.0.1 should always be the gateway. Maybe I was lucky, but it is good news that you can hack around under systemd and inet6. I will try netctl, though.

And right now I have booted with systemd and have dhcpcd started. I got address .15 on "eno1" and three inet6 addresses, but apart from that the result is quite the same as with above "ip"-hack.

3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 94:c6:91:a5:39:b8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.15/24 brd 192.168.0.255 scope global noprefixroute eno1
       valid_lft forever preferred_lft forever
    inet6 2a05:41c0:12:bf00::2/128 scope global dynamic noprefixroute 
       valid_lft 2559430sec preferred_lft 572230sec
    inet6 2a05:41c0:12:bf00:f51e:97c1:de6f:6f49/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 2591994sec preferred_lft 604794sec
    inet6 fe80::47cf:a2e4:af0b:b7cd/64 scope link 
       valid_lft forever preferred_lft forever 


 default via 192.168.0.1 dev eno1 proto dhcp src 192.168.0.15 metric 203 
 192.168.0.0/24 dev eno1 proto dhcp scope link src 192.168.0.15 metric 203 

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.