When testing MetalLB and Calico, there are times when you need to verify BGP behavior. Asking the network team to make changes for every test is impractical, and most of the time you only need confirmation that BGP messages are exchanged and the routing table updates as expected—not a real change to the physical network. GoBGP is handy for that kind of simulation.

GoBGP can be configured in great detail. If all you need is a virtual router that accepts BGP announcements from clients and lets you check whether its RIB is updated correctly, the setup below is enough.

Get the binaries

Download the release archive for your platform and unpack it. The two files that matter are gobgpd, the virtual router daemon, and gobgp, the command-line client for inspecting routes.

Start the virtual router

Create gobgp.toml. The minimal config below covers most basic BGP tests in cloud-native environments.

[global.config]
as = 65000 # Any value is fine for a test environment
router-id = "10.0.0.1" # Any value works in a test environment; using the GoBGP node IP makes logs clearer

[[dynamic-neighbors]] # Passive connection mode, so no fixed client config is needed
[dynamic-neighbors.config]
prefix = "192.168.0.0/24" # Which client IP range is allowed to connect
peer-group = "ext-ebgp"

[[peer-groups]] # Can be copied as-is
[peer-groups.config]
peer-group-name = "ext-ebgp"
peer-as = 65000

[[peer-groups.afi-safis]]
[peer-groups.afi-safis.config]
afi-safi-name = "ipv4-unicast"

Start the daemon:

./gobgpd -f gobgp.toml

In another terminal, inspect the current RIB:

./gobgp global rib

That is enough to exercise the basic BGP capabilities of MetalLB and Calico. For more complex modes such as Router Reflector or EVPN, go through the GoBGP documentation.