You are not logged in.

#1 2022-04-25 15:42:13

eom.dev
Member
Registered: 2022-02-11
Posts: 57

systemd-networkd does not work without dhcpcd

I have a few virtual machines that are all using a static ip configured with systemd-networkd.  Here is the configuration file:

[Match]
Name=tp-4def5ad77dae

[Network]
Address=10.0.0.5/8
Gateway=10.0.0.2
DNS=10.0.0.2

If I boot this machine without dhcpcd enabled, the host receives no response to a ping on 10.0.0.5; however, if I enable dhcpcd on the guest and reboot, it gets a random dynamic ip and the 10.0.0.5 static ip configured by systemd.  I would like to remove the redundant software and IP address, but it doesn't seem so redundant.  Would someone please explain what is going on here?

Offline

#2 2022-04-25 16:00:34

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 242

Re: systemd-networkd does not work without dhcpcd

Does the host know where 10.0.0.0/8 is located? What is host's routing table content when dhcpcd is on and when it's off?

Offline

#3 2022-04-25 16:09:26

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

Re: systemd-networkd does not work without dhcpcd

eom.dev wrote:

I have a few virtual machines that are all using a static ip configured with systemd-networkd.  Here is the configuration file:

[Match]
Name=tp-4def5ad77dae

[Network]
Address=10.0.0.5/8
Gateway=10.0.0.2
DNS=10.0.0.2

Thats O.K. - but again: Why do you use a Class A subnet mask (/8)?

eom.dev wrote:

If I boot this machine without dhcpcd enabled, the host receives no response to a ping on 10.0.0.5; however, if I enable dhcpcd on the guest and reboot, it gets a random dynamic ip and the 10.0.0.5 static ip configured by systemd.  I would like to remove the redundant software and IP address, but it doesn't seem so redundant.  Would someone please explain what is going on here?

systemd-networkd doesn't need any dhcp client or server. Please remove dhcpd.

Offline

#4 2022-04-25 18:27:14

eom.dev
Member
Registered: 2022-02-11
Posts: 57

Re: systemd-networkd does not work without dhcpcd

dimich wrote:

Does the host know where 10.0.0.0/8 is located? What is host's routing table content when dhcpcd is on and when it's off?

I'm assuming host means the guest machine here.  It is able to ping 10.0.0.0/8 (the hypervisor), as well as the network bridge and virtual router (10.0.0.1 and 10.0.0.2).  It is difficult to get the routing table when dhhcp is off since the usual ways I would access it are unavailable, but I know that it is routing through 10.0.0.2 as configured when dhcpcd is on.

-thc wrote:

Why do you use a Class A subnet mask (/8)?

Are you asking why I'm using it on the network or for this machine?  I use it on the network because it accommodates the most hosts, I'm using it on this machine because I want all of those hosts to be able to address it.

-thc wrote:

systemd-networkd doesn't need any dhcp client or server. Please remove dhcpd.

If I do not install dhcpcd, the machine does not get an IP and I cannot access it.

Offline

#5 2022-04-25 19:58:32

seth
Member
Registered: 2012-09-03
Posts: 51,314

Re: systemd-networkd does not work without dhcpcd

Then  you don't need systemd-networkd. Don't run multiple network managing services concurrently.
Post your system journal

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

and 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

ip a; ip r

Are you asking why I'm using it on the network or for this machine?

Do you understand what a Class A subnet is?

Offline

Board footer

Powered by FluxBB