2

TL;DR:

My network (Ethernet) doesn't work until I (manually) run sudo dhclient, but I need to do it every time I boot.  How do I get it to stick on reboot?

History:

I've booted up an Arch ISO. I have a desktop with wired Ethernet, solid lights. ip link gives us [eno1] and is BROADCAST, MULTICAST, UP, LOWER_UP.

I've followed Arch Linux - connect: Network is unreachable to set up a netctl ethernet-dhcp profile for eno1 and enable it.

Does this config/profile look ok? Despite enabling/starting it fails on reboot...

Description='A basic dhcp ethernet connection'
Interface=eno1
Connection=ethernet
IP=dhcp
#DHCPClient=dhcpcd
#DHCPReleaseOnStop=no
## for DHCPv6
#IP6=dhcp
#DHCP6Client=dhclient
## for IPv6 autoconfiguration
#IP6=stateless

If I ping any IP, (including 8.8.8.8 and 192.168.1.1), I get "Network is unreachable", and if I try google.co.uk, I get "temporary failure in name resolution".

ifconfig yields:

eno1: flags:4163<UP,BROADCAST,RUNNING,MULTICAST>
inet: fe00::c42b:cd14:3908:6ea8
ether: 74:d4:35:1c:f0:3e

sudo dhclient results in the internet coming up, but on reboot, this is lost.

sudo netctl status mynet-eno1-dhcp
● netctl@mynet\x2deno1\x2ddhcp.service - A basic dhcp ethernet connection
   Loaded: loaded (/etc/systemd/system/netctl@mynet\x2deno1\x2ddhcp.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2018-05-06 22:11:28 BST; 19min ago
     Docs: man:netctl.profile(5)
  Process: 492 ExecStart=/usr/lib/netctl/network start mynet-eno1-dhcp (code=exited, status=1/FAILURE)
 Main PID: 492 (code=exited, status=1/FAILURE)

May 06 22:10:58 msc001 dhcpcd[537]: DUID 00:01:00:01:22:80:f1:8f:74:d4:35:1c:f0:3e
May 06 22:10:58 msc001 dhcpcd[537]: eno1: IAID 35:1c:f0:3e
May 06 22:10:58 msc001 dhcpcd[537]: eno1: soliciting a DHCP lease
May 06 22:11:28 msc001 network[492]: timed out
May 06 22:11:28 msc001 dhcpcd[537]: timed out
May 06 22:11:28 msc001 dhcpcd[537]: dhcpcd exited
May 06 22:11:28 msc001 network[492]: DHCP IPv4 lease attempt failed on interface 'eno1'
May 06 22:11:28 msc001 network[492]: Failed to bring the network up for profile 'mynet-eno1-dhcp'
May 06 22:11:28 msc001 systemd[1]: netctl@mynet\x2deno1\x2ddhcp.service: Main process exited, code=exited, status=1/FAILURE
May 06 22:11:28 msc001 systemd[1]: netctl@mynet\x2deno1\x2ddhcp.service: Failed with result 'exit-code'.

As neither dhcpcd, dhclient work completely, I'll be looking at Network Manager later, will report back.

How do I get it to stick on reboot?

  • 1
    have you tried dhclient? what does ifconfig say? – vfbsilva May 5 '18 at 21:39
  • @vfbsilva dhclient works for that session, but on reboot it's lost it's connection again, any ideas? – aSystemOverload May 6 '18 at 23:35
  • I've added extra info and also added my netctl profile to see if there is a problem there. – aSystemOverload May 6 '18 at 23:36
3

The messages indicate your netctl profile is using dhcpcd as the DHCP client, rather than dhclient.

Since it looks like dhclient works but dhcpcd doesn't, you might try changing the default DHCP client to dhclient.

Either create /etc/netctl/hooks/dhcp with the following contents:

#!/bin/sh
DHCPClient='dhclient'

Or create /etc/netctl/interfaces/eno1 with the following contents:

DHCPClient='dhclient'

In both cases, mark the file as executable (chmod a+x <filename>).

  • That's great, thanks. sudo dhclient works whilst installing from the ISO, the above is perfect once rebooted. – aSystemOverload May 8 '18 at 22:42

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.