Forcing ip route default to not be based on bootstrapping NICs gateway

Hello,

Been trying to run MaaS and overall it’s really cool! I understand that I possibly need to run multiple controllers, but wanted to try using our old proxied DHCP Relay to bootstrap machines from subnet_b while MaaS is runnning in subnet_a.

  • In subnet_b we have a DHCP Relay & Proxy running to subnet_a.
  • Each new server in subnet_b needs to use the machine above as a Gateway, to reach subnet_a.
  • Setting Gateway to this machine works great, but when Ubuntu is installed:
**ubuntu@**:**~**$ ip route
default via **IP-OF-DHCPRELAY/PROXY** dev enp3s0f1np1 proto static

Saw that the templating sets gateway4 in Cloud-init and therefore the default route appears.

Would like to use an another public IP/NIC as default gateway (need direct internet, not using a NAT here).

The information that I found on the internet says that I need to delete the gateway from my private VLAN and use a static route. Tried that - but then HTTP BOOT does not work, as there’s no gateway returned in DHCPREPLY.

Is there some way to work around this? Or do by design I really need to setup a controller in each VLAN? This would allow me to delete the Gateway IP in the private subnet. Currently just did set-up a NAT service on the same Gateway and it works great for testing.

TYVM, super cool system!

Did you try to set the default gateway in the subnet settings?

Hey @r00ta . Thanks for replying.

Set a “Gateway” like this (screenshot from the internet


) for the private subnet to our [dhcp relay/proxy] server.
This makes the whole process work, but then the default ip route gets set to the same.

Was wondering how to override so that this doesn’t set the default route in the Ubuntu OS, but just a route… :slight_smile: .
Since we need the default route to be on a public CIDR that we’re using on the same box.

Usually you have an out of band network for PXE provisioning and then other networks for data/internet.

I believe the only way you can change the default gateway for that subnet is AFTER deployment with a custom cloud init script to change it accordingly

Makes sense. Just kinda it seems right now the automation is made in the fashion that it expects that even if you only need the out-of-band for bootstrap and set the Gateway, that somehow becomes the OS Gateway? Lots of assumptions on how the network looks like. It would be very helpful if you could set the default route separately or similar, now it’s a bit auto-magic.

We were thinking of using cloud-init, but kinda came here to make sure we don’t do anything unnecessary :grin: thanks. Will consider how to use it for now.

Getting back to the suggestion,

As an example in this test server we do have 1 NIC out of band and 1 for data/internet.

It’s just that we need to set that Gateway, to be able to do actual HTTP BOOT, and then it becomes the default route in the OS. (Otherwise there’s no Option 3 Router returned during DHCP).

So the data/internet network just sits there and out of the box is not able to reach any internet from itself.

Would be great to have the possibility to set the default gateway for the Machine. For example for us it would need to be 10.6.0.20 during HTTP BOOT (

default via 10.6.0.20 dev enp3s0f1np1 proto static 
<...>

Sorry, I am allowed to do 1 image per post.
Here is our public facing subnet.

Sorry, I am allowed to do 1 image per post.
Here is our DHCP/HTTP BOOT facing subnet.