dnsmasq server conf:

domain=test,1.2.3.4/24
dhcp-range=test,1.2.3.100,1.2.3.199,1m
dhcp-option=42,1.2.3.1
#dhcp-option=121,0.0.0.0/0,1.2.3.1

test system conf:

ubuntu@lp1835581-e:~$ cat /etc/systemd/network/10-ens8.network 
[Match]
Name=ens8

[Network]
DHCP=ipv4
LinkLocalAddressing=ipv6
Address=1.2.3.99/24



ubuntu@lp1835581-e:~$ dpkg -l systemd|grep ii
ii  systemd        242-7ubuntu3 amd64        system and service manager
ubuntu@lp1835581-e:~$ ip -4 a show ens8
3: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
group default qlen 1000
    inet 1.2.3.99/24 brd 1.2.3.255 scope global ens8
       valid_lft forever preferred_lft forever
    inet 1.2.3.170/24 brd 1.2.3.255 scope global secondary dynamic ens8
       valid_lft 98sec preferred_lft 98sec
ubuntu@lp1835581-e:~$ ip -4 r
default via 1.2.3.1 dev ens8 proto dhcp src 1.2.3.170 metric 1024 
1.2.3.0/24 dev ens8 proto kernel scope link src 1.2.3.99 
1.2.3.1 dev ens8 proto dhcp scope link src 1.2.3.170 metric 1024 


route src is correctly set to dhcp addr, when dnsmasq not configured with 
classless route


uncomment dnsmasq server conf classless route:

domain=test,1.2.3.4/24
dhcp-range=test,1.2.3.100,1.2.3.199,1m
dhcp-option=42,1.2.3.1
dhcp-option=121,0.0.0.0/0,1.2.3.1

reboot test system:

ubuntu@lp1835581-e:~$ ip -4 a show ens8
3: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
group default qlen 1000
    inet 1.2.3.99/24 brd 1.2.3.255 scope global ens8
       valid_lft forever preferred_lft forever
    inet 1.2.3.170/24 brd 1.2.3.255 scope global secondary dynamic ens8
       valid_lft 110sec preferred_lft 110sec
ubuntu@lp1835581-e:~$ ip -4 r
default via 1.2.3.1 dev ens8 proto dhcp metric 1024 
1.2.3.0/24 dev ens8 proto kernel scope link src 1.2.3.99 


route src incorrectly not set, when dnsmasq set to classless route



change dnsmasq server again to comment out classless route and restart it, then 
reboot test system:

ubuntu@lp1835581-e:~$ dpkg -l systemd|grep ii
ii  systemd        242-7ubuntu3.2 amd64        system and service manager
ubuntu@lp1835581-e:~$ ip -4 a show ens8
3: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
group default qlen 1000
    inet 1.2.3.99/24 brd 1.2.3.255 scope global ens8
       valid_lft forever preferred_lft forever
    inet 1.2.3.170/24 brd 1.2.3.255 scope global secondary dynamic ens8
       valid_lft 97sec preferred_lft 97sec
ubuntu@lp1835581-e:~$ ip -4 r
default via 1.2.3.1 dev ens8 proto dhcp src 1.2.3.170 metric 1024 
1.2.3.0/24 dev ens8 proto kernel scope link src 1.2.3.99 
1.2.3.1 dev ens8 proto dhcp scope link src 1.2.3.170 metric 1024 


re-enable classless route on server and reboot test system:

ubuntu@lp1835581-e:~$ ip -4 a show ens8
3: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
group default qlen 1000
    inet 1.2.3.99/24 brd 1.2.3.255 scope global ens8
       valid_lft forever preferred_lft forever
    inet 1.2.3.170/24 brd 1.2.3.255 scope global secondary dynamic ens8
       valid_lft 104sec preferred_lft 104sec
ubuntu@lp1835581-e:~$ ip -4 r
default via 1.2.3.1 dev ens8 proto dhcp src 1.2.3.170 metric 1024 
1.2.3.0/24 dev ens8 proto kernel scope link src 1.2.3.99 


route is correctly sourced from dhcp address



** Tags removed: verification-needed verification-needed-eoan
** Tags added: verification-done verification-done-eoan

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1835581

Title:
  networkd-dhcp4 does not set prefsrc for dhcp-provided classless or
  static routes

To manage notifications about this bug go to:
https://bugs.launchpad.net/systemd/+bug/1835581/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to