obmp-docker/gobgp-evpn/inject-evpn.sh

33 lines
1.5 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
#
# inject-evpn.sh -- push synthetic BGP EVPN routes into the gobgp-evpn
# instance so the EVPN ingestion pipeline can be tested end to end.
#
# Run from the docker host after starting the injector:
# docker compose --profile evpn-test up -d gobgp-evpn
# bash gobgp-evpn/inject-evpn.sh
#
# Routes land in gobgp-evpn's local RIB and are BMP-exported to the collector
# (route-monitoring-policy = local-rib), parsed onto the openbmp.parsed.evpn
# Kafka topic. Re-running is harmless (GoBGP de-dupes identical routes).
set -euo pipefail
G=(docker exec obmp-gobgp-evpn gobgp global rib add -a evpn)
echo "Injecting EVPN type-2 (MAC/IP advertisement) routes..."
"${G[@]}" macadv aa:bb:cc:00:00:01 10.200.10.1 etag 100 label 10100 rd 65010:100 rt 65010:100 encap vxlan
"${G[@]}" macadv aa:bb:cc:00:00:02 10.200.10.2 etag 100 label 10100 rd 65010:100 rt 65010:100 encap vxlan
"${G[@]}" macadv aa:bb:cc:00:00:03 10.200.20.1 etag 200 label 10200 rd 65010:200 rt 65010:200 encap vxlan
echo "Injecting EVPN type-3 (inclusive multicast) routes..."
"${G[@]}" multicast 10.40.40.251 etag 100 rd 65010:100 rt 65010:100
"${G[@]}" multicast 10.40.40.251 etag 200 rd 65010:200 rt 65010:200
echo "Injecting EVPN type-5 (IP prefix) routes..."
"${G[@]}" prefix 10.210.10.0/24 gw 10.40.40.251 etag 0 label 10210 rd 65010:210 rt 65010:210 encap vxlan
"${G[@]}" prefix 10.210.20.0/24 gw 10.40.40.251 etag 0 label 10220 rd 65010:220 rt 65010:220 encap vxlan
echo
echo "Current EVPN RIB on gobgp-evpn:"
docker exec obmp-gobgp-evpn gobgp global rib -a evpn