Gateway autospawn¶
Gateway autospawn saves you a step: when you create a prefix and leave the gateway field blank, Danbyte can create the gateway IP for you and link it to the prefix automatically - as long as the prefix's site has a gateway policy.
Set it up¶
A site's gateway policy decides which address in each new prefix becomes the gateway. Set it on the site, then never think about it again:
| Policy | Gateway picked |
|---|---|
| None (default) | No automatic gateway - you set it yourself, or leave it blank. |
| First | The first usable host in the prefix (e.g. 10.0.10.1 in a /24). |
| Last | The last usable host in the prefix (e.g. 10.0.10.254 in a /24). |
You also need a gateway role defined in your IP-role catalog so Danbyte knows which role to mark the new address with. See IP statuses & roles.
What happens when you save¶
When you create a prefix and leave the gateway blank, Danbyte:
- Checks the prefix's site for a gateway policy. No site, or policy set to None → nothing happens. A prefix with Automatic gateway off, or with the Container status, is skipped as well.
- Works out the gateway address from the policy (first or last host).
- Creates an IP at that address, marked assigned with the gateway role, and notes it was auto-created by the site policy. If an IP already exists at that address, Danbyte reuses it and promotes it to the gateway role instead of creating a duplicate.
- Sets the prefix's gateway to that address.
The new gateway is scoped to the prefix's VRF, so the same block in two different VRFs gets its own gateway, one per VRF. Only an IP in the same VRF is reused: one at that address in another VRF is a different host and is never touched. A reused IP moves onto the new prefix only when it sat on a broader one; an IP on an equal or narrower prefix stays where it is, keeps its role, and the new prefix just records the gateway address.
If creating the gateway fails, the prefix is still saved and the error is logged.
When autospawn is skipped¶
| Situation | Why it's skipped |
|---|---|
| The prefix has no site | There's no policy to look up. |
| The site's policy is None | You've opted out for that site. |
| The prefix has Automatic gateway off | You've opted out for that prefix: a loopback block, a /31 link, anything with no gateway. |
| The prefix's status is Container | A container holds other prefixes, not hosts. |
| You filled in the gateway yourself | Your value wins - no automatic address. |
| The prefix is IPv6 | An IPv6 /64 has no obvious "first host" to use as a default gateway. |
| The prefix allocates only from its ranges and the address falls outside them | That first/last usable address is the provider's gateway, not one you allocate. |
Opting a prefix out¶
Every prefix has an Automatic gateway setting, on by default. Turn it off
in the prefix form, in a prefix bulk edit, through the API (auto_gateway) or
in an import file (an auto_gateway column) and the site policy leaves that
prefix alone. The policy only runs when a prefix is created, so turning the
setting off later never removes a gateway that is already there: clear it by
hand if you no longer want it.
Setting or changing the gateway by hand¶
You're never locked in. On a prefix's detail page, each IP row has a Set as gateway action. Using it:
- Removes the gateway role from whichever IP held it before.
- Marks this IP as the gateway.
- Updates the prefix's gateway to this address.
If you later clear the role from the IP that was acting as gateway, the prefix's gateway field is cleared too, so it never points at a stale address.