You are not logged in.
I have an up-to-date Arch VM that receives network configuration by DHCP reservation (the reservation includes a router option, which specifies the default gateway). At some point, the VM would no longer have a default gateway upon startup / after reboot. I can manually set a default route (e.g. ip route add default 192.168.1.1), but I would like to understand why the default gateway isn't being set automatically, and how to correct it.
Thanks in advance for advice/suggestions you can offer!
Last edited by regexaurus (2023-10-03 12:33:29)
Offline
https://bbs.archlinux.org/viewtopic.php?id=57855
http://www.catb.org/~esr/faqs/smart-questions.html
Specifically what is supposed to configure the network?
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
And otherwise if you want to know what fails I'd start by looking into your system journal.
Offline
dbus-org.freedesktop.network1.service | system
dhcpcd@enp0s10f0.service | multi-user.target.wants
getty@tty1.service | getty.target.wants
httpd.service | multi-user.target.wants
p11-kit-server.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
I'm checking journal entries...
Last edited by regexaurus (2023-10-02 15:11:18)
Offline
Please use [code][/code] tags. Edit your post in this regard.
You've systemd-network and dhcpcd enabled, they'lll both try to configure enp0s10f0 - pick one, disable the other.
Offline
Output for: systemctl status dhcpcd
○ dhcpcd.service - DHCP/ IPv4LL/ IPv6RA/ DHCPv6 client on all interfaces
Loaded: loaded (/usr/lib/systemd/system/dhcpcd.service; disabled; preset: disabled)
Active: inactive (dead)
...and 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 Fri 2023-09-29 17:39:09 EDT; 2 days ago
TriggeredBy: ● systemd-networkd.socket
Offline
systemctl status dhcpcd@enp0s10f0.service
You've it enbaled for that NIC only.
Offline
Thank you! I stopped and disabled dhcpcd@enp0s10f0.service
sudo systemctl disable dhcpcd@enp0s10f0.service
sudo systemctl stop dhcpcd@enp0s10f0.service
created /etc/systemd/network/20-wired.network
[Match]
Name=enp0s10f0
[Network]
DHCP=ipv4
[DHCP]
ClientIdentifier=mac
and restarted systemd-networkd
sudo systemctl restart systemd-networkd
Now, in output for systemctl status systemd-networkd, I see
enp0s10f0: DHCPv4 address 192.168.1.59/24, gateway 192.168.1.1 acquired from 192.168.1.1
But ip route still doesn't show a default route for that gateway, and an attempt to ping a public IP address results in: "connect: Network is unreachable." I've tried adding DefaultRouteOnDevice=true to the [Network] section of 20-wired.network. After making this change and restarting systemd-networkd, I see an additional route entry
default dev enp0s10f0 proto static scope link
and a different error when attempting to ping a public IP address
From 192.168.1.59 icmp_seq=1 Destination Host Unreachable
If I manually add the default route as before, I can ping a public IP address
sudo ip route add default via 192.168.1.1
Not sure what I'm missing...
Offline
Stop/disable systemd-networkd and dhcpcd*, then run
sudo dhcpcd -dB
which will launch dhcpcd for all NICs in non-forking debug mode.
Post the output and obviously check "ip a; ip r"
Offline
OK, seeing output for that command made me suspect a static route option (DHCP server). The static route doesn't cause apparent problems for other DHCP clients, but the route isn't needed for this Arch system. Overriding static routes (no static routes) for the DHCP reservation for this system seemed to work. After re-enabling/starting systemd-networkd, a default route is created as expected.
Thank you, Seth!
Offline
\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline