Change the default gateway

My maas environment contains a PXE vlan and a data vlan. I find that the default gateway is the gateway of the PXE network after the OS is deployed, but I want the gateway of the data vlan as the default gateway. So after a few tries, I find that setting the “Subnet” and “IP mode” of the PXE network on the network tab to “Unconfigured” before deploying the OS works, but this also causes the PXE network not to have an IP address configured. My question is, if the PXE network and the data network of the server are independent of each other, can I not assign IP address to the PXE network and if it’s true will this cause problems in later use?
Thank you.

I think our situation is similar to what you describe: separate vlans for PXE and data. What we’ve done is configure the subnets in MAAS so that only the data subnet has a Gateway configured. The PXE subnet leaves the Gateway entry blank. Then, after a machine deploys it has only one default gateway: the data vlan.
To address your question specifically: we assign static IP addresses to both the PXE and data NICs to a machine before we deploy it. This setup is working well for us. Let me know if it works for you as well.

Hello jb-ubuntu1,
Thanks for the answer. Our yum / apt repository is in a different subnet from PXE, so the OS deployment of maas will fail if we don’t configure a gateway for PXE subnet. PXE subnet is useless to us after the OS deployment, which means that I do not need to keep PXE network for a long time. I already found a way to configure and use PXE network only during deployment and do not retain PXE network after deployment, but I am not sure whether this will bring subsequent use problems. I want to confirm this. Thank you.

Hi @firezjs,

Reviving this old topic, as it is very relevant to our setup.

We have a Deploy/PXE/MAAS network (untagged directly on NIC) and a default Data VLAN (on the same NIC) throughout our deployment.

I have had problems in the following setups:

  • Gateway for both the MAAS and the Data Networks:

    • Source Routing is apparently active, but is not helpful. As in your case, the MAAS netork is useless to us after deployment
    • After Deployment, MAAS is still the default gateway, which our firewall does not really like;
    • Also, our internal networks are not all within the Data VLANs ip range…
  • I tried removing the Gateway from the MAAS network in the hopes that the network settings are applied early enough so all the apt stuff can reach outside via the data VLAN.

    • This does not work, and apparently the network setup is done later as I thought

Can you tell me how you achieved to remove the PXE/MAAS network after deployment?

Hi Score,

In our setup, we have a purely internal network with no public access used for PXE and a public network for internet access. Try these settings out:

MaaS Settings:
Settings --> Network --> Proxy --> MAAS built-in
Settings --> Network --> DNS --> Upstream DNS used to resolve domains not managed by this MAAS (space-separated IP addresses) --> Set to your DNS servers
Settings --> Network --> DNS --> Enable DNSSEC validation of upstream zones --> Automatic

Internet network:
Notes: These should be pretty standard and set according to your needs, but it should have a gateway IP, DNS set, I’ve enabled Proxy and DNS resolution, but you may not need it.
Name --> 10.x.x.0/24
CIDR --> 10.x.x.0/24
Gateway IP --> 10.x.x.253
DNS --> Set to your DNS servers
Managed allocation --> Enabled
Proxy access --> Allowed
Allow DNS resolution --> Allowed
DHCP --> Disabled (everything is static on this network).
I do NOT have any static routing, DHCP snippets or Reserved ranges here.

PXE network:
Name --> 192.x.x.0/16
CIDR --> 192.x.x.0/16
Gateway IP -->
DNS -->
Managed allocation --> Enabled
Proxy access --> Allowed
Allow DNS resolution --> Allowed
DHCP --> Enabled (MaaS controlled)
Static Route --> Gateway IP: Region/rack controller IP on MaaS (i.e. 192.x.x.253) Destination: 10.x.x.0/24
Reserved Ranges --> Start IP & End IP are set for dynamic DHCP.
DHCP Snippets --> Not set.

For more detailed writeup, checkout my blog post

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.