# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*.intf

auto lo
iface lo inet loopback
    address 27.0.0.11/32
    address 2001:c15c:d06:f00d::b/128
    clagd-vxlan-anycast-ip 36.0.0.11
    vxlan-local-tunnelip 27.0.0.11

auto mgmt
iface mgmt
    address 127.0.0.1/8
    address ::1/128
    vrf-table auto

auto vrf1
iface vrf1
    address 127.0.0.1/8
    address ::1/128
    vrf-table auto

auto vrf2
iface vrf2
    address 127.0.0.1/8
    address ::1/128
    vrf-table auto

auto vrf3
iface vrf3
    address 127.0.0.1/8
    address ::1/128
    vrf-table auto

auto eth0
iface eth0
    address 192.168.0.15/24
    gateway 192.168.0.2
    ip-forward off
    ip6-forward off
    vrf mgmt

auto swp1
iface swp1
    link-speed 10000
    link-autoneg off

auto swp2
iface swp2
    link-speed 10000
    link-autoneg off

auto swp3
iface swp3
    link-speed 10000
    link-autoneg off

auto swp4
iface swp4
    link-speed 10000
    link-autoneg off

auto swp5
iface swp5
    link-speed 10000
    link-autoneg off

auto swp6
iface swp6
    link-speed 10000
    link-autoneg off

auto swp7
iface swp7
    link-speed 10000
    link-autoneg off

auto swp8
iface swp8
    link-speed 10000
    link-autoneg off

auto swp8.3000
iface swp8.3000
    vrf vrf2

auto swp8.4000
iface swp8.4000
    vrf vrf1

auto uplink1
iface uplink1
    mtu 9202
    bond-slaves swp1 swp2
    bond-mode 802.3ad
    bond-lacp-bypass-allow no

auto uplink2
iface uplink2
    mtu 9202
    bond-slaves swp3 swp4
    bond-mode 802.3ad
    bond-lacp-bypass-allow no

auto peerlink
iface peerlink
    mtu 9202
    bond-slaves swp5 swp6
    bond-mode 802.3ad
    bond-lacp-bypass-allow no

auto peerlink.4094
iface peerlink.4094
    address 169.254.0.9/30
    mtu 9202
    clagd-peer-ip 169.254.0.10
    clagd-priority 4096
    clagd-backup-ip 27.0.0.12
    clagd-sys-mac 44:38:39:ff:ff:01
    clagd-args --initDelay 30
    clagd-debug off

auto vlan1000
iface vlan1000
    address 45.0.0.4/24
    address 2001:fee1::4/64
    address-virtual 00:00:5e:00:01:01 45.0.0.1/24 2001:fee1::1/64
    vrf vrf1
    vlan-raw-device br_default
    vlan-id 1000

auto vlan1002
iface vlan1002
    address 45.0.2.4/24
    address 2001:fee1:0:2::4/64
    address-virtual 00:00:5e:00:01:01 45.0.2.1/24 2001:fee1:0:2::1/64
    vrf vrf1
    vlan-raw-device br_default
    vlan-id 1002

auto vlan1004
iface vlan1004
    address 45.0.4.4/24
    address 2001:fee1:0:4::4/64
    address-virtual 00:00:5e:00:01:01 45.0.4.1/24 2001:fee1:0:4::1/64
    vrf vrf2
    vlan-raw-device br_default
    vlan-id 1004

auto vlan1006
iface vlan1006
    address 45.0.6.4/24
    address 2001:fee1:0:6::4/64
    address-virtual 00:00:5e:00:01:01 45.0.6.1/24 2001:fee1:0:6::1/64
    vrf vrf2
    vlan-raw-device br_default
    vlan-id 1006

auto vlan1008
iface vlan1008
    address 45.0.8.4/24
    address 2001:fee1:0:8::4/64
    address-virtual 00:00:5e:00:01:01 45.0.8.1/24 2001:fee1:0:8::1/64
    vrf vrf3
    vlan-raw-device br_default
    vlan-id 1008

auto hostbond4
iface hostbond4
    mtu 9152
    bond-slaves swp7
    bond-mode 802.3ad
    bond-lacp-bypass-allow no
    clag-id 1
    bridge-pvid 1000

auto hostbond5
iface hostbond5
    mtu 9152
    bond-slaves swp8
    bond-mode 802.3ad
    bond-lacp-bypass-allow no
    clag-id 2
    bridge-pvid 1002

auto vni1000
iface vni1000
    bridge-access 1000
    bridge-learning off
    vxlan-id 1000

auto vni1002
iface vni1002
    bridge-access 1002
    bridge-learning off
    vxlan-id 1002

auto vni1004
iface vni1004
    bridge-access 1004
    bridge-learning off
    vxlan-id 1004

auto vni1006
iface vni1006
    bridge-access 1006
    bridge-learning off
    vxlan-id 1006

auto vni1008
iface vni1008
    bridge-access 1008
    bridge-learning off
    vxlan-id 1008

auto vni4001
iface vni4001
    bridge-access 4058
    bridge-learning off
    vxlan-id 4001

auto vlan4058_l3
iface vlan4058_l3
    vrf vrf1
    vlan-raw-device br_default
    address-virtual 44:38:39:ff:ff:01
    vlan-id 4058

auto vni4002
iface vni4002
    bridge-access 4059
    bridge-learning off
    vxlan-id 4002

auto vlan4059_l3
iface vlan4059_l3
    vrf vrf2
    vlan-raw-device br_default
    address-virtual 44:38:39:ff:ff:01
    vlan-id 4059

auto vni4003
iface vni4003
    bridge-access 4060
    bridge-learning off
    vxlan-id 4003

auto vlan4060_l3
iface vlan4060_l3
    vrf vrf3
    vlan-raw-device br_default
    address-virtual 44:38:39:ff:ff:01
    vlan-id 4060

auto br_default
iface br_default
    bridge-ports peerlink hostbond4 hostbond5 vni1000 vni1002 vni1004 vni1006 vni1008 vni4001 vni4002 vni4003
    bridge-vlan-aware yes
    bridge-vids 1000 1002 1004 1006 1008
    bridge-pvid 1
    bridge-stp yes
    bridge-mcsnoop no
