Skip to content

FRRouting

Amy Buck edited this page Jan 2, 2019 · 11 revisions

Free range routing

FRR is an open-source routing application that provides OSPFv2, OSPFv3, RIPv1 and v2, RIPng, and BGP-4 functionality. FRR is not included in the downloadable OPX installer, but may be installed using apt-get install.

See FRRouting testing for OPX compatibility with FRR.

The FRR architecture consists of a core daemon zebra, which acts as an abstraction layer to the underlying Linux kernel and presents a Zserv API over a Unix or TCP socket to FRR clients. The Zserv clients implement a routing protocol and communicate routing updates to the zebra daemon. See FRR for complete information.

FRR configuration

The daemons file is stored in the /etc/frr directory. All routing protocol daemons installed with FRR are disabled by default. You must enable the zebra daemon to install the routes in the kernel routing table.

1. Open the daemons file for editing and change the daemon status to yes.

$ vim /etc/frr

zebra=yes
bgpd=yes
ospfd=no
ospf6d=no
ripd=no
ripngd=no
isisd=no
babeld=no

2. Create the frr.conf configuration file.

$ touch /etc/frr/frr.conf

3. Restart the FRR service.

$ /etc/frr# service frr restart

4. View the status of the FRR protocol daemons.

root@OPX:/etc/frr# service frr status
? frr.service - FRRouting
   Loaded: loaded (/lib/systemd/system/frr.service; enabled)
   Active: active (running) since Fri 2018-11-16 21:17:14 UTC; 28s ago
  Process: 10771 ExecStop=/usr/lib/frr/frr stop (code=exited, status=0/SUCCESS)
  Process: 10843 ExecStart=/usr/lib/frr/frr start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/frr.service
           ??10859 /usr/lib/frr/zebra -s 90000000 --daemon -A 127.0.0.1
           ??10866 /usr/lib/frr/bgpd --daemon -A 127.0.0.1
           ??10873 /usr/lib/frr/watchfrr -adz -r /usr/sbin/servicebBfrrbBrest...

Nov 16 21:17:13 OPX frr[10843]: Loading capability module if not yet done.
Nov 16 21:17:13 OPX frr[10843]: Starting Frr daemons (prio:10):. zebra. bgpd.
Nov 16 21:17:13 OPX watchfrr[10873]: watchfrr 3.0.3 watching [zebra bgpd], ...t]
Nov 16 21:17:14 OPX watchfrr[10873]: zebra state -> up : connect succeeded
Nov 16 21:17:14 OPX watchfrr[10873]: bgpd state -> up : connect succeeded
Nov 16 21:17:14 OPX watchfrr[10873]: Watchfrr: Notifying Systemd we are up ...ng
Nov 16 21:17:14 OPX frr[10843]: Starting Frr monitor daemon: watchfrr.
Nov 16 21:17:14 OPX frr[10843]: Exiting from the script
Nov 16 21:17:14 OPX systemd[1]: Started FRRouting.
Hint: Some lines were ellipsized, use -l to show in full.

5. Access the FRR shell.

$ vtysh
Hello, this is FRR (version 3.0.3)
Copyright 1996-2017 Kunihiro Ishiguro, et al.
OPX#

6. Save the configuration changes.

$ write memory
Building Configuration...
  Integrated configuration saved to /etc/frr/frr.conf
  [OK]

FRR persistent configuration

The FRR service does not automatically start at system reboot. To start the service, you must add network-online.target.

$ vim.tiny /lib/systemd/system/graphical.target
Usage
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
[Unit]
Description=Graphical Interface
Documentation=man:systemd.special(7)
Requires=multi-user.target <uicontrol>network-online.target</uicontrol>
After=multi-user.target <uicontrol>network-online.target</uicontrol>
Conflicts=rescue.target
Wants=display-manager.service
AllowIsolate=yes

See FRR for complete information.

Routing use case using FRR

This use case describes how to configure BGP using FRR in a spine/leaf network.

Link Network Link nodes BGP AS number
Leaf1-to-Spine1 10.1.1.0/24 Leaf1 64501
Spine 1 64555
Leaf1-to-Spine2 20.1.1.0/24 Leaf1 64501
Spine 2 64555
Leaf2-to-Spine1 40.1.1.0/24 Leaf2 64502
Spine 1 64555
Leaf2-to-Spine2 30.1.1.0/24 Leaf2 64502
Spine 2 64555
Leaf1-to-Server1 11.1.1.0/24 Leaf1 64501
Leaf2-to-Server2 12.1.1.0/24 Leaf2 64502

1. Configure the IP addresses to Spine1, Spine2, and Server1 from Leaf1.

leaf1(config)# interface e101-049-0
leaf1(conf-if-e101-049-0)# ip address 10.1.1.1/24
leaf1(conf-if-e101-049-0)# no shutdown
leaf1(conf-if-e101-049-0)# exit

leaf1(config)# interface e101-051-0
leaf1(conf-if-e101-051-0)# ip address 20.1.1.1/24
leaf1(conf-if-e101-051-0)# no shutdown
leaf1(conf-if-e101-051-0)# exit

leaf1(config)# interface e101-001-0
leaf1(conf-if-e101-001-0)# ip address 11.1.1.1/24
leaf1(conf-if-e101-001-0)# no shutdown

2. Configure the IP addresses to Spine1, Spine2, and Server2 from Leaf2.

leaf2(config)# interface e101-032-0
leaf2(conf-if-e101-032-0)# ip address 30.1.1.1/24
leaf2(conf-if-e101-032-0)# no shutdown
leaf2(conf-if-e101-032-0)# exit

leaf2(config)# interface e101-020-0
leaf2(conf-if-e101-020-0)# ip address 40.1.1.1/24
leaf2(conf-if-e101-020-0)# no shutdown
leaf2(conf-if-e101-020-0)# exit

leaf2(config)# interface e101-001-0
leaf2(conf-if-e101-001-0)# ip address 12.1.1.1/24
leaf2(conf-if-e101-001-0)# no shutdown

3. Configure the IP addresses to Leaf1 and Leaf2 from Spine1.

spine1(config)# interface e101-027-1
spine1(conf-if-e101-027-1)# ip address 10.1.1.2/24
spine1(conf-if-e101-027-1)# no shutdown
spine1(conf-if-e101-027-1)# exit

spine1(config)# interface e101-010-1
spine1(conf-if-e101-010-1)# ip address 40.1.1.2/24
spine1(conf-if-e101-010-1)# no shutdown 

4. Configure the IP addresses to Leaf1 and Leaf2 from Spine2.

spine2(config)# interface e101-027-1
spine2(conf-if-e101-027-1)# ip address 20.1.1.2/24
spine2(conf-if-e101-027-1)# no shutdown
spine2(conf-if-e101-027-1)# exit

spine2(config)# interface e101-018-1
spine2(conf-if-e101-018-1)# ip address 30.1.1.2/24
spine2(conf-if-e101-018-1)# no shutdown
spine2(conf-if-e101-018-1)# exit

5. Configure BGP to Spine1 and Spine2 from Leaf 1.

leaf1(config)# router bgp 64501
leaf1(conf-router-bgp-64501)# neighbor 10.1.1.2 remote-as 64555
leaf1(conf-router-bgp-64501)# neighbor 20.1.1.2 remote-as 64555
leaf1(conf-router-bgp-64501)# network 10.1.1.0/24
leaf1(conf-router-bgp-64501)# network 20.1.1.0/24
leaf1(conf-router-bgp-64501)# network 11.1.1.0/24

6. Configure BGP from Spine1 and Spine2 from Leaf 2.

leaf2(config)# router bgp 64502
leaf2(conf-router-bgp-64502)# neighbor 30.1.1.2 remote-as 64555
leaf2(conf-router-bgp-64502)# neighbor 40.1.1.2 remote-as 64555
leaf2(conf-router-bgp-64502)# network 12.1.1.0/24
leaf2(conf-router-bgp-64502)# network 30.1.1.0/24
leaf2(conf-router-bgp-64502)# network 40.1.1.0/24

7. Configure BGP to Leaf1 and Leaf2 from Spine1.

spine1(config)# router bgp 64555
spine1(conf-router-bgp-64555)# neighbor 10.1.1.1 remote-as 64501
spine1(conf-router-bgp-64555)# neighbor 40.1.1.1 remote-as 64502
spine1(conf-router-bgp-64555)# network 10.1.1.0/24
spine1(conf-router-bgp-64555)# network 40.1.1.0/24

8. Configure BGP to Leaf1 and Leaf2 from Spine 2.

spine2(config)# router bgp 64555
spine2(conf-router-bgp-64555)# neighbor 30.1.1.1 remote-as 64502
spine2(conf-router-bgp-64555)# neighbor 20.1.1.1 remote-as 64501
spine2(conf-router-bgp-64555)# network 30.1.1.0/24
spine2(conf-router-bgp-64555)# network 20.1.1.0/24

9. Configure ECMP from Leaf1 to Leaf2.

leaf1(config)# router bgp 64501
leaf1(conf-router-bgp-64501)# maximum-paths 16

leaf2(config)# router bgp 64502
leaf2(conf-router-bgp-64502)# maximum-paths 16

Verify spine/leaf configuration

1. Verify BGP neighbors from Leaf1 and Leaf2.

leaf1# show ip bgp sum
BGP router identifier 20.20.20.20, local AS number 64501 vrf-id 0
RIB entries 11, using 1232 bytes of memory
Peers 2, using 9136 bytes of memory

Neighbor  V AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.1  4 64501  196  201  1 0 0 02:39:02  4
20.1.1.1  4 64501  195  206  1 0 0 02:38:57  4

Total number of neighbors 2

leaf2# show ip bgp sum
BGP router identifier 30.20.20.20, local AS number 64501 vrf-id 0
RIB entries 11, using 1232 bytes of memory
Peers 2, using 9136 bytes of memory

Neighbor  V AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
30.1.1.1  4 64501  196  197  1 0 0 02:39:45  4
40.1.1.1  4 64501  192  204  1 0 0 02:39:42  4

Total number of neighbors 2

2. Verify BGP neighbors from Spine1 and Spine 2.

spine1# show ip bgp sum
BGP router identifier 20.20.20.21, local AS number 64555 vrf-id 0
RIB entries 11, using 1232 bytes of memory
Peers 2, using 9136 bytes of memory

Neighbor  V AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.0  4 64501  199  201  1 0 0 02:40:55  3
40.1.1.0  4 64502  202  198  1 0 0 02:41:01  3

Total number of neighbors 2

spine2# show ip bgp sum
BGP router identifier 30.20.20.21, local AS number 64555 vrf-id 0
RIB entries 11, using 1232 bytes of memory
Peers 2, using 9136 bytes of memory

Neighbor  V AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
20.1.1.0  4 64501  206  206  1 0 0 02:43:06  3
30.1.1.0  4 64502  197  203  1 0 0 02:43:20  3

Total number of neighbors 2

3. Verify BGP neighbors from Spine1 and Spine2.

spine1# show ip bgp sum
BGP router identifier 40.20.20.22, local AS number 64555 vrf-id 0
RIB entries 11, using 1232 bytes of memory
Peers 2, using 9136 bytes of memory

Neighbor  V AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.1.1  4 64501  199  201  1 0 0 02:40:55  3
40.1.1.1  4 64502  202  198  1 0 0 02:41:01  3

Total number of neighbors 2

spine2# show ip bgp sum
BGP router identifier 30.20.20.22, local AS number 64555 vrf-id 0
RIB entries 11, using 1232 bytes of memory
Peers 2, using 9136 bytes of memory

Neighbor  V AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
20.1.1.1  4 64501  206  206  1 0 0 02:43:06  3
30.1.1.1  4 64502  197  203  1 0 0 02:43:20  3

Total number of neighbors 2

4. Verify that the server route is ECMP in the routing table from Leaf1 and Leaf2.

leaf1# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
    O - OSPF, I - IS-IS, B - BGP, A - Babel,
    > - selected route, * - FIB route

C>* 10.1.1.0/24 is directly connected, e101-049-0
C>* 11.1.1.0/24 is directly connected, e101-001-0
B>* 12.1.1.0/24 [20/0] via 10.1.1.2, e101-049-0, 02:44:45
  *     via 20.1.1.2, e101-051-0, 02:44:45
C>* 20.1.1.0/24 is directly connected, e101-051-0
B>* 30.1.1.0/24 [20/0] via 20.1.1.2, e101-051-0, 02:09:44
B>* 40.1.1.0/24 [20/0] via 10.1.1.2, e101-049-0, 02:11:50
C>* 127.1.1.0/8 is directly connected, lo

leaf2# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
    O - OSPF, I - IS-IS, B - BGP, A - Babel,
    > - selected route, * - FIB route

B>* 10.1.1.0/24 [20/0] via 40.1.1.2, e101-020-0, 02:12:43
B>* 11.1.1.0/24 [20/0] via 30.1.1.2, e101-032-0, 02:45:14
  *     via 40.1.1.2, e101-020-0, 02:45:14 
C>* 12.1.1.0/24 is directly connected, e101-001-0
B>* 20.1.1.0/24 [20/0] via 30.1.1.2, e101-032-0, 02:10:16
C>* 30.1.1.0/24 is directly connected, e101-032-0
C>* 40.1.1.0/24 is directly connected, e101-020-0
C>* 127.1.1.0/8 is directly connected, lo

5. Verify that the server route is ECMP in the Linux routing table from Leaf1 and Leaf2.

$ ip route show
10.1.1.0/24 dev e101-049-0  proto kernel  scope link  src 10.1.1.1
11.1.1.0/24 dev e101-001-0  proto kernel  scope link  src 11.1.1.1
12.1.1.0/24  proto zebra
    nexthop via 10.1.1.2  dev e101-049-0 weight 1
    nexthop via 20.1.1.2  dev e101-051-0 weight 1 
20.1.1.0/24 dev e101-051-0  proto kernel  scope link  src 20.1.1.1
30.1.1.0/24 via 20.1.1.2 dev e101-051-0  proto zebra
40.1.1.0/24 via 10.1.1.2 dev e101-049-0  proto zebra

$ ip route show
10.1.1.0/24 via 40.1.1.2 dev e101-020-0  proto zebra
11.1.1.0/24  proto zebra
    nexthop via 30.1.1.2  dev e101-032-0 weight 1
    nexthop via 40.1.1.2  dev e101-020-0 weight 1 
12.1.1.0/24 dev e101-001-0  proto kernel  scope link  src 12.1.1.1
20.1.1.0/24 via 30.1.1.2 dev e101-032-0  proto zebra
30.1.1.0/24 dev e101-032-0  proto kernel  scope link  src 30.1.1.1
40.1.1.0/24 dev e101-020-0  proto kernel  scope link  src 40.1.1.1
Clone this wiki locally