vlan and mac address

  • Hello to everyone (since this is my 1st post here)!


    I have a problem using dhcp in vlans defined on the same nic. Only the 1st one get's an ip. My dhcp server denies the following requests, saying that this nic already got one.


    The problem seems to be a missing (optional) field in the definition of a vlan allowing you to set a specific (virtual) mac address. Netplan supports this.

    Are there any plans to support this? Any hints for a workaround?


    Tnx, Thorsten

  • Does your NIC carry tagged traffic for more than one vlan? Have you configured the DHCP server to have one DHCP pool per vlan? I could only test this using VMs using pfsense and OMV and It appears to work OK.


    network as configured & seen in webUI:



    output of "ip a" at CLI:



    I can ssh to 192.168.20.16 from a third VM.

  • ok, let's go into detail. deep :-)


    dmesg gives the NIC information:


    [ 0.912096] r8169 0000:22:00.0 eth0: RTL8168h/8111h, 00:d8:61:aa:ea:d5, XID 541, IRQ 84


    [ 1.069988] igb 0000:26:00.0: Intel(R) Gigabit Ethernet Network Connection

    [ 1.069990] igb 0000:26:00.0: eth0: (PCIe:2.5Gb/s:Width x1) 80:61:5f:5a:61:1a

    [ 1.070073] igb 0000:26:00.0: eth0: PBA No: E43709-006

    [ 1.258037] igb 0000:26:00.1: Intel(R) Gigabit Ethernet Network Connection

    [ 1.258038] igb 0000:26:00.1: eth1: (PCIe:2.5Gb/s:Width x1) 80:61:5f:5a:61:1b

    [ 1.258120] igb 0000:26:00.1: eth1: PBA No: E43709-006



    After defining 1st NIC: OMV is in management net, mac is correct.

    2nd (dual port) NIC unused with correct macs (output of "ip a"):


    2: enp34s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 00:d8:61:aa:ea:d5 brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.50/24 brd 192.168.1.255 scope global enp34s0

    valid_lft forever preferred_lft forever

    3: enp38s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000

    link/ether 80:61:5f:5a:61:1a brd ff:ff:ff:ff:ff:ff

    4: enp38s0f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000

    link/ether 80:61:5f:5a:61:1b brd ff:ff:ff:ff:ff:ff



    After defining a LACP (802.3ad) bond of 2nd NIC the original macs are replaced:


    2: enp34s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000

    link/ether 00:d8:61:aa:ea:d5 brd ff:ff:ff:ff:ff:ff

    inet 192.168.1.50/24 brd 192.168.1.255 scope global enp34s0

    valid_lft forever preferred_lft forever

    3: enp38s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    4: enp38s0f1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    7: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff



    So far so good.


    After adding 2 vlans to the bond... you can see they all share the same mac (the one of the bond):


    3: enp38s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    4: enp38s0f1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    7: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    8: bond0.42@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    inet 192.168.42.20/24 brd 192.168.42.255 scope global dynamic bond0.42

    valid_lft 7186sec preferred_lft 7186sec

    9: bond0.44@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    inet 192.168.44.116/24 brd 192.168.44.255 scope global dynamic bond0.44

    valid_lft 43189sec preferred_lft 43189sec


    My dhcp server now correctly complains ("Static lease for MAC address (4A:64:B9:0D:D0:16) already defined!") when I try to define a second IP address in the 2nd network.



    Solution:

    I need a different (virtual) mac in the vlan definition, and netplan (not surprisingly) is supporting that.

    So I defined the entries manually (sorry, copy&paste looses the indention):


    /etc/netplan/50-openmediavault-bond0.42.yaml

    network:

    vlans:

    bond0.42:

    dhcp4: true

    dhcp6: false

    link-local: []

    id: 42

    link: bond0

    macaddress: 4a:64:b9:0d:d0:18


    /etc/netplan/50-openmediavault-bond0.44.yaml

    network:

    vlans:

    bond0.44:

    dhcp4: true

    dhcp6: false

    link-local: []

    id: 44

    link: bond0

    macaddress: 4a:64:b9:0d:d0:1a



    After "netplan apply" and performing a reboot everything looks the way I want and need:


    3: enp38s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    4: enp38s0f1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    5: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:16 brd ff:ff:ff:ff:ff:ff

    6: bond0.44@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:1a brd ff:ff:ff:ff:ff:ff

    inet 192.168.44.120/24 brd 192.168.44.255 scope global dynamic bond0.44

    valid_lft 43187sec preferred_lft 43187sec

    7: bond0.42@bond0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether 4a:64:b9:0d:d0:18 brd ff:ff:ff:ff:ff:ff

    inet 192.168.42.185/24 brd 192.168.42.255 scope global dynamic bond0.42

    valid_lft 7187sec preferred_lft 7187sec



    But this works only as long as the next network configuration is applied by OMV.

    Then the "macaddress" entries are removed from the yamls and after reboot the mac's are gone.

  • Das Urmel You didn't mention it was vlans on a bond in your first post. Now I have the whole picture, a quick google tells me that the netplan bond parameter "fail-over-mac-policy" setting governs this mac-address behaviour. This is not exposed in the webUI.


    It defaults to "none", hence mac-addresses are the same ( See here for example: https://blog.dbi-services.com/…erfaces-on-the-same-host/ or https://forum.proxmox.com/thre…al-server-hardware.70576/ ).


    Setting the policy to active maybe what you want, but bonding individual vlans makes more sense to me.

  • Vlans on bonds using netplan seems to have raised repeated questions at places like askubuntu and serverfault. So is this a problem with netplan or OMV6? I didn't find a clear solution apart from possibly forcing the mac address on the parent NICS, for example, rather than on the bond vlans. But the way OMV6 works neither is possible, or is persistent if the netplan files are edited as you have shown. At least you have a workaround of sorts.


    Bug or feature request? I'd say the later, if the feature had been implemented and didn't work then it would be bug.


    A wider question is why do interface configurations have to be deleted before an interface can be part of a bond when using the webui network configuration any ethernet yaml files deleted?

  • Since netplan works fine with the parameters, I think the problem is within OMV because it doesn't support them.

    The "fix" or enhancement should be straight forward:

    1. add property macaddress to class vlan
    2. enhance UI to display optional field macaddress in vlan definition
    3. verify code to write property to yaml if set

    Btw. I tried the "fail-over-mac-policy" parameter, but with no success.


    Regarding the question: An interface can only be used if you either use it as an "single" interface or you make it part of some bigger interface (like a bond). You can't do both at the same time.


    So, I will try to create an official feature request.

  • In fairness to OMV6, the scenario I could reliably test with bond mode "active-backup" using VMs , works OK. In this case, the fact that bond members, bond and bond vlans all have the same mac address doesn't matter as the two bridges have different mac addresses.



    I bridged the vlan bonds for use with a VM running inside OMV6.


    I can remove a NIC from the OMV6 VM to simulate a hardware failure and the network connections stay up.


    My last question was about how in the webuUI you cannot simply set the IPV4/6 method to disabled on a configured interface that you want to use in a bond. You have to "delete" the interface first before creating a bond via the webUI.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!