You are not logged in.

#1 2023-03-28 06:21:44

the_mungler
Member
Registered: 2022-09-23
Posts: 12

[Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

Somehow I'm only able to get ipv6 addresses. oddly, This behavior is unchanged even if I disable ipv6 in the config file. Other devices on my network receive both versions of addresses.

cat etc/systemd/network/25-wireless.network

[match]
Name=wlan0

[Network]
DHCP=ipv4
IgnoreCarrierLoss=3s



[DHCPv4]
RouteMetric=20

ip addr show wlan0

2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether ###### brd ff:ff:ff:ff:ff:ff
    inet6 2601:######/64 scope global dynamic mngtmpaddr 
       valid_lft 211880sec preferred_lft 211880sec
    inet6 fd23######64 scope global deprecated dynamic mngtmpaddr 
       valid_lft 6227sec preferred_lft 0sec
    inet6 fe80::######/64 scope link 
       valid_lft forever preferred_lft forever

Last edited by the_mungler (2023-03-28 15:37:57)

Offline

#2 2023-03-28 06:48:04

d.ALT
Member
Registered: 2019-05-10
Posts: 951

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

the_mungler wrote:

I disable ipv6 in the config file

What about completely disabling it at kernel level?


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#3 2023-03-28 07:29:20

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,152
Website

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

Do you have multiple competing networking services enabled?


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#4 2023-03-28 07:57:52

the_mungler
Member
Registered: 2022-09-23
Posts: 12

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

no, I only have systemd-networkd on my system. I have enabled wpa_supplicant, but if I'm not mistaken, these are meant to be used together. I realize that is a common problem, so here is the status of relevant running systemd services (with some information redacted with ####):

systemctl status systemd-networkd
     systemd-networkd.service - Network Configuration
     Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; preset: enabled)
     Active: active (running) since Tue 2023-03-28 01:20:01 MDT; 17min ago
TriggeredBy: ● systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 4205 (systemd-network)
     Status: "Processing requests..."
      Tasks: 1 (limit: 19088)
     Memory: 1.7M
        CPU: 33ms
     CGroup: /system.slice/systemd-networkd.service
             └─4205 /usr/lib/systemd/systemd-networkd

Mar 28 01:20:01 roshar systemd-networkd[4205]: veth547211f: Gained carrier
Mar 28 01:20:01 roshar systemd-networkd[4205]: vethc46eda3: Link UP
Mar 28 01:20:01 roshar systemd-networkd[4205]: vethc46eda3: Gained carrier
Mar 28 01:20:01 roshar systemd-networkd[4205]: wlan0: Gained IPv6LL
Mar 28 01:20:01 roshar systemd-networkd[4205]: br-b414f33e036c: Gained IPv6LL
Mar 28 01:20:01 roshar systemd-networkd[4205]: veth547211f: Gained IPv6LL
Mar 28 01:20:01 roshar systemd-networkd[4205]: vethc46eda3: Gained IPv6LL
Mar 28 01:20:01 roshar systemd-networkd[4205]: wlan0: Connected WiFi access point: ####
Mar 28 01:20:01 roshar systemd-networkd[4205]: Enumeration completed
Mar 28 01:20:01 roshar systemd[1]: Started Network Configuration.


systemctl status wpa_supplicant@wlan0
● wpa_supplicant@wlan0.service - WPA supplicant daemon (interface-specific version)
     Loaded: loaded (/usr/lib/systemd/system/wpa_supplicant@.service; enabled; preset: disabled)
     Active: active (running) since Tue 2023-03-28 01:13:24 MDT; 24min ago
   Main PID: 547 (wpa_supplicant)
      Tasks: 1 (limit: 19088)
     Memory: 5.5M
        CPU: 31ms
     CGroup: /system.slice/system-wpa_supplicant.slice/wpa_supplicant@wlan0.service
             └─547 /usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -iwlan0

Mar 28 01:13:24 roshar systemd[1]: Started WPA supplicant daemon (interface-specific version).
Mar 28 01:13:24 roshar wpa_supplicant[547]: Successfully initialized wpa_supplicant
Mar 28 01:13:27 roshar wpa_supplicant[547]: wlan0: SME: Trying to authenticate with ####
Mar 28 01:13:27 roshar wpa_supplicant[547]: wlan0: Trying to associate with ####
Mar 28 01:13:27 roshar wpa_supplicant[547]: wlan0: Associated with ####
Mar 28 01:13:27 roshar wpa_supplicant[547]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Mar 28 01:13:28 roshar wpa_supplicant[547]: wlan0: WPA: Key negotiation completed with #### [PTK=CCMP GTK=CCMP]
Mar 28 01:13:28 roshar wpa_supplicant[547]: wlan0: CTRL-EVENT-CONNECTED - Connection to #### completed [id=0 id_str=]

and this to demonstrate network manager and iwd aren't running:

systemctl status networkmanager
Unit networkmanager.service could not be found.

systemctl status iwd
○ iwd.service - Wireless service
     Loaded: loaded (/usr/lib/systemd/system/iwd.service; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:iwd(8)
             man:iwd.config(5)
             man:iwd.network(5)
             man:iwd.ap(5)

Last edited by the_mungler (2023-03-28 08:03:03)

Offline

#5 2023-03-28 08:01:39

the_mungler
Member
Registered: 2022-09-23
Posts: 12

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

also, for clarity, my ideal setup would use this configuration:

[match]
Name=wlan0

[Network]
DHCP=ipv4
IgnoreCarrierLoss=3s
IPv6AcceptRA=yes


[DHCPv4]
RouteMetric=20

[IPv6AcceptRA]
RouteMetric=20

the configuration In my first post had the ipv6 info removed for troubleshooting, though the behavior of my system seems unchanged whether I put the ipv6 settings there or not.

Offline

#6 2023-03-28 09:07:35

-thc
Member
Registered: 2017-03-15
Posts: 775

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

First - systemd-networkd is the opposite of NetworkManager (not very chatty) - the built-in DHCP client will only log a single line in case of a successful lease. And simply nothing if DHCP fails. Can you verify on the DHCP server (which may reside on your router) that it receives no DHCP request?

Second - your log snippet from systemctl reveals that you also have a bridge and at least two virtual ethernet devices. Is your WiFi adapter somehow involved?

Offline

#7 2023-03-28 12:30:46

seth
Member
Registered: 2012-09-03
Posts: 60,799

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

We also haven't ruled out a conflicting dhcpcd (being the standard collision)
Please post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

Ideally post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

You can obfuscate information *pseudonym*, but never anonym.
Ie. make unique replacements; don't replace everything w/ the same "####"

Offline

#8 2023-03-28 15:11:46

the_mungler
Member
Registered: 2022-09-23
Posts: 12

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

-thc wrote:

First - systemd-networkd is the opposite of NetworkManager (not very chatty) - the built-in DHCP client will only log a single line in case of a successful lease. And simply nothing if DHCP fails. Can you verify on the DHCP server (which may reside on your router) that it receives no DHCP request?

Second - your log snippet from systemctl reveals that you also have a bridge and at least two virtual ethernet devices. Is your WiFi adapter somehow involved?

unfortunately I just moved here and don't have access to the router. I can ask the landlord to check, but I'm not confident he would know what that means.

as far as bridges and ethernet devices, I have docker containers and virtmanager with a virtual machine installed. The system was working previously before I moved my computer and enabled wifi and fidled with the systemd/network/25-wireless.network file.

output of journalctl: http://0x0.st/Hog2.txt

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

cups.path                                | multi-user.target.wants
cups.service                             | multi-user.target.wants
cups.service                             | printer.target.wants
cups.socket                              | sockets.target.wants
dbus-org.freedesktop.network1.service    | system
dbus-org.freedesktop.resolve1.service    | system
dbus-org.freedesktop.timesync1.service   | system
display-manager.service                  | system
docker.service                           | multi-user.target.wants
fstrim.timer                             | timers.target.wants
gcr-ssh-agent.socket                     | sockets.target.wants
getty@tty1.service                       | getty.target.wants
gnome-keyring-daemon.socket              | sockets.target.wants
libvirtd-ro.socket                       | sockets.target.wants
libvirtd.service                         | multi-user.target.wants
libvirtd.socket                          | sockets.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire-pulse.socket                    | sockets.target.wants
pipewire-session-manager.service         | user
pipewire.socket                          | sockets.target.wants
remote-fs.target                         | multi-user.target.wants
sshd.service                             | multi-user.target.wants
systemd-networkd.service                 | multi-user.target.wants
systemd-networkd.socket                  | sockets.target.wants
systemd-networkd-wait-online.service     | network-online.target.wants
systemd-network-generator.service        | sysinit.target.wants
systemd-resolved.service                 | sysinit.target.wants
systemd-timesyncd.service                | sysinit.target.wants
virtlockd.socket                         | sockets.target.wants
virtlogd.socket                          | sockets.target.wants
wireplumber.service                      | pipewire.service.wants
wpa_supplicant@wlan0.service             | multi-user.target.wants
xdg-user-dirs-update.service             | default.target.wants

Last edited by the_mungler (2023-03-28 15:17:07)

Offline

#9 2023-03-28 15:22:57

seth
Member
Registered: 2012-09-03
Posts: 60,799

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

What and why starts dnsmasq (it's not in your enabled services)?

Mar 28 08:55:03 roshar systemd-networkd[343]: /etc/systemd/network/25-wireless.network:1: Unknown section 'match'. Ignoring.
Mar 28 08:55:03 roshar systemd-networkd[343]: /etc/systemd/network/25-wireless.network: No valid settings found in the [Match] section, ignoring file. To match all interfaces, add Name=* in the [Match] section.

CamelCase

Offline

#10 2023-03-28 15:37:20

the_mungler
Member
Registered: 2022-09-23
Posts: 12

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

doh, needed an uppercase on match. that fixed things for me.

as far as dnsmasq, I'm not sure what starts it, I haven't enabled it. systemctl shows it isn't running:

systemctl status dnsmasq
○ dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
     Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:dnsmasq(8)

anyway, I'll mark this complete.

edit for posterity: due to a typo in my systemd network configuration file, my settings were having no effect. today I learned by default systemd enables ipv6 and will accept router advertisements even without any configuration, which is why I mistakenly thought my configuration file was partially working.

Last edited by the_mungler (2023-03-28 15:41:48)

Offline

#11 2023-03-28 16:32:28

seth
Member
Registered: 2012-09-03
Posts: 60,799

Re: [Solved]Unable to recieve IPv4 address from DHCP, IPv6 only - networkd

dnsmasq, I'm not sure what starts it

https://wiki.archlinux.org/title/Libvirt#Networking

Mar 28 08:55:04 roshar dnsmasq-dhcp[792]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
Mar 28 08:55:04 roshar dnsmasq-dhcp[792]: DHCP, sockets bound exclusively to interface virbr0
…
Mar 28 08:55:04 roshar dnsmasq[792]: read /etc/hosts - 0 names
Mar 28 08:55:04 roshar dnsmasq[792]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 names
Mar 28 08:55:04 roshar dnsmasq-dhcp[792]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Mar 28 08:57:04 roshar systemd[1]: libvirtd.service: Unit process 792 (dnsmasq) remains running after unit stopped.
Mar 28 08:57:04 roshar systemd[1]: libvirtd.service: Unit process 793 (dnsmasq) remains running after unit stopped.

Offline

Board footer

Powered by FluxBB