FS#68514 - systemd-networkd isnt getting ipv4 from dhcp server

Attached to Project: Arch Linux
Opened by Thomas Jäger (xunil64) - Tuesday, 03 November 2020, 11:52 GMT
Last edited by Andreas Radke (AndyRTR) - Wednesday, 21 April 2021, 12:39 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Systemd-networkd isnt able to get ipv4 during boot (ifconfig is showing only ipv6 addresses).
When switching to netctl its possible to get ipv4 and ipv6 addresses

systemd-networkd config used for dhcp:

[Match]
Name=en*

[Network]
DHCP=yes
IPv6PrivacyExtensions=true


When using static ipv4 addresses its possible to get the ipv4 network stack (for example):

[Network]
Address=192.168.1.99
Gateway=192.168.1.1
DNS=8.8.8.8
#DNS=192.168.1.1
DHCP=ipv6



Additional info:
* systemd 246.6-1, kernel 5.9.3.arch1-1


Steps to reproduce:

Booting with either systemd-networkd or netctl enabled


This task depends upon

Closed by  Andreas Radke (AndyRTR)
Wednesday, 21 April 2021, 12:39 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#68862 
Comment by Thomas Jäger (xunil64) - Tuesday, 03 November 2020, 11:53 GMT
when searching for other bugs like this systemd-networkd seemed to have similiar issues in the past (v23x, v244)
Comment by Thomas Jäger (xunil64) - Sunday, 08 November 2020, 09:00 GMT
After downgrading to dhcpcd 9.2.0 i dont get the ipv4 address too (using systemd-networking)
See  FS#68515 
Comment by Kevin Morris (kevr) - Wednesday, 25 November 2020, 16:48 GMT
Currently testing with `dhcpcd 9.3.1-1`, I cannot reproduce this issue with `systemd-networkd` or `netctl`. I've commented a similar note in the other bug report about netctl in particular.

I'm not convinced that `dhcpcd` has anything to do with this. `systemd-networkd` can still grab dhcp without `dhcpcd` installed at all. I say this because you referenced the other ticket in which `dhcpcd` is apparently the software at fault (have not been able to confirm that's the case at all on x86_64).
Comment by Thomas Jäger (xunil64) - Wednesday, 25 November 2020, 17:48 GMT
after upgrading to dhcpcd 9.3.3 i still dont get ip4 addresses
- but yes, maybe not related to dhcpcd at all

current setup:

# uname -a
Linux arch 5.9.10-arch1-1 #1 SMP PREEMPT Sun, 22 Nov 2020 14:16:59 +0000 x86_64 GNU/Linux

# pacman -Qi systemd
Name : systemd
Version : 246.6-1
Description : system and service manager
Architecture : x86_64
[...]

# more /etc/systemd/network/arch.network
[Match]
Name=en*

[Network]
DHCP=yes
IPv6PrivacyExtensions=true

# ifconfig
[...]
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 *** prefixlen 64 scopeid 0x0<global>
inet6 fe80::*** prefixlen 64 scopeid 0x20<link>
inet6 *** prefixlen 64 scopeid 0x0<global>
inet6 *** prefixlen 64 scopeid 0x0<global>
ether *** txqueuelen 1000 (Ethernet)
RX packets 336178 bytes 207379629 (197.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 128116 bytes 23486750 (22.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


Edit:

when running dhcpcd manually i will get additonally an ipv4 - so very likely not related to dhcpcd
Comment by Thomas Jäger (xunil64) - Wednesday, 25 November 2020, 17:56 GMT
Refering to netctl issue (ipv4): i will check if netctl works with dhclient and dhcpcd, but will comment this in the other ticket

Comment by Kevin Morris (kevr) - Wednesday, 25 November 2020, 18:25 GMT
Thomas, can you try with `DHCP=ipv4` inside of your .network file? I'd like to see if we can force it to grab you an IPv4 address.

Edit: Not that this is a solution; I just want to know if it gets one at all with the specification.
Comment by Thomas Jäger (xunil64) - Wednesday, 25 November 2020, 18:47 GMT
i tried this already (but not mentioned it)
Even with explicit ipv4 only ipv6 addresses are created


# more /etc/systemd/network/arch.network
[Match]
Name=en*

[Network]
DHCP=ipv4
#IPv6PrivacyExtensions=true


# ifconfig
[...]
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 *** prefixlen 64 scopeid 0x0<global>
inet6 *** prefixlen 64 scopeid 0x0<global>
inet6 fe80::*** prefixlen 64 scopeid 0x20<link>
ether *** txqueuelen 1000 (Ethernet)
RX packets 29 bytes 2085 (2.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 19 bytes 2858 (2.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[...]
removed ipv6 details, and MAC details


Comment by Thomas Jäger (xunil64) - Wednesday, 25 November 2020, 18:58 GMT
tried to find some additional logs after restarting again:

Nov 25, 2020 @ 19:51:01.955 audit: type=1130 audit(1606330261.948:85): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-networkd-wait-online comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 25, 2020 @ 19:51:01.952 SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-networkd-wait-online comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 25, 2020 @ 19:50:53.872 SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-networkd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'


# 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 Wed 2020-11-25 19:50:53 CET; 4min 12s ago
TriggeredBy: ● systemd-networkd.socket
Docs: man:systemd-networkd.service(8)
Main PID: 307 (systemd-network)
Status: "Processing requests..."
Tasks: 1 (limit: 38364)
Memory: 2.6M
CGroup: /system.slice/systemd-networkd.service
└─307 /usr/lib/systemd/systemd-networkd

Nov 25 19:51:04 arch systemd-networkd[307]: vethc972777: Gained IPv6LL
Nov 25 19:51:04 arch systemd-networkd[307]: vethfccca3c: Gained IPv6LL
Nov 25 19:51:04 arch systemd-networkd[307]: veth8fe4d90: Gained IPv6LL
Nov 25 19:51:04 arch systemd-networkd[307]: vethc5e9381: Gained IPv6LL
Nov 25 19:51:04 arch systemd-networkd[307]: veth3cf07d3: Gained IPv6LL
Nov 25 19:51:35 arch systemd-networkd[307]: enp3s0: DHCPv6 error: No message of desired type
Nov 25 19:52:33 arch systemd-networkd[307]: enp3s0: DHCPv6 error: No message of desired type
Nov 25 19:53:30 arch systemd-networkd[307]: enp3s0: DHCPv6 error: No message of desired type
Nov 25 19:53:55 arch systemd-networkd[307]: enp3s0: DHCPv6 error: No message of desired type
Nov 25 19:54:16 arch systemd-networkd[307]: enp3s0: DHCPv6 error: No message of desired type

(additional docker virtual networks are running on this machine)


when starting the network manually (with systemctl disable systemd-networkd)

Nov 25 20:01:42 arch systemd[1]: Starting Network Service...
Nov 25 20:01:42 arch systemd-networkd[2972]: veth52c34c7: Gained IPv6LL
Nov 25 20:01:42 arch systemd-networkd[2972]: veth1833783: Gained IPv6LL
Nov 25 20:01:42 arch systemd-networkd[2972]: veth7e10a86: Gained IPv6LL
Nov 25 20:01:42 arch systemd-networkd[2972]: veth7e496ab: Gained IPv6LL
Nov 25 20:01:42 arch systemd-networkd[2972]: veth48f1c18: Gained IPv6LL
Nov 25 20:01:42 arch systemd-networkd[2972]: br-7c6f163b0783: Gained IPv6LL
Nov 25 20:01:42 arch systemd-networkd[2972]: br-44e4cdddc773: Gained IPv6LL
Nov 25 20:01:42 arch systemd-timesyncd[434]: Network configuration changed, trying to establish connection.
Nov 25 20:01:42 arch systemd-networkd[2972]: Enumeration completed
Nov 25 20:01:42 arch systemd[1]: Started Network Service.
Nov 25 20:01:42 arch audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-networkd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 25 20:01:42 arch systemd-networkd[2972]: enp3s0: IPv6 successfully enabled
Nov 25 20:01:42 arch kernel: audit: type=1130 audit(1606330902.435:286): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-networkd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov 25 20:01:42 arch kernel: RTL8211E Gigabit Ethernet r8169-300:00: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=r8169-300:00, irq=IGNORE)
Nov 25 20:01:42 arch systemd-networkd[2972]: enp3s0: Link UP
Nov 25 20:01:42 arch systemd-timesyncd[434]: Network configuration changed, trying to establish connection.
Nov 25 20:01:42 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Down
Nov 25 20:01:42 arch systemd-timesyncd[434]: Network configuration changed, trying to establish connection.
Nov 25 20:01:45 arch systemd-networkd[2972]: enp3s0: Gained carrier
Nov 25 20:01:45 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Up - 1Gbps/Full - flow control rx/tx
Nov 25 20:01:45 arch kernel: IPv6: ADDRCONF(NETDEV_CHANGE): enp3s0: link becomes ready
Nov 25 20:01:45 arch systemd-timesyncd[434]: Network configuration changed, trying to establish connection.
Nov 25 20:01:46 arch systemd-networkd[2972]: enp3s0: Gained IPv6LL
Nov 25 20:01:46 arch systemd-timesyncd[434]: Network configuration changed, trying to establish connection.
Nov 25 20:01:48 arch systemd-timesyncd[434]: Network configuration changed, trying to establish connection.
Nov 25 20:01:48 arch systemd-networkd[2972]: enp3s0: DHCPv6 error: No message of desired type
Nov 25 20:01:49 arch systemd-timesyncd[434]: Network configuration changed, trying to establish connection.
Nov 25 20:01:49 arch systemd-timesyncd[434]: Network configuration changed, trying to establish connection.
Nov 25 20:02:02 arch systemd[2276]: Started rclone "GoogleDrive".
Nov 25 20:02:02 arch systemd[2276]: Reached target Main User Target.
Nov 25 20:02:02 arch systemd[2276]: Startup finished in 1min 24.334s.






Comment by Kevin Morris (kevr) - Tuesday, 01 December 2020, 22:12 GMT
And what steps did you take to start it "manually?"
Comment by Kevin Morris (kevr) - Tuesday, 01 December 2020, 22:14 GMT
To me.. it looks like something is affecting it aside from systemd-networkd, like another dhcp client service running. What does your `systemctl list-units` look like?
Comment by Thomas Jäger (xunil64) - Wednesday, 02 December 2020, 06:33 GMT
steps to start manually

a) booting with systemd-networkd.service enabled >> getting ipv6 addresses only
b) (after boot) on the terminal just running dhcpcd command >> getting the additional ipv4 address (and more ipv6 addresses)

Comment by slip (slip) - Saturday, 05 December 2020, 23:26 GMT
Edit. Unrelated.
Comment by Kevin Morris (kevr) - Sunday, 06 December 2020, 23:07 GMT
Hey guys, look like there was also another ticket related to the same issue: https://bugs.archlinux.org/task/68862 in where they mention it's been addressed @ systemd upstream: https://github.com/systemd/systemd/issues/17803

Looks like your solution(s) temporarily would be to just downgrade it until it's caught up on Arch.

Loading...