diff --git a/docker-compose.yml b/docker-compose.yml index 21958ac..e42c977 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -450,6 +450,22 @@ services: - ./gobgp:/config command: ["gobgpd", "-f", "/config/gobgpd.conf", "-t", "toml"] + # GoBGP -- modular EVPN test-route injector (roadmap E5). Profile-gated, so + # it is NOT part of the normal stack. Originates synthetic BGP EVPN routes + # and BMP-exports them so the EVPN pipeline can be exercised. Start only for + # testing: docker compose --profile evpn-test up -d gobgp-evpn + # then: bash gobgp-evpn/inject-evpn.sh + gobgp-evpn: + restart: unless-stopped + container_name: obmp-gobgp-evpn + profiles: ["evpn-test"] + image: jauderho/gobgp:v4.5.0 + depends_on: + - collector + volumes: + - ./gobgp-evpn:/config + command: ["gobgpd", "-f", "/config/gobgpd.conf", "-t", "toml"] + whois: restart: unless-stopped container_name: obmp-whois diff --git a/gobgp-evpn/README.md b/gobgp-evpn/README.md new file mode 100644 index 0000000..ed2fa2b --- /dev/null +++ b/gobgp-evpn/README.md @@ -0,0 +1,38 @@ +# gobgp-evpn — modular EVPN test-route injector + +A **profile-gated, non-production** GoBGP instance for exercising the EVPN +ingestion pipeline (roadmap E5). The CML IOS-XR lab cannot originate EVPN +routes, so this container synthesises them. + +## What it does + +`gobgp-evpn` runs GoBGP with no BGP peers, BMP-exporting its local RIB +(`route-monitoring-policy = local-rib`) to the OpenBMP collector. Routes +injected with `inject-evpn.sh` are parsed by the collector and published to +the `openbmp.parsed.evpn` Kafka topic, where the EVPN consumer picks them up +and writes the `evpn_rib` table. + +## Usage + +```sh +# start the injector (not started by a normal `docker compose up`) +docker compose --profile evpn-test up -d gobgp-evpn + +# push synthetic type-2 / type-3 / type-5 EVPN routes +bash gobgp-evpn/inject-evpn.sh + +# inspect what GoBGP holds +docker exec obmp-gobgp-evpn gobgp global rib -a evpn + +# stop it when done testing +docker compose --profile evpn-test stop gobgp-evpn +``` + +## Notes + +- Local AS 65010, router-id 10.40.40.251 — distinct from the production + `gobgp` global-table feed (AS 65001). +- It is *not* part of the default stack: the `evpn-test` Compose profile + keeps it out of production and lets it be started/stopped on demand. +- EVPN type-5 (IP-prefix) routes require a `gw ` argument in the + GoBGP CLI — see `inject-evpn.sh`. diff --git a/gobgp-evpn/gobgpd.conf b/gobgp-evpn/gobgpd.conf new file mode 100644 index 0000000..f0835d4 --- /dev/null +++ b/gobgp-evpn/gobgpd.conf @@ -0,0 +1,29 @@ +# GoBGP -- modular EVPN test-route injector (roadmap E5) +# +# A profile-gated, throwaway GoBGP instance whose only job is to originate +# synthetic BGP EVPN routes and BMP-export them to the OpenBMP collector, so +# the EVPN ingestion pipeline (collector -> Kafka openbmp.parsed.evpn -> +# evpn-consumer -> evpn_rib) can be exercised. NOT a production component -- +# start it only when testing: +# docker compose --profile evpn-test up -d gobgp-evpn +# bash gobgp-evpn/inject-evpn.sh +# +# It has no BGP peers; routes are injected straight into the local RIB, so +# BMP export uses route-monitoring-policy = local-rib. + +[global] + [global.config] + as = 65010 + router-id = "10.40.40.251" + # No inbound BGP listener -- we only originate locally and BMP-export. + port = -1 + +# --- BMP export to the OpenBMP collector ------------------------------------ +[[bmp-servers]] + [bmp-servers.config] + address = "10.40.40.202" + port = 5000 + # local-rib: the injected EVPN routes live in the loc-rib (there are no + # BGP peers / no adj-rib-in), so export the local RIB. + route-monitoring-policy = "local-rib" + statistics-timeout = 3600 diff --git a/gobgp-evpn/inject-evpn.sh b/gobgp-evpn/inject-evpn.sh new file mode 100755 index 0000000..4c07a9b --- /dev/null +++ b/gobgp-evpn/inject-evpn.sh @@ -0,0 +1,32 @@ +#!/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