How to setup Free Range Routing, FRR

Free Range Routing is an open source implementation of the most common Network Routing protocols. It seems pretty complete and uses almost EXACT Cisco configuration syntax.

https://frrouting.org/
https://www.linux.com/news/2017/4/welcoming-frrouting-linux-foundation

So to install and configure it do this:

CONFIGURE SOME LINUX KERNEL PARAMETERS FOR OPTIMAL ROUTING PERFORMANCE:

create the following file:

/etc/sysctl.d/99frr_defaults.conf
# this information comes from Cumulus Linux Recommendations for FRR settings.
https://docs.cumulusnetworks.com/display/HOSTPACK/Installing+FRRouting+on+the+Host

with the following contents:

# /etc/sysctl.d/99frr_defaults.conf
# Place this file at the location above and reload the device.
# or run the sysctl -p /etc/sysctl.d/99frr_defaults.conf

# Enables IPv4/IPv6 Routing
net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding=1

# Routing
net.ipv6.route.max_size=131072
net.ipv4.conf.all.ignore_routes_with_linkdown=1
net.ipv6.conf.all.ignore_routes_with_linkdown=1

# Best Settings for Peering w/ BGP Unnumbered
# and OSPF Neighbors
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.lo.rp_filter = 0
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.default.arp_notify = 1
net.ipv4.conf.default.arp_ignore=1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.all.arp_notify = 1
net.ipv4.conf.all.arp_ignore=1
net.ipv4.icmp_errors_use_inbound_ifaddr=1

# Miscellaneous Settings

# Keep ipv6 permanent addresses on an admin down
net.ipv6.conf.all.keep_addr_on_down=1

# igmp
net.ipv4.igmp_max_memberships=1000
net.ipv4.neigh.default.mcast_solicit = 10

# MLD
net.ipv6.mld_max_msf=512

# Garbage Collection Settings for ARP and Neighbors
net.ipv4.neigh.default.gc_thresh2=7168
net.ipv4.neigh.default.gc_thresh3=8192
net.ipv4.neigh.default.base_reachable_time_ms=14400000
net.ipv6.neigh.default.gc_thresh2=3584
net.ipv6.neigh.default.gc_thresh3=4096
net.ipv6.neigh.default.base_reachable_time_ms=14400000

# Use neigh information on selection of nexthop for multipath hops
net.ipv4.fib_multipath_use_neigh=1

# Allows Apps to Work with VRF
net.ipv4.tcp_l3mdev_accept=1

RUN THE FOLLOWING COMMAND AFTER CREATING THE FILE:
sudo sysctl -p /etc/sysctl.d/99frr_defaults.conf

THEN WE SETUP A LOCAL APT SOURCE SO WE CAN INSTALL.

black@black-Mint ~ $ sudo mkdir /var/local-deb-repo
black@black-Mint ~ $ cd /var/local-deb-repo
black@black-Mint /var/local-deb-repo $ sudo wget https://github.com/FRRouting/frr/releases/download/frr-4.0/frr_4.0-1.ubuntu16.04.1_amd64.deb

black@black-Mint /var/local-deb-repo $ sudo apt-get install dpkg-dev

create a script file in vi
sudo vi buildrepo
type the letter 'a' for append then paste in content:

#! /bin/bash
cd /usr/local/mydebs
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz

type ':wq' without the quote marks to write and quit.

black@black-Mint /var/local-deb-repo $ sudo chmod +x buildrepo
black@black-Mint /var/local-deb-repo $ sudo ./buildrepo
./buildrepo: line 2: cd: /usr/local/mydebs: No such file or directory
dpkg-scanpackages: warning: Packages in archive but missing from override file:
dpkg-scanpackages: warning: frr
dpkg-scanpackages: info: Wrote 1 entries to output Packages file.

sudo vi /etc/apt/sources.list

type the letter 'a' for append then paste in content:

deb file:/var/local-deb-repo ./

type ':wq' without the quote marks to write and quit.

THEN WE INSTALL:

black@black-Mint /var/local-deb-repo $ sudo apt-get update
black@black-Mint /var/local-deb-repo $ sudo apt-get install frr
Do you want to continue? [Y/n] y
Install these packages without verification? [y/N] y

THEN WE CONFIGURE:

sudo install -m 755 -o frr -g frr -d /var/log/frr
sudo install -m 775 -o frr -g frrvty -d /etc/frr
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf
sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf
sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf

Edit /etc/frr/daemons and set to yes each daemon you are enabling

zebra=yes (* this one is mandatory to bring the others up)
bgpd=yes
ospfd=no
ospf6d=no
ripd=no
ripngd=no
isisd=no

edit vtysh.conf and add the follow to use separate config files insteads of integraed and then save the file:
no service integrated-vtysh-config

now enable and start the service

black@black-Mint:~$ sudo systemctl enable frr.service
black@black-Mint:~$ sudo systemctl start frr.service

THEN WE PLAY:

then to access the install use

black@black-Mint /etc/frr $ sudo vtysh

Hello, this is FRRouting (version 4.0).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

black-Mint# show int
Interface ens33 is up, line protocol is up
Link ups: 0 last: (never)
Link downs: 0 last: (never)
PTM status: disabled
vrf: Default-IP-Routing-Table
index 2 metric 0 mtu 1500 speed 1000
flags:
Type: Ethernet
HWaddr: 00:0c:29:08:47:81
inet 192.168.126.131/24 broadcast 192.168.126.255
inet6 fe80::30db:3a:2190:1a54/64
Interface Type Other
Interface lo is up, line protocol is up
Link ups: 0 last: (never)
Link downs: 0 last: (never)
PTM status: disabled
vrf: Default-IP-Routing-Table
index 1 metric 0 mtu 65536 speed 0
flags:
Type: Loopback
Interface Type Other
black-Mint# conf t
black-Mint(config)# router bgp 65000
black-Mint(config-router)#

and go ahead and configure whatever you want.

black-Mint# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
> - selected route, * - FIB route

K>* 169.254.0.0/16 [0/1000] is directly connected, ens33, 00:02:44
C>* 192.168.126.0/24 is directly connected, ens33, 00:02:44

to save changes use
write file