In this guide we will provide detailed guide which will help you to establish BGP session between FastNetMon and FRR.
FRR is a network routing toolkit which includes support for many routing protocols. In this guide we will work only with BGP protocol and we will use Ubuntu as platform. The very same guide should work well on Debian platform too.
First we need to install FRR. Unfortuately, even latest versions of Linux distributions do not ship fresh versions of FRR and we will use their official repository to install it.
If you have FRR installed you can skip this guide to configuration step.
Add GPG key into trust store:
curl -s https://deb.frrouting.org/frr/keys.asc | sudo apt-key add -
Add FRR repositories into system:
FRRVER="frr-stable" echo deb https://deb.frrouting.org/frr $(lsb_release -s -c) $FRRVER | sudo tee -a /etc/apt/sources.list.d/frr.list
sudo apt update sudo apt install -y frr frr-pythontools
Enable BGP daemon:
sudo sed -i "s/^bgpd=no/bgpd=yes/" /etc/frr/daemons
Restart FRR daemons:
sudo systemctl restart frr
Check that bgpd daemon is running:
ps aux|grep bgpd
You need to check that following daemons are in list of running processes:
root 11177 0.0 0.0 38544 2872 ? S<s 15:05 0:00 /usr/lib/frr/watchfrr -d -F traditional zebra bgpd staticd frr 11195 0.0 0.0 203564 10124 ? S<sl 15:05 0:00 /usr/lib/frr/bgpd -d -F traditional -A 127.0.0.1
Then open /etc/frr/frr.conf and add following content (please replace IPs for correct ones for machine itself and machine with FastNetMon):
frr defaults traditional log syslog informational debug bgp events debug bgp filters debug bgp fsm debug bgp keepalives debug bgp updates router bgp 65001 bgp router-id 192.168.1.106 bgp log-neighbor-changes neighbor 192.168.1.201 remote-as 65001 neighbor 192.168.1.201 soft-reconfiguration inbound
sudo systemctl restart frr
Then you will need to check that BGP peering session is configured properly on FastNetMon’s side.
After that you can check BGP status from FRR that way:
sudo vtysh -c "show bgp summary" IPv4 Unicast Summary (VRF default): BGP router identifier 192.168.1.106, local AS number 65001 vrf-id 0 BGP table version 0 RIB entries 0, using 0 bytes of memory Peers 1, using 724 KiB of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd PfxSnt Desc 192.168.1.201 4 65001 27 27 0 0 0 00:12:34 0 0 N/A Total number of neighbors 1
Check detailed peer status from FRR:
sudo vtysh -c "show ip bgp nei"
BGP neighbor is 192.168.1.201, remote AS 65001, local AS 65001, internal link Local Role: undefined Remote Role: undefined BGP version 4, remote router ID 192.168.1.201, local router ID 192.168.1.106 BGP state = Established, up for 00:20:57 Last read 00:00:27, Last write 00:00:27 Hold time is 90 seconds, keepalive interval is 30 seconds Configured hold time is 180 seconds, keepalive interval is 60 seconds Configured conditional advertisements interval is 60 seconds Neighbor capabilities: 4 Byte AS: advertised and received Extended Message: advertised AddPath: IPv4 Unicast: RX advertised Extended nexthop: received Address families by peer: IPv4 Unicast Long-lived Graceful Restart: advertised Route refresh: advertised and received(new) Enhanced Route Refresh: advertised Address Family IPv4 Unicast: advertised and received Hostname Capability: advertised (name: fastlab1,domain name: n/a) not received Graceful Restart Capability: advertised Graceful restart information: Local GR Mode: Helper* Remote GR Mode: Disable R bit: False N bit: False Timers: Configured Restart Time(sec): 120 Received Restart Time(sec): 0 Message statistics: Inq depth is 0 Outq depth is 0 Sent Rcvd Opens: 2 1 Notifications: 0 0 Updates: 0 1 Keepalives: 42 42 Route Refresh: 0 0 Capability: 0 0 Total: 44 44 Minimum time between advertisement runs is 0 seconds For address family: IPv4 Unicast Update group 1, subgroup 1 Packet Queue length 0 Community attribute sent to this neighbor(all) 1 accepted prefixes Connections established 1; dropped 0 Last reset 00:21:07, No AFI/SAFI activated for peer Internal BGP neighbor may be up to 255 hops away. Local host: 192.168.1.106, Local port: 179 Foreign host: 192.168.1.201, Foreign port: 54455 Nexthop: 192.168.1.106 Nexthop global: fd30:4a5b:de4c:0:20c:29ff:fec8:20c5 Nexthop local: fe80::20c:29ff:fec8:20c5 BGP connection: shared network BGP Connect Retry Timer in Seconds: 120 Read thread: on Write thread: on FD used: 24
Check BGP status from GoBGP using this command:
gobgp nei 192.168.1.106
BGP neighbor is 192.168.1.106, remote AS 65001 BGP version 4, remote router ID 192.168.1.106 BGP state = ESTABLISHED, up for 00:12:57 BGP OutQ = 0, Flops = 0 Hold time is 90, keepalive interval is 30 seconds Configured hold time is 90, keepalive interval is 30 seconds Neighbor capabilities: multiprotocol: ipv4-unicast: advertised and received route-refresh: advertised and received extended-nexthop: advertised Local: nlri: ipv4-unicast, nexthop: ipv6 UnknownCapability(6): received graceful-restart: received Remote: restart flag set, notification flag set 4-octet-as: advertised and received add-path: received Remote: ipv4-unicast: receive enhanced-route-refresh: received long-lived-graceful-restart: received Remote: ipv4-unicast, restart time 0 sec, forward flag set UnknownCapability(73): received cisco-route-refresh: received Message statistics: Sent Rcvd Opens: 12 1 Notifications: 0 0 Updates: 0 0 Keepalives: 26 26 Route Refresh: 0 0 Discarded: 0 0 Total: 38 27 Route statistics: Advertised: 0 Received: 0 Accepted: 0
Blackhole some example host from FastNetMon side:
sudo fcli set blackhole 18.104.22.168
Then check that prefix was accepted by FRR using this command:
sudo vtysh -c "show ip bgp nei 192.168.1.201 received-routes"
BGP table version is 0, local router ID is 192.168.1.106, vrf id 0 Default local pref 100, local AS 65001 Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, i internal, r RIB-failure, S Stale, R Removed Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path *> 22.214.171.124/32 126.96.36.199 100 0 ? Total number of prefixes 1
This guide covers only BGP peering session setup. We did not create any filters or policies to apply BGP blackhole. You need to do it on your own using BGP communities provided by your ISP.