From f929b836e803aeb6794d78445e6513db11bc5077 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Wed, 31 May 2023 16:14:33 +0000 Subject: [PATCH] Refactor the things that are common between bird and frr build types -- no-op for the build/ output --- .../vpp0-0/root/lab-build/disable-frr | 7 ++ .../vpp0-1/root/lab-build/disable-frr | 7 ++ .../vpp0-2/root/lab-build/disable-frr | 7 ++ .../vpp0-3/root/lab-build/disable-frr | 7 ++ .../vpp1-0/root/lab-build/disable-frr | 7 ++ .../vpp1-1/root/lab-build/disable-frr | 7 ++ .../vpp1-2/root/lab-build/disable-frr | 7 ++ .../vpp1-3/root/lab-build/disable-frr | 7 ++ .../vpp2-0/root/lab-build/disable-frr | 7 ++ .../vpp2-1/root/lab-build/disable-frr | 7 ++ .../vpp2-2/root/lab-build/disable-frr | 7 ++ .../vpp2-3/root/lab-build/disable-frr | 7 ++ .../{bird => _common}/common/etc/hostname.j2 | 0 .../{bird => _common}/common/etc/hosts.j2 | 0 overlays/{bird => _common}/common/etc/motd | 0 .../common/etc/netns/dataplane/resolv.conf.j2 | 0 .../common/etc/netplan/01-netcfg.yaml.j2 | 0 .../common/etc/resolv.conf.j2 | 0 .../common/home/ipng/.ssh/authorized_keys | 0 .../common/root/.ssh/authorized_keys | 0 .../common/root/lab-build/perms | 0 .../host/root/lab-build/disable-vpp | 0 overlays/_common/ovs-config.sh.j2 | 79 ++++++++++++++++++ overlays/{bird => _common}/tap/etc/rc.local | 0 .../tap/root/lab-build/disable-vpp | 0 .../vpp/etc/vpp/bootstrap.vpp.j2 | 0 .../vpp/etc/vpp/config/defaults.vpp | 0 .../vpp/etc/vpp/config/flowprobe.vpp.j2 | 0 .../vpp/etc/vpp/config/interface.vpp.j2 | 0 .../vpp/etc/vpp/config/lcp.vpp | 0 .../vpp/etc/vpp/config/loopback.vpp.j2 | 0 .../vpp/etc/vpp/config/manual.vpp.j2 | 0 .../vpp/etc/vpp/config/mpls.vpp.j2 | 0 overlays/bird/common | 1 + overlays/bird/host | 1 + overlays/bird/ovs-config.sh.j2 | 80 +------------------ overlays/bird/tap | 1 + overlays/bird/vpp/etc/vpp | 1 + overlays/bird/vpp/root/lab-build/disable-frr | 7 ++ overlays/frr/common | 2 +- overlays/frr/host | 2 +- overlays/frr/ovs-config.sh.j2 | 2 +- overlays/frr/tap | 2 +- overlays/frr/vpp/etc/vpp | 2 +- 44 files changed, 180 insertions(+), 84 deletions(-) create mode 100644 build/bird/hvn0.lab.ipng.ch/vpp0-0/root/lab-build/disable-frr create mode 100644 build/bird/hvn0.lab.ipng.ch/vpp0-1/root/lab-build/disable-frr create mode 100644 build/bird/hvn0.lab.ipng.ch/vpp0-2/root/lab-build/disable-frr create mode 100644 build/bird/hvn0.lab.ipng.ch/vpp0-3/root/lab-build/disable-frr create mode 100644 build/bird/hvn1.lab.ipng.ch/vpp1-0/root/lab-build/disable-frr create mode 100644 build/bird/hvn1.lab.ipng.ch/vpp1-1/root/lab-build/disable-frr create mode 100644 build/bird/hvn1.lab.ipng.ch/vpp1-2/root/lab-build/disable-frr create mode 100644 build/bird/hvn1.lab.ipng.ch/vpp1-3/root/lab-build/disable-frr create mode 100644 build/bird/hvn2.lab.ipng.ch/vpp2-0/root/lab-build/disable-frr create mode 100644 build/bird/hvn2.lab.ipng.ch/vpp2-1/root/lab-build/disable-frr create mode 100644 build/bird/hvn2.lab.ipng.ch/vpp2-2/root/lab-build/disable-frr create mode 100644 build/bird/hvn2.lab.ipng.ch/vpp2-3/root/lab-build/disable-frr rename overlays/{bird => _common}/common/etc/hostname.j2 (100%) rename overlays/{bird => _common}/common/etc/hosts.j2 (100%) rename overlays/{bird => _common}/common/etc/motd (100%) rename overlays/{bird => _common}/common/etc/netns/dataplane/resolv.conf.j2 (100%) rename overlays/{bird => _common}/common/etc/netplan/01-netcfg.yaml.j2 (100%) rename overlays/{bird => _common}/common/etc/resolv.conf.j2 (100%) rename overlays/{bird => _common}/common/home/ipng/.ssh/authorized_keys (100%) rename overlays/{bird => _common}/common/root/.ssh/authorized_keys (100%) rename overlays/{bird => _common}/common/root/lab-build/perms (100%) rename overlays/{bird => _common}/host/root/lab-build/disable-vpp (100%) create mode 100755 overlays/_common/ovs-config.sh.j2 rename overlays/{bird => _common}/tap/etc/rc.local (100%) rename overlays/{bird => _common}/tap/root/lab-build/disable-vpp (100%) rename overlays/{bird => _common}/vpp/etc/vpp/bootstrap.vpp.j2 (100%) rename overlays/{bird => _common}/vpp/etc/vpp/config/defaults.vpp (100%) rename overlays/{bird => _common}/vpp/etc/vpp/config/flowprobe.vpp.j2 (100%) rename overlays/{bird => _common}/vpp/etc/vpp/config/interface.vpp.j2 (100%) rename overlays/{bird => _common}/vpp/etc/vpp/config/lcp.vpp (100%) rename overlays/{bird => _common}/vpp/etc/vpp/config/loopback.vpp.j2 (100%) rename overlays/{bird => _common}/vpp/etc/vpp/config/manual.vpp.j2 (100%) rename overlays/{bird => _common}/vpp/etc/vpp/config/mpls.vpp.j2 (100%) create mode 120000 overlays/bird/common create mode 120000 overlays/bird/host mode change 100755 => 120000 overlays/bird/ovs-config.sh.j2 create mode 120000 overlays/bird/tap create mode 120000 overlays/bird/vpp/etc/vpp create mode 100755 overlays/bird/vpp/root/lab-build/disable-frr diff --git a/build/bird/hvn0.lab.ipng.ch/vpp0-0/root/lab-build/disable-frr b/build/bird/hvn0.lab.ipng.ch/vpp0-0/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn0.lab.ipng.ch/vpp0-0/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn0.lab.ipng.ch/vpp0-1/root/lab-build/disable-frr b/build/bird/hvn0.lab.ipng.ch/vpp0-1/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn0.lab.ipng.ch/vpp0-1/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn0.lab.ipng.ch/vpp0-2/root/lab-build/disable-frr b/build/bird/hvn0.lab.ipng.ch/vpp0-2/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn0.lab.ipng.ch/vpp0-2/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn0.lab.ipng.ch/vpp0-3/root/lab-build/disable-frr b/build/bird/hvn0.lab.ipng.ch/vpp0-3/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn0.lab.ipng.ch/vpp0-3/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn1.lab.ipng.ch/vpp1-0/root/lab-build/disable-frr b/build/bird/hvn1.lab.ipng.ch/vpp1-0/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn1.lab.ipng.ch/vpp1-0/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn1.lab.ipng.ch/vpp1-1/root/lab-build/disable-frr b/build/bird/hvn1.lab.ipng.ch/vpp1-1/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn1.lab.ipng.ch/vpp1-1/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn1.lab.ipng.ch/vpp1-2/root/lab-build/disable-frr b/build/bird/hvn1.lab.ipng.ch/vpp1-2/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn1.lab.ipng.ch/vpp1-2/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn1.lab.ipng.ch/vpp1-3/root/lab-build/disable-frr b/build/bird/hvn1.lab.ipng.ch/vpp1-3/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn1.lab.ipng.ch/vpp1-3/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn2.lab.ipng.ch/vpp2-0/root/lab-build/disable-frr b/build/bird/hvn2.lab.ipng.ch/vpp2-0/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn2.lab.ipng.ch/vpp2-0/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn2.lab.ipng.ch/vpp2-1/root/lab-build/disable-frr b/build/bird/hvn2.lab.ipng.ch/vpp2-1/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn2.lab.ipng.ch/vpp2-1/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn2.lab.ipng.ch/vpp2-2/root/lab-build/disable-frr b/build/bird/hvn2.lab.ipng.ch/vpp2-2/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn2.lab.ipng.ch/vpp2-2/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/build/bird/hvn2.lab.ipng.ch/vpp2-3/root/lab-build/disable-frr b/build/bird/hvn2.lab.ipng.ch/vpp2-3/root/lab-build/disable-frr new file mode 100644 index 0000000..f407e86 --- /dev/null +++ b/build/bird/hvn2.lab.ipng.ch/vpp2-3/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done \ No newline at end of file diff --git a/overlays/bird/common/etc/hostname.j2 b/overlays/_common/common/etc/hostname.j2 similarity index 100% rename from overlays/bird/common/etc/hostname.j2 rename to overlays/_common/common/etc/hostname.j2 diff --git a/overlays/bird/common/etc/hosts.j2 b/overlays/_common/common/etc/hosts.j2 similarity index 100% rename from overlays/bird/common/etc/hosts.j2 rename to overlays/_common/common/etc/hosts.j2 diff --git a/overlays/bird/common/etc/motd b/overlays/_common/common/etc/motd similarity index 100% rename from overlays/bird/common/etc/motd rename to overlays/_common/common/etc/motd diff --git a/overlays/bird/common/etc/netns/dataplane/resolv.conf.j2 b/overlays/_common/common/etc/netns/dataplane/resolv.conf.j2 similarity index 100% rename from overlays/bird/common/etc/netns/dataplane/resolv.conf.j2 rename to overlays/_common/common/etc/netns/dataplane/resolv.conf.j2 diff --git a/overlays/bird/common/etc/netplan/01-netcfg.yaml.j2 b/overlays/_common/common/etc/netplan/01-netcfg.yaml.j2 similarity index 100% rename from overlays/bird/common/etc/netplan/01-netcfg.yaml.j2 rename to overlays/_common/common/etc/netplan/01-netcfg.yaml.j2 diff --git a/overlays/bird/common/etc/resolv.conf.j2 b/overlays/_common/common/etc/resolv.conf.j2 similarity index 100% rename from overlays/bird/common/etc/resolv.conf.j2 rename to overlays/_common/common/etc/resolv.conf.j2 diff --git a/overlays/bird/common/home/ipng/.ssh/authorized_keys b/overlays/_common/common/home/ipng/.ssh/authorized_keys similarity index 100% rename from overlays/bird/common/home/ipng/.ssh/authorized_keys rename to overlays/_common/common/home/ipng/.ssh/authorized_keys diff --git a/overlays/bird/common/root/.ssh/authorized_keys b/overlays/_common/common/root/.ssh/authorized_keys similarity index 100% rename from overlays/bird/common/root/.ssh/authorized_keys rename to overlays/_common/common/root/.ssh/authorized_keys diff --git a/overlays/bird/common/root/lab-build/perms b/overlays/_common/common/root/lab-build/perms similarity index 100% rename from overlays/bird/common/root/lab-build/perms rename to overlays/_common/common/root/lab-build/perms diff --git a/overlays/bird/host/root/lab-build/disable-vpp b/overlays/_common/host/root/lab-build/disable-vpp similarity index 100% rename from overlays/bird/host/root/lab-build/disable-vpp rename to overlays/_common/host/root/lab-build/disable-vpp diff --git a/overlays/_common/ovs-config.sh.j2 b/overlays/_common/ovs-config.sh.j2 new file mode 100755 index 0000000..c68721a --- /dev/null +++ b/overlays/_common/ovs-config.sh.j2 @@ -0,0 +1,79 @@ +#!/bin/bash +# +# OVS configuration for the `{{ overlay }}` overlay + +LAB=${LAB:=0} +BR=vpplan +for p in $(ovs-vsctl list-ifaces $BR); do + ovs-vsctl set port $p vlan_mode=access +done + +# Uplink is VLAN 10 +ovs-vsctl add port vpp${LAB}-0-0 tag 10 +ovs-vsctl add port uplink tag 10 + +# Link vpp${LAB}-0 <-> vpp${LAB}-1 in VLAN 20 +ovs-vsctl add port vpp${LAB}-0-1 tag 20 +ovs-vsctl add port vpp${LAB}-1-0 tag 20 + +# Link vpp${LAB}-1 <-> vpp${LAB}-2 in VLAN 21 +ovs-vsctl add port vpp${LAB}-1-1 tag 21 +ovs-vsctl add port vpp${LAB}-2-0 tag 21 + +# Link vpp${LAB}-2 <-> vpp${LAB}-3 in VLAN 22 +ovs-vsctl add port vpp${LAB}-2-1 tag 22 +ovs-vsctl add port vpp${LAB}-3-0 tag 22 + +## Wire host${LAB}-0-[0123] to e2 of all VPP machines +ovs-vsctl set port vpp${LAB}-0-2 tag=30 +ovs-vsctl set port host${LAB}-0-0 tag=30 +ovs-vsctl set port vpp${LAB}-1-2 tag=31 +ovs-vsctl set port host${LAB}-0-1 tag=31 +ovs-vsctl set port vpp${LAB}-2-2 tag=32 +ovs-vsctl set port host${LAB}-0-2 tag=32 +ovs-vsctl set port vpp${LAB}-3-2 tag=33 +ovs-vsctl set port host${LAB}-0-3 tag=33 + +## Wire host${LAB}-1-[0123] to e3 of all VPP machines +ovs-vsctl set port vpp${LAB}-0-3 tag=40 +ovs-vsctl set port host${LAB}-1-0 tag=40 +ovs-vsctl set port vpp${LAB}-1-3 tag=41 +ovs-vsctl set port host${LAB}-1-1 tag=41 +ovs-vsctl set port vpp${LAB}-2-3 tag=42 +ovs-vsctl set port host${LAB}-1-2 tag=42 +ovs-vsctl set port vpp${LAB}-3-3 tag=43 +ovs-vsctl set port host${LAB}-1-3 tag=43 + +## Wire tap${LAB}-0-0 as 'rx' tap +MIRROR=mirror-rx +ovs-vsctl set port tap${LAB}-0-0 vlan_mode=native-tagged +[ ovs-vsctl list mirror $MIRROR >/dev/null 2>&1 ] || \ + ovs-vsctl -- --id=@m get mirror $MIRROR -- remove bridge $BR mirrors @m +ovs-vsctl --id=@m create mirror name=$MIRROR \ + -- --id=@p get port tap${LAB}-0-0 \ + -- add bridge $BR mirrors @m \ + -- set mirror $MIRROR output-port=@p \ + -- set mirror $MIRROR select_dst_port=[] \ + -- set mirror $MIRROR select_src_port=[] +for iface in $(ovs-vsctl list-ports $BR); do + [[ $iface == tap* ]] && continue + [[ $iface == uplink ]] && continue + ovs-vsctl add mirror $MIRROR select_dst_port $(ovs-vsctl get port $iface _uuid) +done + +## Wire tap${LAB}-0-1 as 'tx' tap +MIRROR=mirror-tx +ovs-vsctl set port tap${LAB}-0-1 vlan_mode=native-tagged +[ ovs-vsctl list mirror $MIRROR >/dev/null 2>&1 ] || \ + ovs-vsctl -- --id=@m get mirror $MIRROR -- remove bridge $BR mirrors @m +ovs-vsctl --id=@m create mirror name=$MIRROR \ + -- --id=@p get port tap${LAB}-0-1 \ + -- add bridge $BR mirrors @m \ + -- set mirror $MIRROR output-port=@p \ + -- set mirror $MIRROR select_dst_port=[] \ + -- set mirror $MIRROR select_src_port=[] +for iface in $(ovs-vsctl list-ports $BR); do + [[ $iface == tap* ]] && continue + [[ $iface == uplink ]] && continue + ovs-vsctl add mirror $MIRROR select_src_port $(ovs-vsctl get port $iface _uuid) +done diff --git a/overlays/bird/tap/etc/rc.local b/overlays/_common/tap/etc/rc.local similarity index 100% rename from overlays/bird/tap/etc/rc.local rename to overlays/_common/tap/etc/rc.local diff --git a/overlays/bird/tap/root/lab-build/disable-vpp b/overlays/_common/tap/root/lab-build/disable-vpp similarity index 100% rename from overlays/bird/tap/root/lab-build/disable-vpp rename to overlays/_common/tap/root/lab-build/disable-vpp diff --git a/overlays/bird/vpp/etc/vpp/bootstrap.vpp.j2 b/overlays/_common/vpp/etc/vpp/bootstrap.vpp.j2 similarity index 100% rename from overlays/bird/vpp/etc/vpp/bootstrap.vpp.j2 rename to overlays/_common/vpp/etc/vpp/bootstrap.vpp.j2 diff --git a/overlays/bird/vpp/etc/vpp/config/defaults.vpp b/overlays/_common/vpp/etc/vpp/config/defaults.vpp similarity index 100% rename from overlays/bird/vpp/etc/vpp/config/defaults.vpp rename to overlays/_common/vpp/etc/vpp/config/defaults.vpp diff --git a/overlays/bird/vpp/etc/vpp/config/flowprobe.vpp.j2 b/overlays/_common/vpp/etc/vpp/config/flowprobe.vpp.j2 similarity index 100% rename from overlays/bird/vpp/etc/vpp/config/flowprobe.vpp.j2 rename to overlays/_common/vpp/etc/vpp/config/flowprobe.vpp.j2 diff --git a/overlays/bird/vpp/etc/vpp/config/interface.vpp.j2 b/overlays/_common/vpp/etc/vpp/config/interface.vpp.j2 similarity index 100% rename from overlays/bird/vpp/etc/vpp/config/interface.vpp.j2 rename to overlays/_common/vpp/etc/vpp/config/interface.vpp.j2 diff --git a/overlays/bird/vpp/etc/vpp/config/lcp.vpp b/overlays/_common/vpp/etc/vpp/config/lcp.vpp similarity index 100% rename from overlays/bird/vpp/etc/vpp/config/lcp.vpp rename to overlays/_common/vpp/etc/vpp/config/lcp.vpp diff --git a/overlays/bird/vpp/etc/vpp/config/loopback.vpp.j2 b/overlays/_common/vpp/etc/vpp/config/loopback.vpp.j2 similarity index 100% rename from overlays/bird/vpp/etc/vpp/config/loopback.vpp.j2 rename to overlays/_common/vpp/etc/vpp/config/loopback.vpp.j2 diff --git a/overlays/bird/vpp/etc/vpp/config/manual.vpp.j2 b/overlays/_common/vpp/etc/vpp/config/manual.vpp.j2 similarity index 100% rename from overlays/bird/vpp/etc/vpp/config/manual.vpp.j2 rename to overlays/_common/vpp/etc/vpp/config/manual.vpp.j2 diff --git a/overlays/bird/vpp/etc/vpp/config/mpls.vpp.j2 b/overlays/_common/vpp/etc/vpp/config/mpls.vpp.j2 similarity index 100% rename from overlays/bird/vpp/etc/vpp/config/mpls.vpp.j2 rename to overlays/_common/vpp/etc/vpp/config/mpls.vpp.j2 diff --git a/overlays/bird/common b/overlays/bird/common new file mode 120000 index 0000000..dde70ec --- /dev/null +++ b/overlays/bird/common @@ -0,0 +1 @@ +../_common/common/ \ No newline at end of file diff --git a/overlays/bird/host b/overlays/bird/host new file mode 120000 index 0000000..5a1f2cc --- /dev/null +++ b/overlays/bird/host @@ -0,0 +1 @@ +../_common/host \ No newline at end of file diff --git a/overlays/bird/ovs-config.sh.j2 b/overlays/bird/ovs-config.sh.j2 deleted file mode 100755 index c68721a..0000000 --- a/overlays/bird/ovs-config.sh.j2 +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# -# OVS configuration for the `{{ overlay }}` overlay - -LAB=${LAB:=0} -BR=vpplan -for p in $(ovs-vsctl list-ifaces $BR); do - ovs-vsctl set port $p vlan_mode=access -done - -# Uplink is VLAN 10 -ovs-vsctl add port vpp${LAB}-0-0 tag 10 -ovs-vsctl add port uplink tag 10 - -# Link vpp${LAB}-0 <-> vpp${LAB}-1 in VLAN 20 -ovs-vsctl add port vpp${LAB}-0-1 tag 20 -ovs-vsctl add port vpp${LAB}-1-0 tag 20 - -# Link vpp${LAB}-1 <-> vpp${LAB}-2 in VLAN 21 -ovs-vsctl add port vpp${LAB}-1-1 tag 21 -ovs-vsctl add port vpp${LAB}-2-0 tag 21 - -# Link vpp${LAB}-2 <-> vpp${LAB}-3 in VLAN 22 -ovs-vsctl add port vpp${LAB}-2-1 tag 22 -ovs-vsctl add port vpp${LAB}-3-0 tag 22 - -## Wire host${LAB}-0-[0123] to e2 of all VPP machines -ovs-vsctl set port vpp${LAB}-0-2 tag=30 -ovs-vsctl set port host${LAB}-0-0 tag=30 -ovs-vsctl set port vpp${LAB}-1-2 tag=31 -ovs-vsctl set port host${LAB}-0-1 tag=31 -ovs-vsctl set port vpp${LAB}-2-2 tag=32 -ovs-vsctl set port host${LAB}-0-2 tag=32 -ovs-vsctl set port vpp${LAB}-3-2 tag=33 -ovs-vsctl set port host${LAB}-0-3 tag=33 - -## Wire host${LAB}-1-[0123] to e3 of all VPP machines -ovs-vsctl set port vpp${LAB}-0-3 tag=40 -ovs-vsctl set port host${LAB}-1-0 tag=40 -ovs-vsctl set port vpp${LAB}-1-3 tag=41 -ovs-vsctl set port host${LAB}-1-1 tag=41 -ovs-vsctl set port vpp${LAB}-2-3 tag=42 -ovs-vsctl set port host${LAB}-1-2 tag=42 -ovs-vsctl set port vpp${LAB}-3-3 tag=43 -ovs-vsctl set port host${LAB}-1-3 tag=43 - -## Wire tap${LAB}-0-0 as 'rx' tap -MIRROR=mirror-rx -ovs-vsctl set port tap${LAB}-0-0 vlan_mode=native-tagged -[ ovs-vsctl list mirror $MIRROR >/dev/null 2>&1 ] || \ - ovs-vsctl -- --id=@m get mirror $MIRROR -- remove bridge $BR mirrors @m -ovs-vsctl --id=@m create mirror name=$MIRROR \ - -- --id=@p get port tap${LAB}-0-0 \ - -- add bridge $BR mirrors @m \ - -- set mirror $MIRROR output-port=@p \ - -- set mirror $MIRROR select_dst_port=[] \ - -- set mirror $MIRROR select_src_port=[] -for iface in $(ovs-vsctl list-ports $BR); do - [[ $iface == tap* ]] && continue - [[ $iface == uplink ]] && continue - ovs-vsctl add mirror $MIRROR select_dst_port $(ovs-vsctl get port $iface _uuid) -done - -## Wire tap${LAB}-0-1 as 'tx' tap -MIRROR=mirror-tx -ovs-vsctl set port tap${LAB}-0-1 vlan_mode=native-tagged -[ ovs-vsctl list mirror $MIRROR >/dev/null 2>&1 ] || \ - ovs-vsctl -- --id=@m get mirror $MIRROR -- remove bridge $BR mirrors @m -ovs-vsctl --id=@m create mirror name=$MIRROR \ - -- --id=@p get port tap${LAB}-0-1 \ - -- add bridge $BR mirrors @m \ - -- set mirror $MIRROR output-port=@p \ - -- set mirror $MIRROR select_dst_port=[] \ - -- set mirror $MIRROR select_src_port=[] -for iface in $(ovs-vsctl list-ports $BR); do - [[ $iface == tap* ]] && continue - [[ $iface == uplink ]] && continue - ovs-vsctl add mirror $MIRROR select_src_port $(ovs-vsctl get port $iface _uuid) -done diff --git a/overlays/bird/ovs-config.sh.j2 b/overlays/bird/ovs-config.sh.j2 new file mode 120000 index 0000000..c51ee83 --- /dev/null +++ b/overlays/bird/ovs-config.sh.j2 @@ -0,0 +1 @@ +../_common/ovs-config.sh.j2 \ No newline at end of file diff --git a/overlays/bird/tap b/overlays/bird/tap new file mode 120000 index 0000000..64370ed --- /dev/null +++ b/overlays/bird/tap @@ -0,0 +1 @@ +../_common/tap \ No newline at end of file diff --git a/overlays/bird/vpp/etc/vpp b/overlays/bird/vpp/etc/vpp new file mode 120000 index 0000000..bf0c075 --- /dev/null +++ b/overlays/bird/vpp/etc/vpp @@ -0,0 +1 @@ +../../../_common/vpp/etc/vpp/ \ No newline at end of file diff --git a/overlays/bird/vpp/root/lab-build/disable-frr b/overlays/bird/vpp/root/lab-build/disable-frr new file mode 100755 index 0000000..9588c23 --- /dev/null +++ b/overlays/bird/vpp/root/lab-build/disable-frr @@ -0,0 +1,7 @@ +#!/bin/sh + +echo " * Disabling FRR" +for i in frr; do + rm -f /etc/systemd/system/multi-user.target.wants/${i}.service + ln -sf /dev/null /etc/systemd/system/${i}.service +done diff --git a/overlays/frr/common b/overlays/frr/common index f278301..dde70ec 120000 --- a/overlays/frr/common +++ b/overlays/frr/common @@ -1 +1 @@ -../bird/common/ \ No newline at end of file +../_common/common/ \ No newline at end of file diff --git a/overlays/frr/host b/overlays/frr/host index 11c8eb2..2f8b16e 120000 --- a/overlays/frr/host +++ b/overlays/frr/host @@ -1 +1 @@ -../bird/host/ \ No newline at end of file +../_common/host/ \ No newline at end of file diff --git a/overlays/frr/ovs-config.sh.j2 b/overlays/frr/ovs-config.sh.j2 index fad196a..c51ee83 120000 --- a/overlays/frr/ovs-config.sh.j2 +++ b/overlays/frr/ovs-config.sh.j2 @@ -1 +1 @@ -../bird/ovs-config.sh.j2 \ No newline at end of file +../_common/ovs-config.sh.j2 \ No newline at end of file diff --git a/overlays/frr/tap b/overlays/frr/tap index 62e1c8c..3753f1d 120000 --- a/overlays/frr/tap +++ b/overlays/frr/tap @@ -1 +1 @@ -../bird/tap/ \ No newline at end of file +../_common/tap/ \ No newline at end of file diff --git a/overlays/frr/vpp/etc/vpp b/overlays/frr/vpp/etc/vpp index e8b46b5..bf0c075 120000 --- a/overlays/frr/vpp/etc/vpp +++ b/overlays/frr/vpp/etc/vpp @@ -1 +1 @@ -../../../bird/vpp/etc/vpp/ \ No newline at end of file +../../../_common/vpp/etc/vpp/ \ No newline at end of file