Static DHCP mapping for client with bonded interface.

Started by flufferbot, January 31, 2021, 12:17:17 AM

Previous topic - Next topic
I am trying to configure the OPNSense DHCP server to send a fixed IP address to clients with bonded interfaces (multiple physical interfaces bonded in one virtual interface). The problem is that the bonded interface arbitrarily chooses the mac address of one of its underlying physical interfaces as its own mac address. This means that the mac address can change (and does change) each time the interface is rebooted. Thus, the static mapping in OPNSense cannot be based on a fixed MAC address for the client.

I have tried two things:

  • Leave the mac address blank in the DHCP static map specification in OPNSense, and just set the client identifier. Have the client send that same identifier.
  • Add a static map for all (four) physical mac addresses the bonding interface can take
Neither of these work. The OPNSense DHCP server doesn't seem to want to assign a static map based on client identifier. Only if I put a MAC address in there. In the second case, the UI rejects multiple static maps with different MAC addresses but the same IP.

I am curious if anyone has had the same issue and found a way to make it work. It seems like a limitation with DHCP itself, although it does seem like this is what the "client identifier" option is for.

Quote from: flufferbot on January 31, 2021, 12:17:17 AM
I am trying to configure the OPNSense DHCP server to send a fixed IP address to clients with bonded interfaces (multiple physical interfaces bonded in one virtual interface). The problem is that the bonded interface arbitrarily chooses the mac address of one of its underlying physical interfaces as its own mac address. This means that the mac address can change (and does change) each time the interface is rebooted. Thus, the static mapping in OPNSense cannot be based on a fixed MAC address for the client.

I have tried two things:

  • Leave the mac address blank in the DHCP static map specification in OPNSense, and just set the client identifier. Have the client send that same identifier.
  • Add a static map for all (four) physical mac addresses the bonding interface can take
Neither of these work. The OPNSense DHCP server doesn't seem to want to assign a static map based on client identifier. Only if I put a MAC address in there. In the second case, the UI rejects multiple static maps with different MAC addresses but the same IP.

I am curious if anyone has had the same issue and found a way to make it work. It seems like a limitation with DHCP itself, although it does seem like this is what the "client identifier" option is for.

Hi
On linux, for example Centos
Assigning permanent MAC address for a bonding network interface.

    Forcing a bond to get its MAC address from a specific slave, MACADDR directive has to be added with the MAC address of the required slave to /etc/sysconfig/network-scripts/ifcfg-bondX file.

#  cat /etc/sysconfig/network-scripts/ifcfg-eno1
DEVICE=eno1
NAME=eno1
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
NM_CONTROLLED=no

# cat /etc/sysconfig/network-scripts/ifcfg-eno2
DEVICE=eno2
NAME=eno2
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
NM_CONTROLLED=no

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
NAME=bond0
TYPE=Bond
MACADDR=a0:36:9f:0f:b1:70
ONBOOT=yes
BOOTPROTO=dhcp
NM_CONTROLLED=no
BONDING_OPTS="mode=active-backup primary=eno1 miimon=100"

After performing the necessary changes in the network configuration files make sure to reboot the system for the MAC address to take effect.