You are not logged in.

#1 2016-11-06 02:31:18

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

systemd-networkd fails to configure interface

Hi there, long time since I've been around here. I just set up a new Arch install, and I figured I'd use systemd-networkd, but no luck. When it starts, it logs this:

Nov 05 21:10:27 amaranth systemd-networkd[282]: enp2s0: Could not set NDisc route or address: Invalid argument
Nov 05 21:10:27 amaranth systemd-networkd[282]: enp2s0: Failed

and the interface doesn't get an IP, either V4 or V6.

/etc/systemd/network/wired.network has

[Match]
Name=enp2s0

[Network]
DHCP=yes

It makes no difference if I use "DHCP=yes" or "DHCP=ipv4".

If I use dhcpcd instead of systemd-networkd, everything works fine, including IPv6 autoconfig.

What gives? I'd like to use networkd.

Last edited by ataraxia (2016-11-06 02:44:44)

Offline

#2 2016-11-06 10:30:42

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: systemd-networkd fails to configure interface

Post the output of `ip addr`


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2016-11-06 10:34:03

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: systemd-networkd fails to configure interface

Have you enabled the systemd-resolved.service as explained in the wiki page?

systemd-resolved is actually required only if you are specifying DNS entries in .network files or if you want to obtain DNS addresses from networkd's DHCP client

You should have something like:

$ systemctl --no-pager status systemd-networkd
● systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: active (running) since dim. 2016-11-06 10:33:22 CET; 54min ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 327 (systemd-network)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/systemd-networkd.service
           └─327 /usr/lib/systemd/systemd-networkd

nov. 06 10:33:22 arch64 systemd[1]: Starting Network Service...
nov. 06 10:33:22 arch64 systemd-networkd[327]: Enumeration completed
nov. 06 10:33:22 arch64 systemd-networkd[327]: enp2s0: Renamed to eth0
nov. 06 10:33:22 arch64 systemd-networkd[327]: eth0: Renamed to enp2s0
nov. 06 10:33:22 arch64 systemd[1]: Started Network Service.
nov. 06 10:33:22 arch64 systemd-networkd[327]: enp2s0: IPv6 enabled for interface: Success
nov. 06 10:33:25 arch64 systemd-networkd[327]: enp2s0: Gained carrier
nov. 06 10:33:27 arch64 systemd-networkd[327]: enp2s0: Gained IPv6LL
nov. 06 10:33:28 arch64 systemd-networkd[327]: enp2s0: DHCPv4 address 192.168.0.12/24 via 192.168.0.1
nov. 06 10:33:40 arch64 systemd-networkd[327]: enp2s0: Configured

and

$ systemctl --no-pager status systemd-resolved
● systemd-resolved.service - Network Name Resolution
   Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
   Active: active (running) since dim. 2016-11-06 10:33:23 CET; 54min ago
     Docs: man:systemd-resolved.service(8)
           http://www.freedesktop.org/wiki/Software/systemd/resolved
           http://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
           http://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
 Main PID: 347 (systemd-resolve)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/systemd-resolved.service
           └─347 /usr/lib/systemd/systemd-resolved

nov. 06 10:33:23 arch64 systemd[1]: Starting Network Name Resolution...
nov. 06 10:33:23 arch64 systemd-resolved[347]: Positive Trust Anchors:
nov. 06 10:33:23 arch64 systemd-resolved[347]: . IN DS 19036 8 2 49aac11 ...
nov. 06 10:33:23 arch64 systemd-resolved[347]: Negative trust anchors: ...
nov. 06 10:33:23 arch64 systemd-resolved[347]: Using system hostname 'arch64'.
nov. 06 10:33:23 arch64 systemd[1]: Started Network Name Resolution.
Hint: Some lines were ellipsized, use -l to show in full.

Offline

#4 2016-11-06 14:32:49

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: systemd-networkd fails to configure interface

I switched back to networkd so I could answer graysky's post, and an interesting thing happened this time: I still get no IPv4 address, but I did get a V6 address! Strange.

[root@amaranth ataraxia]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:24:1d:89:08:99 brd ff:ff:ff:ff:ff:ff
    inet6 2601:547:500:3090:224:1dff:fe89:899/64 scope global mngtmpaddr noprefixroute dynamic 
       valid_lft 277849sec preferred_lft 277849sec
    inet6 fe80::224:1dff:fe89:899/64 scope link 
       valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:00:1d:c3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:00:1d:c3 brd ff:ff:ff:ff:ff:ff

Yes, I was enabling both networkd and resolved. Resolved works fine as far as I can see.

[root@amaranth ataraxia]# systemctl status systemd-networkd
● systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2016-11-06 09:26:28 EST; 4min 19s ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 11867 (systemd-network)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/systemd-networkd.service
           └─11867 /usr/lib/systemd/systemd-networkd

Nov 06 09:26:28 amaranth systemd[1]: Starting Network Service...
Nov 06 09:26:28 amaranth systemd-networkd[11867]: Enumeration completed
Nov 06 09:26:28 amaranth systemd[1]: Started Network Service.
Nov 06 09:26:28 amaranth systemd-networkd[11867]: enp2s0: IPv6 enabled for interface: Success
Nov 06 09:26:28 amaranth systemd-networkd[11867]: enp2s0: Gained carrier
Nov 06 09:26:28 amaranth systemd-networkd[11867]: enp2s0: Lost carrier
Nov 06 09:26:31 amaranth systemd-networkd[11867]: enp2s0: Gained carrier
Nov 06 09:26:33 amaranth systemd-networkd[11867]: enp2s0: Gained IPv6LL
Nov 06 09:26:33 amaranth systemd-networkd[11867]: enp2s0: Could not set NDisc route or address: Invalid argument
Nov 06 09:26:33 amaranth systemd-networkd[11867]: enp2s0: Failed
[root@amaranth ataraxia]# systemctl status systemd-resolved
● systemd-resolved.service - Network Name Resolution
   Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2016-11-06 09:26:33 EST; 4min 22s ago
     Docs: man:systemd-resolved.service(8)
           http://www.freedesktop.org/wiki/Software/systemd/resolved
           http://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
           http://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
 Main PID: 11875 (systemd-resolve)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/systemd-resolved.service
           └─11875 /usr/lib/systemd/systemd-resolved

Nov 06 09:26:33 amaranth systemd[1]: Starting Network Name Resolution...
Nov 06 09:26:33 amaranth systemd-resolved[11875]: Positive Trust Anchors:
Nov 06 09:26:33 amaranth systemd-resolved[11875]: . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
Nov 06 09:26:33 amaranth systemd-resolved[11875]: Negative trust anchors: 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.in-addr.arpa 24.172.in-addr.arpa 25.172.in-addr.arpa 26.172.in-addr.arpa 27.172.in
Nov 06 09:26:33 amaranth systemd-resolved[11875]: Using system hostname 'amaranth'.
Nov 06 09:26:33 amaranth systemd-resolved[11875]: Switching to system DNS server 75.75.76.76.
Nov 06 09:26:33 amaranth systemd[1]: Started Network Name Resolution.

Offline

#5 2016-11-07 10:35:02

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: systemd-networkd fails to configure interface

If you disable ipv6 do you still have no ipv4 connection?
I found this thread which may give some infos: https://github.com/coreos/bugs/issues/1478

Offline

#6 2016-11-07 11:54:50

rsmarples
Member
Registered: 2009-05-12
Posts: 287

Re: systemd-networkd fails to configure interface

ataraxia wrote:

If I use dhcpcd instead of systemd-networkd, everything works fine, including IPv6 autoconfig.

What gives? I'd like to use networkd.

I maintain dhcpcd and I dislike losing users.
So my question is why would you like to use networkd over dhcpcd?
What does it provide that dhcpcd does not?

Offline

#7 2016-11-07 23:18:37

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: systemd-networkd fails to configure interface

Actually, I quite like dhcpcd (and use it currently). I just wanted to try out networkd. Even if networkd had worked perfectly, I might have only used it temporarily, since dhcpcd works out of the box, and networkd at best still requires some manual config. I don't think at this point you should be concerned about losing someone like me as a user.

rsmarples wrote:
ataraxia wrote:

If I use dhcpcd instead of systemd-networkd, everything works fine, including IPv6 autoconfig.

What gives? I'd like to use networkd.

I maintain dhcpcd and I dislike losing users.
So my question is why would you like to use networkd over dhcpcd?
What does it provide that dhcpcd does not?

Offline

Board footer

Powered by FluxBB