No equivalent to ip route add X dev Y
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I need to find the netplan equivalent of the command
ip route add 10.96.0.0/24 dev ens3
Where the IP address of ens3 is 10.20.0.10/24. This is an unusual requirement, it's needed by kubernetes (see https:/
I have tried various attempts to capture this in netplan, and none of these even produce any routes at all (although netplan apply gives no errors)
I tried:
network:
version: 2
renderer: networkd
ethernets:
enp3s0f1:
dhcp4: yes
ens3:
dhcp4: no
dhcp6: no
addresses: [10.20.0.10/16]
routes:
- to: 10.96.0.0/24
via: 10.20.0.10
And I tried specifying
routes:
- to: 10.96.0.0/24
via: 10.20.0.10
scope: link
on-link: true
I also tried
routes:
- to: 10.96.0.0/24
via: 10.96.0.1
scope: link
on-link: true
Neither netplan apply nor rebooting actually produces any routes concerning 10.96.0.0/24 at all. The original ip route add command works well, what is the netplan equivalent of that?
Netplan doesn't support "dev", so this is effectively a feature request. I also need this feature. Currently, "via" is required. As "dev" is added, that restriction will need to be relaxed (e.g. that either "via" or "dev" is required).