VxLAN with static BUM

Hint

For details on VxLAN on Linux see also this nice blog post Unicast with static flooding by Vincent Bernat.

This example configures a bridge with a VxLAN link attached. Static FDB entries are configured for BUM traffic:

  • configure eth0 with an IP address used for the VTEP
  • create a bridge interface br0 and configure the IP address 192.0.2.1
  • create a VxLAN tunnel vxlan100
  • add vxlan100 to the bridge br0
  • add some static FDB entries on vxlan100 for static flooding
  • set all interface link states to up
interfaces:
  eth0:
    addresses:
    - 198.51.100.1/24
    link:
      state: up
      kind: physical
  br0:
    addresses:
      - 192.0.2.1/24
    link:
      kind: bridge
      state: up
  vxlan100:
    link:
      kind: vxlan
      vxlan_id: 100
      vxlan_port: 4789
      vxlan_local: 198.51.100.1
      master: br0
      state: up
    fdb:
      - lladdr: 00:00:00:00:00:00
        dst: 198.51.100.2
        port: 4789
      - lladdr: 00:00:00:00:00:00
        dst: 198.51.100.3
        port: 4789
{
  networking.ifstate = {
    enable = true;
    settings = {
      interfaces = {
        eth0 = {
          addresses = [ "198.51.100.1/24" ];
          link = {
            state = "up";
            kind = "physical";
          };
        };
        br0 = {
          addresses = [ "192.0.2.1/24" ];
          link = {
            kind = "bridge";
            state = "up";
          };
        };
        vxlan100 = {
          link = {
            kind = "vxlan";
            vxlan_id = 100;
            vxlan_port = 4789;
            vxlan_local = "198.51.100.1";
            master = "br0";
            state = "up";
          };
          fdb = [
            {
              lladdr = "00:00:00:00:00:00";
              dst = "198.51.100.2";
              port = 4789;
            }
            {
              lladdr = "00:00:00:00:00:00";
              dst = "198.51.100.3";
              port = 4789;
            }
          ];
        };
      };
    };
  };
}
# configure eth0
ip address add 198.51.100.2/31 dev eth0
ip link set dev eth0 up

# configure br0
ip link add name br0 type bridge
ip link set dev br0 up
ip address add 192.0.2.1/24 dev br0

# configure vxlan100
ip link add vxlan100 type vxlan id 100 local 198.51.100.2 dstport 4789
ip link set dev vxlan100 master br0
ip link set dev vxlan100 up

# add static flooding entries to FDB
bridge fdb append 00:00:00:00:00:00 dev vxlan100 dst 198.51.100.2 port 4789
bridge fdb append 00:00:00:00:00:00 dev vxlan100 dst 198.51.100.3 port 4789