Network config not being exactly followed because of VLAN declaration in provisioning cmdline

Problem: We’ve recently installed Foreman+Katello (3.18 + 4.20) and have been trying to deploy a Dell server with Alma 9.7 via iPXE with it that’ll have a bonded (802.3ad) interface from 2 NICs.The provisioning process is quite smooth, we set one of the interfaces in the GUI to act as “provision” and add net.ifnames=0 biosdevname=0 vlan=eth0.XX:eth0 ip=dhcpso it can connect to the network.

We’ve noticed however that this setting in the provisioning cmdline seems to persist into the actual install, so we end up with two identical VLAN entries in NetworkManager and an vlanXX@eth0 interface that’s up and getting the IP address. If we edit NetworkManager manually post-install, we can successfully get the bond up with the VLAN tag. Is there any way to stop this from happening, or are we approaching this process from the wrong angle?

Expected outcome: The bond is the only interface with a VLAN entry after install, instead of the individual interface.

Foreman and Proxy versions: 3.18

Foreman and Proxy plugin versions: 3.18

Distribution and version: Rocky Linux 9.7 on Foreman Host

We’ve also found that for some reason our vlan connection that’s being generated for the bond is being assigned to itself? It’s never given a parent of bond0 in the generated kickstart:

network --device=aa:bb:cc:dd:ee:f1 --hostname=p-server1.host.tld --noipv4 --noipv6 --onboot=false --nodns
network --device=aa:bb:cc:dd:ee:f2 --hostname=p-server1.host.tld --noipv4 --noipv6 --onboot=false --nodns
network --device=vlan1 --hostname p-server1.host.tld --noipv6 --mtu=9000 --bootproto=dhcp --vlanid=1 --interfacename=vlan1 --nameserver=X.X.X.X
network --device=bond0 --hostname p-server1.host.tld --noipv4 --noipv6 --bondslaves=eth0,eth1 --bondopts=mode=802.3ad, --nodns

Adding this to the %post section in the kickstart sorts this out: sed -i 's/^parent=vlan1$/parent=bond0/' /etc/NetworkManager/system-connections/vlan1.nmconnection

I don’t think this will work. You should set the vlan in the foreman interface. Then foreman will configure the vlan… Manually setting it yourself will create another interface.

We do set it in the foreman interface, but for some reason it’s not getting attributed to the bond in the actual kickstart, so NM ends up attributing the vlan to itself. We do have to manually set the vlan on the cmdline though to download the kickstart file once it’s past iPXE.

Without knowing what you have configured exactly it’s virtually impossible to tell if you did it right or not…

Server networking is configured as such:

  • First port (going into the first switch) has identifier eth0 set as Provision and Managed
  • Second port (going into the other switch) has identifier eth1 set as just managed
  • Device with identifier bond0 with eth0 and eth1 as slaves, 802.3ad, set as just managed
  • Device with identifier vlan1 attached to bond0 with vlan tag, ipv4, domain and DNS name. Set as Managed, Primary, Remote Execution (and Virtual NIC).

We have the VLAN set in the server’s BIOS so that iPXE can get to the Next Server and start the chainload. We then have net.ifnames=0 biosdevname=0 vlan=eth0.XX:eth0 ip=dhcp(as mentioned in the beginning) in the kernel parameters for the Kickstart iPXE Template so that once it’s past iPXE it can continue to stay connected and download the kickstart and packages.

This messy method does work, but yes ideally we’d like to adjust this to be as painless as possible. We do have full control of the switches + DHCP + DNS but these are very new switches and we don’t have much experience configuring them :face_with_peeking_eye:

Hopefully that clears things up a bit

I don’t think a bond slave interface (eth0) can be a provision interface. A provision interface must have an ip address…

The provision interface gets an IP address without issue since during the provision stage it’s not an LACP bond yet (and is configured as such on the switches). It’s more when the install finishes, nm-init-rd is carrying over some of that ad-hoc cmdline config to the actual install itself

But you cannot have both: the network configuration in foreman must be consistent: a slave interface does not have an ip address and cannot be a provision interface. I guess, it should detect this as error but doesn’t. Thus, the resulting kickstart will get weird or broken.

Set up the bond in foreman and let it configure the kernel options for booting as well as the kickstart network configuration. That should give you a consistent configuration.

Have done this with the following setup:

eth0 set as managed

eth1 set as managed

bond0 with eth0 and eth1 as slaves, set as managed

vlan1 associated with bond0, with provision, primary, remote execution, etc all checked

Initial provisioning worked, but when it booted into the OS the interface configs were a little strange. vlan1 was replaced with “bond0.1@bond0”. The vlan1 I setup does get made though. The bond I had setup was also just completely missing eth0 as well. vlan1 had been assigned to itself, bond0 had ipv4 set to Disabled, and the initial eth0 and eth1 profiles that it should’ve created were missing any mention of the bond at all.

After untangling this the vlan came up properly, nm-initrd-generator is definitely causing issues somewhere.

This is what foreman generates as a network config in the kickstart:

network --device=vlan1 --hostname server.hostname.tld --noipv6 --mtu=9000 --bootproto dhcp --vlanid=10 --interfacename=vlan1 --nameserver=X.X.X.X
network --device=00:00:00:00:00:01 --hostname server.hostname.tld --noipv6 --mtu=9000 --bootproto=dhcp --nameserver=X.X.X.X
network --device=00:00:00:00:00:02 --hostname server.hostname.tld --noipv4 --noipv6 --onboot=false --nodns
network --device=bond0 --hostname server.hostname.tld --noipv4 --noipv6 --bondslaves=eth0,eth1 --bondopts=mode=802.3ad, --nodns

It generates the following cmdline parameters at the end of the iPXE file:

ip=::::server.hostname.tld::dhcp bond=bond0:eth0,eth1:mode=802.3ad, vlan=bond0.10:bond0 net.ifnames=0 biosdevname=0

That’s happening because you are trying to use obsolete, old-style naming schemas. The vlan 1 tagged interface on a base interface bond0 is bond0.1. That’s the official name and that is what foremane expects and what help says.

If you follow the standard naming schema as the help text says it will work.

Apologies shortly after the last reply I did adjust the namings to what they’re supposed to be, still ending up with the same result but NetworkManager is duplicating configs for the individual interfaces with wildly different names, some with a port type of bond and some without, then creating its own “vlan1” with a parent of bond0.1 without me even specifying it anywhere.

Applied a couple of patches that had the possibility to sort it:
Bug #39329: Order of network statements in anaconda kickstart with bond interfaces - Foreman
and Fixes #39224 - Properly identify device of vlan interface on kickstart by jpasqualetto · Pull Request #10954 · theforeman/foreman

Getting closer, but it’s still provisioning the bond VLAN interface (bond0.1) as its own bond set to balance-rr instead of a virtual interface post-install..

I’ve given up for now and gone back to how it was setup beforehand. Something seems to be broken between the Kickstart that Foreman generates and what nm-initrd-generator decides to do with the PXE parameters foreman passes through. It’s generating duplicates and broken configs no matter what I do

Ended up stumbling upon some old issues experiencing what I currently am:
Bug #10805: VLAN interface attached to bond is wrongly created as Bond - Foreman

This commit was introduced in October 2025, which could’ve possibly caused a regression for vlan IDs <10? Fixes #38870 - Update bond regex for bond interfaces numbered 10+ or … · theforeman/foreman@693ba75 · GitHub

Annoyingly I don’t have an easy way of checking this right now if it’s the case