diff --git a/vrrp/frr/daemons b/vrrp/frr/daemons new file mode 100644 index 0000000..d852303 --- /dev/null +++ b/vrrp/frr/daemons @@ -0,0 +1,37 @@ +zebra=yes +bgpd=no +ospfd=no +vrrpd=yes +ospf6d=no +ripd=no +ripngd=no +isisd=no +pimd=no +ldpd=no +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/vrrp/frr/frr-setup.sh b/vrrp/frr/frr-setup.sh new file mode 100755 index 0000000..82d14c9 --- /dev/null +++ b/vrrp/frr/frr-setup.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +if command -v /usr/lib/frr/zebra; then + ip link add vrrp4-51 link eth-br1 type macvlan mode bridge + ip link set dev vrrp4-51 address 00:00:5e:00:01:33 + ip addr add 10.0.1.5/24 dev vrrp4-51 + ip link set dev vrrp4-51 up +fi diff --git a/vrrp/frr/rt-1.conf b/vrrp/frr/rt-1.conf new file mode 100644 index 0000000..422ffbe --- /dev/null +++ b/vrrp/frr/rt-1.conf @@ -0,0 +1,11 @@ +hostname rt-1 +! +interface eth-br1 + vrrp 51 version 2 + vrrp 51 priority 10 + vrrp 51 advertisement-interval 1000 + vrrp 51 ip 10.0.1.5 + ! +! +line vty +! diff --git a/vrrp/frr/rt-2.conf b/vrrp/frr/rt-2.conf new file mode 100644 index 0000000..a72f889 --- /dev/null +++ b/vrrp/frr/rt-2.conf @@ -0,0 +1,11 @@ +hostname rt-2 +! +interface eth-br1 + vrrp 51 version 2 + vrrp 51 priority 20 + vrrp 51 advertisement-interval 1000 + vrrp 51 ip 10.0.1.5 + ! +! +line vty +! diff --git a/vrrp/holo/rt-1.conf b/vrrp/holo/rt-1.conf new file mode 100644 index 0000000..8dff64c --- /dev/null +++ b/vrrp/holo/rt-1.conf @@ -0,0 +1,10 @@ +! +interfaces interface eth-br1 + type iana-if-type:ethernetCsmacd + ipv4 + ! + ipv4 vrrp vrrp-instance 51 + priority 10 + ! + virtual-ipv4-addresses virtual-ipv4-address 10.0.1.5 +! diff --git a/vrrp/holo/rt-2.conf b/vrrp/holo/rt-2.conf new file mode 100644 index 0000000..42e5035 --- /dev/null +++ b/vrrp/holo/rt-2.conf @@ -0,0 +1,10 @@ +! +interfaces interface eth-br1 + type iana-if-type:ethernetCsmacd + ipv4 + ! + ipv4 vrrp vrrp-instance 51 + priority 20 + ! + virtual-ipv4-addresses virtual-ipv4-address 10.0.1.5 +! diff --git a/vrrp/interfaces/rt-1 b/vrrp/interfaces/rt-1 new file mode 100644 index 0000000..f476097 --- /dev/null +++ b/vrrp/interfaces/rt-1 @@ -0,0 +1,11 @@ +auto lo +auto eth-br1 + +iface lo inet static + address 1.1.1.1 + netmask 255.255.255.255 + +iface eth-br1 inet static + address 10.0.1.1 + netmask 255.255.255.0 + mtu 1500 diff --git a/vrrp/interfaces/rt-2 b/vrrp/interfaces/rt-2 new file mode 100644 index 0000000..1153f3f --- /dev/null +++ b/vrrp/interfaces/rt-2 @@ -0,0 +1,11 @@ +auto lo +auto eth-br1 + +iface lo inet static + address 2.2.2.2 + netmask 255.255.255.255 + +iface eth-br1 inet static + address 10.0.1.2 + netmask 255.255.255.0 + mtu 1500 diff --git a/vrrp/topology.yml b/vrrp/topology.yml new file mode 100644 index 0000000..0378759 --- /dev/null +++ b/vrrp/topology.yml @@ -0,0 +1,84 @@ +# +-------+ +# | | +# | h1 | +# | | +# +-------+ +# | br-host +# | 10.0.1.3/24 +# | +# | +# | +# | +# +---------+ +# | | +# +--------------------| br1 |-------------------+ +# | | | | +# | +---------+ | +# | | +# | | +# | | +# | | +# | eth-br1 | eth-br1 +# | 10.0.1.1/24 | 10.0.1.2/24 +# +-------------+ +----------+ +------------+ +# | | | | | | +# | RT-1 | | Virtual | | RT-2 | +# | 1.1.1.1 |==============| Router |=============| 2.2.2.2 | +# | | | 10.0.1.5| | | +# +-------------+ +----------+ +------------+ +# +# KEY: +# ----- physical link +# ===== virtual link + +name: vrrp + +topology: + defaults: + binds: + - ../scripts/start.sh:/start.sh + - frr/frr-setup.sh:/frr-setup.sh + - frr/daemons:/etc/frr/daemons + exec: + - "/start.sh" + - "/frr-setup.sh" + + nodes: + + br1: + kind: bridge + + rt-1: + kind: linux + + # ---- holod image ---- + image: ghcr.io/holo-routing/holo:latest + + # ---- frr image ---- + # image: quay.io/frrouting/frr:9.0.2 + + binds: + - interfaces/rt-1:/etc/network/interfaces + - holo/rt-1.conf:/etc/holo.startup + - frr/rt-1.conf:/etc/frr/frr.startup + + rt-2: + kind: linux + + # ---- holod image ---- + image: ghcr.io/holo-routing/holo:latest + + # ---- frr image ---- + # image: quay.io/frrouting/frr:9.0.2 + + binds: + - interfaces/rt-2:/etc/network/interfaces + - holo/rt-2.conf:/etc/holo.startup + - frr/rt-2.conf:/etc/frr/frr.startup + + links: + # 10.0.1.0/24 + - endpoints: ["host:br-host", "br1:eth-h1"] + - endpoints: ["rt-1:eth-br1", "br1:eth-rt1"] + - endpoints: ["rt-2:eth-br1", "br1:eth-rt2"] +