Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vrrp topology. #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions vrrp/frr/daemons
Original file line number Diff line number Diff line change
@@ -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"
15 changes: 15 additions & 0 deletions vrrp/frr/frr-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# waiting for the daemons to start
sleep 2


# Wait for the daemons to start
sleep 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we have two "sleep" lines that could be combined into one.


if command -v /usr/lib/frr/zebra; then
ip link add vrrp4-51 link eth-sw1 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
11 changes: 11 additions & 0 deletions vrrp/frr/rt-1.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
hostname rt-1
!
interface eth-sw1
vrrp 51 version 2
vrrp 51 priority 10
vrrp 51 advertisement-interval 1000
vrrp 51 ip 10.0.1.5
!
!
line vty
!
11 changes: 11 additions & 0 deletions vrrp/frr/rt-2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
hostname rt-2
!
interface eth-sw1
vrrp 51 version 2
vrrp 51 priority 20
vrrp 51 advertisement-interval 1000
vrrp 51 ip 10.0.1.5
!
!
line vty
!
10 changes: 10 additions & 0 deletions vrrp/holo/rt-1.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
!
interfaces interface eth-sw1
type iana-if-type:ethernetCsmacd
ipv4
!
ipv4 vrrp vrrp-instance 51
priority 10
!
virtual-ipv4-addresses virtual-ipv4-address 10.0.1.5
!
10 changes: 10 additions & 0 deletions vrrp/holo/rt-2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
!
interfaces interface eth-sw1
type iana-if-type:ethernetCsmacd
ipv4
!
ipv4 vrrp vrrp-instance 51
priority 20
!
virtual-ipv4-addresses virtual-ipv4-address 10.0.1.5
!
11 changes: 11 additions & 0 deletions vrrp/interfaces/rt-1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
auto lo
auto eth-sw1

iface lo inet static
address 1.1.1.1
netmask 255.255.255.255

iface eth-sw1 inet static
address 10.0.1.1
netmask 255.255.255.0
mtu 1500
11 changes: 11 additions & 0 deletions vrrp/interfaces/rt-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
auto lo
auto eth-sw1

iface lo inet static
address 2.2.2.2
netmask 255.255.255.255

iface eth-sw1 inet static
address 10.0.1.2
netmask 255.255.255.0
mtu 1500
84 changes: 84 additions & 0 deletions vrrp/topology.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# +-------+
# | |
# | h1 |
# | |
# +-------+
# | sw-host
# | 10.0.1.3/24
# |
# |
# |
# |
# +---------+
# | |
# +--------------------| sw |-------------------+
# | | | |
# | +---------+ |
# | |
# | |
# | |
# | |
# | eth-sw1 | eth-sw1
# | 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:

sw1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use "br1" to be consistent with the other topologies. Similarly, please use "rt1" instead of "rt-1".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.
Thanks.

kind: bridge

rt-1:
kind: linux

# ---- holod image ----
image: local-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: local-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:sw-host", "sw1:eth-h1"]
- endpoints: ["rt-1:eth-sw1", "sw1:eth-rt1"]
- endpoints: ["rt-2:eth-sw1", "sw1:eth-rt2"]