FRRouting simple eBGP setup

Set up for two routers: r1 in AS 100, r2 in AS 200. r2 will broadcast its static routes to r1. This is to demonstrate the Lua match script hook call for route-map.

In /etc/frr/daemons, ensure BGPD is enabled:

bgpd=yes

Copy and paste this into /etc/frr/frr.conf for r1:

hostname r1
log syslog
interface veth0
 ip address 10.0.0.100/31
router bgp 1
 bgp router-id 10.0.1.100
 no bgp ebgp-requires-policy
 neighbor 10.0.0.101 remote-as external
 address-family ipv4 unicast
  neighbor 10.0.0.101 route-map RMAP in
 end-address-family
route-map RMAP permit 10
  match script my_script
line vty

For r2:

hostname r2
interface veth1
 ip address 10.0.0.101/31
router bgp 2
 bgp router-id 10.0.1.101
 no bgp ebgp-requires-policy
 neighbor 10.0.0.100 remote-as external
 address-family ipv4 unicast
  redistribute static
 end-address-family
line vty

On both sides, `sudo vtysh` into them, then run `show running-config` to see if our `frr.conf` has been successfully loaded.

In r2, add a static route

ip route 1.1.1.1/32 veth1

In r1, check that it is received:

show bgp summary
show ip route

The route will not show up if it wasn’t installed, for various reasons. Look at logs with `journalctl -f -u frr`

If that doesn’t show up, check your logging settings.

show logging

Author: Donald Lee Qian Siang