Comment 0 for bug 1836695

Revision history for this message
Alexey Zagarin (zagarin) wrote : Netplan ignores static routes when using DHCP

Consider the following setup:

network:
  version: 2
  renderer: networkd
  ethernets:
    ens4:
      dhcp-identifier: mac
      dhcp4: yes
      dhcp4-overrides:
        use-dns: no
        use-ntp: no
        send-hostname: no
        use-hostname: no
        use-routes: no
      routes:
      - to: 10.0.0.0/8
        via: 10.50.0.1
      optional: true

Thus I only need to get the IP address by DHCP, then add some static routes. This setup doesn't work. Apparently `routes` keyword only works when using static addresses.