Skip to content

ipxe: Allow overriding the network gateway per interface - #16

Open
bensallen wants to merge 2 commits into
olcf:masterfrom
bensallen:interface_gateway_override
Open

ipxe: Allow overriding the network gateway per interface#16
bensallen wants to merge 2 commits into
olcf:masterfrom
bensallen:interface_gateway_override

Conversation

@bensallen

Copy link
Copy Markdown
Contributor

This PR stacks on #15.

An interface typically takes the gateway or gateway6 of the network it references.

With this change, either gateway setting can now be set on the interface itself, and setting one to an empty string or false leaves that field of ip= empty so dracut adds no default route through the interface. This allows a node to boot from one interface while routing through another.

Previously the gateway came only from networks.yaml, so suppressing the gateway meant removing it from the network entirely.

The use-case where I needed this was a login node that is being provisioned on a cluster network that has a gateway for compute nodes, but the login has a public interface that should be its default gateway.

An interface with vlanparent set, or named following one of the four
styles dracut supports, now generates a dracut vlan= argument. The interface
name (or interfacename) must match one of the four styles from dracut.cmdline(7):
vlan5, vlan0005, eth0.5 or eth0.0005. The DEV_PLUS_VID styles already
encode the parent, so vlanparent is only required for the VLAN_PLUS_VID
styles.

Added interface attribute "neednet" to enable ip= based configuration
even when not the bootdev, allowing for multiple interface configuration
via Dracut.

Each bootfile now names the interface it was generated for as the bootdev
instead of relying on primary.

An interface with an ip6 is now configured from the network's ipv6
definition. Previously an ipv6-only interface failed with a misleading
"missing 'ip'".

Dual-stack interfaces emit one ip= per family. Supported by
NetworkManager and systemd-networkd, but not dracut's 35network-legacy.

Interfaces are now iterated in sorted order to ensure generated bootfiles
don't differ between runs.

ipxe.py configuration problems now raise BootloaderConfigError, which
write_bootloader_scripts logs as a warning before skipping the interface.
These were previously caught by a bare except and only logged at debug.

The ipxe template context no longer has "ipline" available, moving fully
to the new "netargs".

Adds tests/test_ipxe.py. This needs tests/conftest.py and tests/conf to
set PHOENIX_CONF before phoenix is imported, which also fixes the existing
node tests failing on a clean checkout.
An interface takes the gateway and gateway6 of the network it references.
Either can now be set on the interface itself, and setting one to an empty
string or false leaves that field of ip= empty so dracut adds no default
route through the interface. This allows a node to boot from one interface
while routing through another. The two families are independent.

Previously the gateway came only from networks.yaml, so suppressing it
meant removing it from the network entirely, which affected every node on
that network and also dropped the dnsmasq option 3 for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant