systemd-networkd dhcp_client static_route


I’ve configured a dhcpd (on to lease ip address and static route to host

subnet netmask { 
  option subnet-mask; 
  option static-routes; 
  option broadcast-address; 

My systemd-networkd .network config:


ConfigureWithoutCarrier = true 


But systemd-networkd dhcp client get route with /8 netmask - via
Is it a bug of systemd-networkd or my error in configuration?

#### ip -4 route | fgrep eth0.10 dev eth0.10 proto kernel scope link src via dev eth0.10 proto dhcp src  metric 1024 


##### systemctl --version 
systemd 246 (246.13+suse.105.g14581e0120) 

I would run Wireshark on the interface that is connected to

Then renew the DHCP address lease and see which packets go by and study the DHCP response. That way you can decide if the DHCP server is to blame or the systemd-networkd dhcp client.

I’ve saw right host route lease (Option 33 = Static Route) in wireshark.
Next, I’ve taked a notebook with new clean Tumbleweed installation and tried to get routes from
my the dhcp-server (centos8).

  1. The NetworkManager has got right route with host netmask. (

(clean and reboot)

  1. The wicked has got strange route with /31t netmask. (

(clean and reboot)

  1. The systemd-networkd has add /24 netmask to my host route. (

So, it’s very strange, my first test was with Raspberry 4 (Tumbleweed), and it got /8 netmask
for host static route with systemd-networkd…

You are mistaken. This is the wrong option to use. Option 33 does not include netmask nor does it define actual interpretation of address that is not exact class A/B/C network address.

You need option 121 (classless route) that allows you to specify exactly what mask to use and provide host route without any ambiguity.

The NetworkManager has got right route with host netmask. (

It is not “right”. It just happens to match what you want.

The wicked has got strange route with /31t netmask. (

I can imagine how it could come up with this result. Anyway, it is just as valid as other results - as I already said, you get undefined behavior here. It is garbage in - garbage out.

The systemd-networkd has add /24 netmask to my host route. (

That is the most common interpretation of option 33 and it is just as right (or just as wrong) as any other you listed.

So back to your original question - it is configuration problem, you are using the wrong dhcpd option :slight_smile:

no no no, I need get a route to host. Is this configuration wrong?

option static-routes;

I know about option 121 and can cook it.
But I believed that option 33 is for host route. I’m confused. :frowning:

No, it is not. It was created for classful network routes. If you feed it with anything else, result is undefined. NetworkManager has heuristic to assume host route is default host part is not zero. wicked has heuristic to extend network mask if default host part is not zero. systemd-networkd simply assumes default class mask.

In all cases it is implementation defined and neither implementation is better than any other.

Thank you very much. I’ll add an option 121. The question is closed.