From 5b585f1fc347476b1b553a62cb32a367e46146d2 Mon Sep 17 00:00:00 2001 From: Maen Artimy Date: Tue, 26 Apr 2022 15:31:16 +0000 Subject: [PATCH] adding files --- LICENSE | 21 +++++++++++++++++++ config/r1/daemons | 35 +++++++++++++++++++++++++++++++ config/r1/frr.conf | 36 ++++++++++++++++++++++++++++++++ config/r2/daemons | 35 +++++++++++++++++++++++++++++++ config/r2/frr.conf | 44 +++++++++++++++++++++++++++++++++++++++ config/r3/daemons | 35 +++++++++++++++++++++++++++++++ config/r3/frr.conf | 36 ++++++++++++++++++++++++++++++++ setup-vxlan.sh | 15 +++++++++++++ vxlan-frr-simple.clab.yml | 36 ++++++++++++++++++++++++++++++++ 9 files changed, 293 insertions(+) create mode 100644 LICENSE create mode 100644 config/r1/daemons create mode 100644 config/r1/frr.conf create mode 100644 config/r2/daemons create mode 100644 config/r2/frr.conf create mode 100644 config/r3/daemons create mode 100644 config/r3/frr.conf create mode 100755 setup-vxlan.sh create mode 100644 vxlan-frr-simple.clab.yml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..077ae34 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Maen Artimy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/config/r1/daemons b/config/r1/daemons new file mode 100644 index 0000000..c2845c9 --- /dev/null +++ b/config/r1/daemons @@ -0,0 +1,35 @@ +bgpd=yes +ospfd=yes +ospf6d=no +ripd=no +ripngd=no +isisd=no +pimd=no +ldpd=yes +nhrpd=no +eigrpd=no +babeld=no +sharpd=no +staticd=no +pbrd=no +bfdd=no +fabricd=no + +vtysh_enable=yes +zebra_options=" -s 90000000 --daemon -A 127.0.0.1" +bgpd_options=" --daemon -A 127.0.0.1" +ospfd_options=" --daemon -A 127.0.0.1" +ospf6d_options=" --daemon -A ::1" +ripd_options=" --daemon -A 127.0.0.1" +ripngd_options=" --daemon -A ::1" +isisd_options=" --daemon -A 127.0.0.1" +pimd_options=" --daemon -A 127.0.0.1" +ldpd_options=" --daemon -A 127.0.0.1" +nhrpd_options=" --daemon -A 127.0.0.1" +eigrpd_options=" --daemon -A 127.0.0.1" +babeld_options=" --daemon -A 127.0.0.1" +sharpd_options=" --daemon -A 127.0.0.1" +staticd_options=" --daemon -A 127.0.0.1" +pbrd_options=" --daemon -A 127.0.0.1" +bfdd_options=" --daemon -A 127.0.0.1" +fabricd_options=" --daemon -A 127.0.0.1" diff --git a/config/r1/frr.conf b/config/r1/frr.conf new file mode 100644 index 0000000..e26c720 --- /dev/null +++ b/config/r1/frr.conf @@ -0,0 +1,36 @@ +% Can't open configuration file /etc/frr/vtysh.conf due to 'No such file or directory'. +Building configuration... + +Current configuration: +! +frr version 8.1_git +frr defaults traditional +hostname r1 +no ipv6 forwarding +! +interface eth1 + ip address 10.0.0.1/24 + ip ospf area 0 +exit +! +interface lo + ip address 1.1.1.1/32 +exit +! +router bgp 100 + bgp router-id 1.1.1.1 + neighbor 2.2.2.2 remote-as 100 + neighbor 2.2.2.2 update-source lo + ! + address-family l2vpn evpn + neighbor 2.2.2.2 activate + advertise-all-vni + exit-address-family +exit +! +router ospf + ospf router-id 1.1.1.1 + redistribute connected +exit +! +end diff --git a/config/r2/daemons b/config/r2/daemons new file mode 100644 index 0000000..c2845c9 --- /dev/null +++ b/config/r2/daemons @@ -0,0 +1,35 @@ +bgpd=yes +ospfd=yes +ospf6d=no +ripd=no +ripngd=no +isisd=no +pimd=no +ldpd=yes +nhrpd=no +eigrpd=no +babeld=no +sharpd=no +staticd=no +pbrd=no +bfdd=no +fabricd=no + +vtysh_enable=yes +zebra_options=" -s 90000000 --daemon -A 127.0.0.1" +bgpd_options=" --daemon -A 127.0.0.1" +ospfd_options=" --daemon -A 127.0.0.1" +ospf6d_options=" --daemon -A ::1" +ripd_options=" --daemon -A 127.0.0.1" +ripngd_options=" --daemon -A ::1" +isisd_options=" --daemon -A 127.0.0.1" +pimd_options=" --daemon -A 127.0.0.1" +ldpd_options=" --daemon -A 127.0.0.1" +nhrpd_options=" --daemon -A 127.0.0.1" +eigrpd_options=" --daemon -A 127.0.0.1" +babeld_options=" --daemon -A 127.0.0.1" +sharpd_options=" --daemon -A 127.0.0.1" +staticd_options=" --daemon -A 127.0.0.1" +pbrd_options=" --daemon -A 127.0.0.1" +bfdd_options=" --daemon -A 127.0.0.1" +fabricd_options=" --daemon -A 127.0.0.1" diff --git a/config/r2/frr.conf b/config/r2/frr.conf new file mode 100644 index 0000000..5965bac --- /dev/null +++ b/config/r2/frr.conf @@ -0,0 +1,44 @@ +% Can't open configuration file /etc/frr/vtysh.conf due to 'No such file or directory'. +Building configuration... + +Current configuration: +! +frr version 8.1_git +frr defaults traditional +hostname r2 +no ipv6 forwarding +! +interface eth1 + ip address 10.0.1.2/24 + ip ospf area 0 +exit +! +interface eth2 + ip address 10.0.0.2/24 + ip ospf area 0 +exit +! +interface lo + ip address 2.2.2.2/32 +exit +! +router bgp 100 + bgp router-id 2.2.2.2 + neighbor ibgp peer-group + neighbor ibgp remote-as 100 + neighbor ibgp update-source lo + neighbor 1.1.1.1 peer-group ibgp + neighbor 3.3.3.3 peer-group ibgp + ! + address-family l2vpn evpn + neighbor ibgp activate + neighbor ibgp route-reflector-client + exit-address-family +exit +! +router ospf + ospf router-id 2.2.2.2 + redistribute connected +exit +! +end diff --git a/config/r3/daemons b/config/r3/daemons new file mode 100644 index 0000000..c2845c9 --- /dev/null +++ b/config/r3/daemons @@ -0,0 +1,35 @@ +bgpd=yes +ospfd=yes +ospf6d=no +ripd=no +ripngd=no +isisd=no +pimd=no +ldpd=yes +nhrpd=no +eigrpd=no +babeld=no +sharpd=no +staticd=no +pbrd=no +bfdd=no +fabricd=no + +vtysh_enable=yes +zebra_options=" -s 90000000 --daemon -A 127.0.0.1" +bgpd_options=" --daemon -A 127.0.0.1" +ospfd_options=" --daemon -A 127.0.0.1" +ospf6d_options=" --daemon -A ::1" +ripd_options=" --daemon -A 127.0.0.1" +ripngd_options=" --daemon -A ::1" +isisd_options=" --daemon -A 127.0.0.1" +pimd_options=" --daemon -A 127.0.0.1" +ldpd_options=" --daemon -A 127.0.0.1" +nhrpd_options=" --daemon -A 127.0.0.1" +eigrpd_options=" --daemon -A 127.0.0.1" +babeld_options=" --daemon -A 127.0.0.1" +sharpd_options=" --daemon -A 127.0.0.1" +staticd_options=" --daemon -A 127.0.0.1" +pbrd_options=" --daemon -A 127.0.0.1" +bfdd_options=" --daemon -A 127.0.0.1" +fabricd_options=" --daemon -A 127.0.0.1" diff --git a/config/r3/frr.conf b/config/r3/frr.conf new file mode 100644 index 0000000..0439b5f --- /dev/null +++ b/config/r3/frr.conf @@ -0,0 +1,36 @@ +% Can't open configuration file /etc/frr/vtysh.conf due to 'No such file or directory'. +Building configuration... + +Current configuration: +! +frr version 8.1_git +frr defaults traditional +hostname r3 +no ipv6 forwarding +! +interface eth2 + ip address 10.0.1.3/24 + ip ospf area 0 +exit +! +interface lo + ip address 3.3.3.3/32 +exit +! +router bgp 100 + bgp router-id 3.3.3.3 + neighbor 2.2.2.2 remote-as 100 + neighbor 2.2.2.2 update-source lo + ! + address-family l2vpn evpn + neighbor 2.2.2.2 activate + advertise-all-vni + exit-address-family +exit +! +router ospf + ospf router-id 3.3.3.3 + redistribute connected +exit +! +end diff --git a/setup-vxlan.sh b/setup-vxlan.sh new file mode 100755 index 0000000..36013bc --- /dev/null +++ b/setup-vxlan.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +docker exec -it clab-vxlan_frr_simple-r1 ip link add br0 type bridge +docker exec -it clab-vxlan_frr_simple-r1 ip link set dev br0 up +docker exec -it clab-vxlan_frr_simple-r1 ip link add vxlan10 type vxlan id 10 dstport 4789 +docker exec -it clab-vxlan_frr_simple-r1 ip link set dev vxlan10 up +docker exec -it clab-vxlan_frr_simple-r1 ip link set vxlan10 master br0 +docker exec -it clab-vxlan_frr_simple-r1 ip link set eth2 master br0 + +docker exec -it clab-vxlan_frr_simple-r3 ip link add br0 type bridge +docker exec -it clab-vxlan_frr_simple-r3 ip link set dev br0 up +docker exec -it clab-vxlan_frr_simple-r3 ip link add vxlan10 type vxlan id 10 dstport 4789 +docker exec -it clab-vxlan_frr_simple-r3 ip link set dev vxlan10 up +docker exec -it clab-vxlan_frr_simple-r3 ip link set vxlan10 master br0 +docker exec -it clab-vxlan_frr_simple-r3 ip link set eth1 master br0 diff --git a/vxlan-frr-simple.clab.yml b/vxlan-frr-simple.clab.yml new file mode 100644 index 0000000..4a03e49 --- /dev/null +++ b/vxlan-frr-simple.clab.yml @@ -0,0 +1,36 @@ +name: vxlan_frr_simple + +topology: + defaults: + kind: linux + # Choose one of the following two images for the hosts + # depending on which tools you need + image: wbitt/network-multitool:alpine-minimal + #image: wbitt/network-multitool:alpine-extra + nodes: + r1: + image: frrouting/frr + binds: + - config/r1/daemons:/etc/frr/daemons + - config/r1/frr.conf:/etc/frr/frr.conf + r2: + image: frrouting/frr + binds: + - config/r2/daemons:/etc/frr/daemons + - config/r2/frr.conf:/etc/frr/frr.conf + r3: + image: frrouting/frr + binds: + - config/r3/daemons:/etc/frr/daemons + - config/r3/frr.conf:/etc/frr/frr.conf + host4: + exec: + - ip addr add 192.168.1.4/24 dev eth1 + host5: + exec: + - ip addr add 192.168.1.5/24 dev eth1 + links: + - endpoints: ["r1:eth1", "r2:eth2"] + - endpoints: ["r2:eth1", "r3:eth2"] + - endpoints: ["host4:eth1", "r1:eth2"] + - endpoints: ["host5:eth1", "r3:eth1"]