#!/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 # NOTE: EVPN type-5 (IP-prefix) routes are intentionally NOT injected. # The OpenBMP collector 2.2.3 parses type-2 (MAC/IP) and type-3 (multicast) # cleanly, but mis-decodes the type-5 NLRI — the IP prefix bleeds into the # RD field (observed RDs like '6154:3523870730'). Type-5 visibility needs a # newer collector or the GoBMP path — see docs/ROADMAP.md E5. echo echo "Current EVPN RIB on gobgp-evpn:" docker exec obmp-gobgp-evpn gobgp global rib -a evpn