Network Bond in PXE

Trying to set up network bonding in PXE post-installation but failing to do it successfully. Am I doing it correctly? I think its failing to set IP to bond interface which I have defined in step 1.

  1. Strictly obtain the current IP and gateway:
current_ip=$(ip -o -4 addr show | grep -v '127.0.0.1' | awk '{print $4}' | head -n 1)
gateway=$(ip route show | grep default | awk '{print $3}')
  1. Find connected and disconnected network connections using nmcli and delete them.
  2. Define the value of the two disconnected devices using nmcli.
  3. Add the bond:
nmcli connection add type bond ifname bond0 con-name bond0 bond.options "mode=802.3ad"
  1. Add member devices to the bonding interface:
nmcli connection add type ethernet ifname <device_from_step_3> master bond0
  1. Configure the bond with the stored IP, gateway, and DNS:
nmcli connection modify bond0 ipv4.addresses "$current_ip"
nmcli connection modify bond0 ipv4.gateway "$gateway"
nmcli connection modify bond0 ipv4.dns "8.8.8.8 8.8.4.4"
nmcli connection modify bond0 ipv4.method manual

i don’t think you can use nmcli in %post due to lack of dbus connectivity.

you can do it from the main kickstart like so if you know the settings and don’t have to calculate them:

network  --bootproto=static --device=B0_NB --bondslaves=eth0,eth4 --bondopts=mode=active-backup,miimon=100 --gateway=192.168.1.1 --ip=192.168.1.43 --netmask=255.255.255.0 --nameserver=192.168.1.1 --noipv6 --activate
network  --bootproto=static --device=B1_IC --bondslaves=eth1,eth5 --bondopts=mode=active-backup,miimon=100 --ip=10.0.0.43 --netmask=255.255.0.0 --noipv6 --activate
network  --bootproto=static --device=eth2 --ip=10.4.0.43 --netmask=255.255.0.0 --activate --hostname=jamesbond
network  --bootproto=static --device=B2_SB --bondslaves=eth3,eth7 --bondopts=mode=active-backup,miimon=100 --ip=10.1.0.43 --netmask=255.255.0.0 --noipv6 --activate

The problem is we use a control panel for installation purposes hence can not modify kickstart.

so what are you using pxe for? is this a cpanel vps or something then?

There might be some miscommunication here.

PXE is one way to load OS, usually the installer. Other ways are having the installer image on USB or DVD and booting from it. If we control the PXE server, then it is really easy to feed kickstart instructions to the installer.

The kickstart has a “post” section. Essentially a script that is executed by the installer after the main installation has completed.

@shree2718 states that the kickstart/PXE is controlled by “control panel”. Hence, the “post-installation” cannot refer to the “post” in kickstart? Rather, things to do after the installation is completely over and we have already booted the newly-installed system.

If that is the case, then installation being done with PXE is irrelevant. What counts is that there is an installed system (installed by control panel) and what to do with it.


I don’t – and have never – use any “control panel”. I reckon that they do them, including the network configuration. Can’t help with that.

In ideal world DHCP hands out IP configuration, so the default to use DHCP is trivial. I presume that the control panel environment does not offer such convenience.


Even the NetworkManager does store its configuration in files. Files that can be written, if you know the syntax. Written without NetworkManager’s tools. That is what I would do, if I were forced to do something in a script in the post-section of a kickstart file.

What to put into those files? I’d do the configuration manually, interactively, on test system and look at the produced files. Then reproduce them on the script.