additional gateways use wrong source value
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When deploying a node with multiple NICs on different subnets that each have their own default gateway set, MaaS incorrectly sets the "from:" parameter on the additional routes. This results in broken network connectivity for those routes. If the user manually correct the "from:" parameter and restarts systemd-networkd, the problem resolves.
Example:
Server with 2 NICs:
- NIC 1 on Subnet 1 with 33.44.55.64/29, default gateway is 33.44.55.65 and IPs are auto-assigned
- NIC 2 on Subnet 2 with 192.168.0.0/24, default gateway is 192.168.0.1 and IPs are auto-assigned
Resulting netplan config:
* NIC1 has IP 33.44.55.66 and "gateway4: 33.44.55.65" parameter set
* NIC2 has IP 192.168.0.2 and no gateway4 parameter set, but has a routing-policy:
routes:
- table: 1
to: 0.0.0.0/0
via: 192.168.0.1
routing-policy:
- from: 192.168.0.0/24
priority: 100
table: 1
- from: 192.168.0.0/24
table: 254
to: 192.168.0.0/24
This results in not being able to ping any other address on the 192.168.0.0/24 network.
However the official documentation (https:/
I currently have to resort to the following cloud-init script to fix this upon deployment:
#!/bin/bash
ADDR_
sed -i "s/- from: 192.168.0.0/24/- from: $ADDR_PRIV/g" /etc/netplan/
Can this be fixed in MaaS please?
description: | updated |
description: | updated |
Besides this, it would also be nice if there was a more automatic way of telling MaaS which subnet has the preferred default gateway.
If the NIC order was reversed in the above example, I currently have to run the "maas <profile> interface set-default- gateway" command to ensure the "gateway4:" parameter gets set for the NIC in the desired network. While this works, it's impossible to see from the GUI which setting is active.
If instead, a priority could be given to the gateway in each MaaS subnet configuration, then MaaS can auto-select the gateway with the best priority value and admins don't have to manually set the right gateway on a per-node basis.