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

example bgp srv6 l3vpn #66

Merged
merged 7 commits into from
Aug 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions Dockerfiles/frr/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM frr-ubuntu20:latest
USER root
RUN mkdir -p /etc/frr
COPY daemons /etc/frr/daemons
RUN apt install -y vim tcpdump
8 changes: 8 additions & 0 deletions Dockerfiles/frr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
IMG=tinynetwork/frr:develop
build:
docker build -t $(IMG) .
push:
docker push $(IMG)
all: build push
run:
docker run --rm -it --privileged $(IMG) bash
15 changes: 15 additions & 0 deletions Dockerfiles/frr/daemons
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
zebra=yes
bgpd=yes
ospfd=no
ospf6d=no
ripd=no
ripngd=no
isisd=no
pimd=no
ldpd=no
nhrpd=no
eigrpd=no
babeld=no
sharpd=yes
pbrd=no
bfdd=no
228 changes: 228 additions & 0 deletions examples/basic_srv6/linux/bgp_vpnv6/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
postinit:
cmds:
- cmd: |
cat <<EOF >/tmp/daemons
zebra=yes
bgpd=yes
sharpd=yes
EOF
- cmd: |
cat <<EOF >/tmp/frr.r1.conf
!
log file /tmp/frr.log
debug bgp neighbor-events
debug bgp zebra
debug bgp vnc verbose
debug bgp update-groups
debug bgp updates in
debug bgp updates out
debug bgp vpn label
debug bgp vpn leak-from-vrf
debug bgp vpn leak-to-vrf
debug bgp vpn rmap-event
!
segment-routing
srv6
locators
locator default
prefix 2001:1111::/64
!
!
!
!
router bgp 1
bgp router-id 1.1.1.1
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
neighbor 2001:ffff::2 remote-as 2
neighbor 2001:ffff::2 timers connect 1
!
address-family ipv6 vpn
neighbor 2001:ffff::2 activate
exit-address-family
!
segment-routing srv6
locator default
!
!
router bgp 1 vrf vrf100
bgp router-id 1.1.1.1
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
neighbor 2001:bb11::2 remote-as 10
neighbor 2001:bb11::2 timers connect 1
!
address-family ipv6 unicast
sid vpn export auto
rd vpn export 1:100
rt vpn export 99:99
rt vpn import 99:99
import vpn
export vpn
redistribute connected
neighbor 2001:bb11::2 activate
exit-address-family
!
ipv6 route 2001:2222::/64 2001:ffff::2
EOF
- cmd: |
cat <<EOF >/tmp/frr.r2.conf
segment-routing
srv6
locators
locator default
prefix 2001:2222::/64
!
!
!
!
router bgp 2
bgp router-id 2.2.2.2
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
neighbor 2001:ffff::1 remote-as 1
neighbor 2001:ffff::1 timers connect 1
!
address-family ipv6 vpn
neighbor 2001:ffff::1 activate
exit-address-family
!
segment-routing srv6
locator default
!
!
router bgp 2 vrf vrf100
bgp router-id 2.2.2.2
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
neighbor 2001:bb22::2 remote-as 20
neighbor 2001:bb22::2 timers connect 1
!
address-family ipv6 unicast
sid vpn export auto
rd vpn export 2:100
rt vpn export 99:99
rt vpn import 99:99
import vpn
export vpn
redistribute connected
neighbor 2001:bb22::2 activate
exit-address-family
!
ipv6 route 2001:1111::/64 2001:ffff::1
EOF
- cmd: |
cat <<EOF >/tmp/frr.c1.conf
router bgp 10
bgp router-id 1.1.0.0
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
neighbor 2001:bb11::1 remote-as 1
!
address-family ipv6 unicast
redistribute connected
neighbor 2001:bb11::1 activate
exit-address-family
!
EOF
- cmd: |
cat <<EOF >/tmp/frr.c2.conf
router bgp 20
bgp router-id 2.2.0.0
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
neighbor 2001:bb22::1 remote-as 2
!
address-family ipv6 unicast
redistribute connected
neighbor 2001:bb22::1 activate
exit-address-family
!
EOF
- cmd: docker cp /tmp/daemons R1:/etc/frr/daemons
- cmd: docker cp /tmp/daemons R2:/etc/frr/daemons
- cmd: docker cp /tmp/daemons C1:/etc/frr/daemons
- cmd: docker cp /tmp/daemons C2:/etc/frr/daemons
- cmd: docker cp /tmp/frr.r1.conf R1:/etc/frr/frr.conf
- cmd: docker cp /tmp/frr.r2.conf R2:/etc/frr/frr.conf
- cmd: docker cp /tmp/frr.c1.conf C1:/etc/frr/frr.conf
- cmd: docker cp /tmp/frr.c2.conf C2:/etc/frr/frr.conf

nodes:
- name: R1
image: tinynetwork/frr:develop
interfaces:
- { name: net0, type: direct, args: R2#net0 }
- { name: net1, type: direct, args: C1#net0 }
- name: R2
image: tinynetwork/frr:develop
interfaces:
- { name: net0, type: direct, args: R1#net0 }
- { name: net1, type: direct, args: C2#net0 }
- name: C1
image: tinynetwork/frr:develop
interfaces:
- { name: net0, type: direct, args: R1#net1 }
- name: C2
image: tinynetwork/frr:develop
interfaces:
- { name: net0, type: direct, args: R2#net1 }

node_configs:
- name: R1
cmds:
- cmd: sysctl -w 'net.ipv6.conf.all.forwarding=1'
- cmd: sysctl -w 'net.ipv6.conf.all.disable_ipv6=0'
- cmd: sysctl -w 'net.ipv6.conf.all.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv6.conf.default.forwarding=1'
- cmd: sysctl -w 'net.ipv6.conf.default.disable_ipv6=0'
- cmd: sysctl -w 'net.ipv6.conf.default.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv6.conf.lo.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv6.conf.net0.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv6.conf.net1.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv4.conf.all.rp_filter=0'
- cmd: sysctl -w 'net.ipv4.conf.lo.rp_filter=0'
- cmd: sysctl -w 'net.ipv4.conf.net0.rp_filter=0'
- cmd: sysctl -w 'net.ipv4.conf.net1.rp_filter=0'

- cmd: ip addr add 2001:ffff::1/64 dev net0
- cmd: ip link add vrf100 type vrf table 100
- cmd: ip link set vrf100 up
- cmd: ip link set dev net1 vrf vrf100
- cmd: ip addr add 2001:bb11::1/64 dev net1
- cmd: /usr/lib/frr/frrinit.sh start

- name: R2
cmds:
- cmd: sysctl -w 'net.ipv6.conf.all.forwarding=1'
- cmd: sysctl -w 'net.ipv6.conf.all.disable_ipv6=0'
- cmd: sysctl -w 'net.ipv6.conf.all.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv6.conf.default.forwarding=1'
- cmd: sysctl -w 'net.ipv6.conf.default.disable_ipv6=0'
- cmd: sysctl -w 'net.ipv6.conf.default.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv6.conf.lo.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv6.conf.net0.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv6.conf.net1.seg6_enabled=1'
- cmd: sysctl -w 'net.ipv4.conf.all.rp_filter=0'
- cmd: sysctl -w 'net.ipv4.conf.lo.rp_filter=0'
- cmd: sysctl -w 'net.ipv4.conf.net0.rp_filter=0'
- cmd: sysctl -w 'net.ipv4.conf.net1.rp_filter=0'

- cmd: ip addr add 2001:ffff::2/64 dev net0
- cmd: ip link add vrf100 type vrf table 100
- cmd: ip link set vrf100 up
- cmd: ip link set dev net1 vrf vrf100
- cmd: ip addr add 2001:bb22::1/64 dev net1
- cmd: /usr/lib/frr/frrinit.sh start

- name: C1
cmds:
- cmd: sysctl -w 'net.ipv6.conf.all.disable_ipv6=0'
- cmd: ip addr add 2001:bb11::2/64 dev net0
- cmd: /usr/lib/frr/frrinit.sh start

- name: C2
cmds:
- cmd: sysctl -w 'net.ipv6.conf.all.disable_ipv6=0'
- cmd: ip addr add 2001:bb22::2/64 dev net0
- cmd: /usr/lib/frr/frrinit.sh start