How to configure VLAN over bonding in rescue mode?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 10

Issue

  • How to configure a bonding in rescue mode?

Resolution

For RHEL 9 & 10 :

In RHEL 9 and RHEL 10, when the system is booted into rescue mode, NetworkManager is enabled by default. This means:

  • If DHCP is enabled on the server and a DHCP server is available in the network, all active network interfaces will automatically obtain IP addresses.

  • This simplifies connectivity during rescue operations, as manual IP configuration is typically not required.

However, if DHCP is not enabled or no DHCP server is present, network interfaces will not receive IP addresses automatically. In such cases, you must manually assign IP addresses, following the same steps used in RHEL 8 and earlier which is given below. Or you can also follow the steps which we generally use to configure the VLAN over bond using nmcli.

Additionally If the server was originally configured with a VLAN over a bonded interface and the switch port is in trunk mode, then also no IP will be assigned in rescue mode and we need to manually configure the vlan over bond with same steps.

Refer below article for the same.

How to configure a VLAN on top of a bond with NetworkManager

Important Note : The IP address assigned to the server in rescue mode may not be the same as the original IP address because, in rescue mode, network interfaces attempt to obtain IP addresses via DHCP by default. The system does not read or apply the original network configuration from the installed system being rescued.

For RHEL 8 and earlier:

Boot a system in rescue mode.

  • Load a bonding module. Make the changes in command as per mode i.e. if you want to configure LACP bond then make it mode=4. Below example is of Active backup which is mode 1.
# modprobe bonding mode=1 miimon=500
(The bonding mode used is "active-backup")
  • Add a bond device
# ip link add bond0 type bond
  • Bring the bond device up:
# ip link set dev bond0 up
  • Add interfaces to the bond.
# ip link set dev eth1 down
# ip link set dev eth2 down
# echo "+eth1" > /sys/class/net/bond0/bonding/slaves
# echo "+eth2" > /sys/class/net/bond0/bonding/slaves
# ip link set dev eth1 up
# ip link set dev eth2 up
  • Set VLAN on the bond device :
# ip link add link bond0 name bond0.25 type vlan id 25
# ip link set bond0.25 up
  • Set up IP address into the bond device.
# ip addr add 192.0.2.50/24 brd 192.0.2.255 dev bond0.25 label bond0.25
  • Set up Gateway address into the bond device.
# ip route add default via 192.0.2.1
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.