Comment 2 for bug 2004478

Revision history for this message
Tuetuopay (tuetuopay) wrote :

Sure! Here is a quick test using a veth pair and dnsmasq:

ip link add veth0 up type veth peer name veth1
ip addr add 172.20.0.1/24 dev veth0
cat > /etc/netplan/60-veth1.yaml <<EOF
network:
  version: 2
  ethernets:
    veth1:
      dhcp4: true
EOF
dnsmasq -kq -C /dev/null -z -i veth0 -I lo -F 172.20.0.10,172.20.0.150 -O option:classless-static-route,169.254.0.0/24,0.0.0.0,169.254.1.0/24,172.20.0.2 &
netplan apply

Here is the resulting routing table on Jammy:

root@jammy:~# ip route
default via 10.199.96.88 dev ens2 proto dhcp src 10.199.96.89 metric 100
10.199.96.88 dev ens2 proto dhcp scope link src 10.199.96.89 metric 100
10.199.96.88/31 dev ens2 proto kernel scope link src 10.199.96.89 metric 100
169.254.1.0/24 via 172.20.0.2 dev veth1 proto dhcp src 172.20.0.52 metric 100
172.20.0.0/24 dev veth0 proto kernel scope link src 172.20.0.1
172.20.0.0/24 dev veth1 proto kernel scope link src 172.20.0.52 metric 100
172.20.0.1 dev veth1 proto dhcp scope link src 172.20.0.52 metric 100
172.20.0.2 dev veth1 proto dhcp scope link src 172.20.0.52 metric 100

As you can see, the route to 169.254.0.0/24 is missing. If I run the same on Focal, I get the following routing table:

root@focal:~# ip route
default via 10.76.140.48 dev ens2 proto dhcp src 10.76.140.49 metric 100
10.76.140.48 dev ens2 proto dhcp scope link src 10.76.140.49 metric 100
10.76.140.48/31 dev ens2 proto kernel scope link src 10.76.140.49
169.254.0.0/24 dev veth1 proto dhcp scope link src 172.20.0.53 metric 100
169.254.1.0/24 via 172.20.0.2 dev veth1 proto dhcp src 172.20.0.53 metric 100
172.20.0.0/24 dev veth0 proto kernel scope link src 172.20.0.1
172.20.0.0/24 dev veth1 proto kernel scope link src 172.20.0.53

Thanks!