Configuring frr on Linux

frr is a network router for Linux systems.

It works well, and has a lot of good documentation about all of the commands and options, but it does doesn’t have a “getting started” section. It is a bit like getting the wiring diagram for a car, when all you to do is get in and drive the car.

Below are some of the things I stumbled across lessons I learned.

Some later definitions override earlier definitions.

With

router ospf6
ospf6 router-id 6.6.6.6
ospf6 router-id 6.6.6.7

The definition used is 6.6.6.7 because it overrides the earlier 6.6.6.6

interface AB
description colins AB first
ip ospf area 0.0.0.0
ip ospf area 20.0.0.0

In this case the area 0.0.0.0 is used – so the order does not look consistent.

interface eno1 
ipv6 nd prefix 2001:db8:6099::/64
ipv6 nd prefix 2008::/64


interface eno1
description server2 ospf6
ipv6 ospf6 instance-id 2

The description is description server2 ospf6 because it was the only one specified.

Both of the nd prefix values are used.

What is used where?

If you want to configure a daemon, you needs to specify parameters in different places.

For example, the ospf6 daemon

router ospf6
ospf6 router-id 6.6.6.6
...

interface enp0s31f6
ipv6 ospf6 area 0.0.0.0

The router ospf6 configuration is for the daemon thread.

The information on the interface…. statement is for each interface. This means all of the configuration information for an interface is under the interface…. section.

To display the ospf6 configuration use

show running-config ospf6

It extracts the ospf6 interesting information from the configuration

Current configuration:
!
frr version 8.1
...
hostname Server
!
debug ospf6 zebra
debug ospf6 interface
!
interface eno1
description server2 ospzz
ipv6 ospf6 area 0.0.0.0
ipv6 ospf6 instance-id 2
ipv6 ospf6 network point-to-point
exit
!

router ospf6
ospf6 router-id 6.6.1.1
redistribute static
redistribute ripng
exit
!
end

and ignored other information like

debug ospf zebra
debug ospf interface

interface eno1
ipv6 nd prefix 2001:db8:6099::/64
ipv6 nd prefix 2008::/64

The debug ospf… is ignored because this relates to ospf not to ospf6.

The ipv6 nd is ignored because this is not ospf6 related.

Configuring using vtysh

You can use vtysh to configure your /etc/frr/frr.cntl for example

  • vtysh
  • configure
  • interface vl100
  • ipv6 address 3000::1/64
  • do write
  • quit
  • quite
  • quit

it is a good idea to make a copy of the /etc/frr/frr.conf before you do this.

Show doesn’t always show

You can use the command

show running-config

and that shows you most of what is configured and running.

Note that default values may not be displayed.

When my definitions had

interface eno1 
ip ospf hello-interval 11

the show running-configuration gave

interface eno1
description server ospzz
ip address 10.1.0.3 peer 10.1.0.2/24
ip ospf area 0.0.0.0
ip ospf dead-interval 40
ip ospf hello-interval 11

When I had ip ospf hello-interval 10 the output did not include ip ospf hello-interval 10 because it was the default value.

You can use sudo vtysh

show running config
write file

to rewrite the /etc/frr/frr.conf control file with the defaults removed, and the frr version line updated.

If you use the command

show ip ospf interface

it gives you the values for each interface such as

Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5

OSPF defaults

these were in the file lib/libospf.h in the frr source.

 OSPF_MIN_LS_INTERVAL                  5000     /* msec */
OSPF_MIN_LS_ARRIVAL 1000 /* in milliseconds */
OSPF_LSA_INITIAL_AGE 0 /* useful for debug */
OSPF_LSA_MAXAGE 3600
OSPF_CHECK_AGE 300
OSPF_LSA_MAXAGE_DIFF 900
OSPF_LS_INFINITY 0xffffff
OSPF_DEFAULT_DESTINATION 0x00000000 /* 0.0.0.0 */
OSPF_INITIAL_SEQUENCE_NUMBER 0x80000001U
OSPF_MAX_SEQUENCE_NUMBER 0x7fffffffU


/* OSPF interface default values. */
OSPF_OUTPUT_COST_DEFAULT 10
OSPF_OUTPUT_COST_INFINITE UINT16_MAX
OSPF_ROUTER_DEAD_INTERVAL_DEFAULT 40

OSPF_ROUTER_DEAD_INTERVAL_MINIMAL 1
OSPF_HELLO_INTERVAL_DEFAULT 10
OSPF_ROUTER_PRIORITY_DEFAULT 1
OSPF_RETRANSMIT_INTERVAL_DEFAULT 5
OSPF_TRANSMIT_DELAY_DEFAULT 1
OSPF_DEFAULT_BANDWIDTH 10000 /* Mbps */

OSPF_DEFAULT_REF_BANDWIDTH 100000 /* Mbps */

OSPF_POLL_INTERVAL_DEFAULT 60
OSPF_NEIGHBOR_PRIORITY_DEFAULT 0

OSPF_MTU_IGNORE_DEFAULT 0
OSPF_FAST_HELLO_DEFAULT 0

OSPF_AREA_BACKBONE 0x00000000 /* 0.0.0.0 */
OSPF_AREA_RANGE_COST_UNSPEC -1U

OSPF_AREA_DEFAULT 0
OSPF_AREA_STUB 1
OSPF_AREA_NSSA 2
OSPF_AREA_TYPE_MAX 3

/* SPF Throttling timer values. */
OSPF_SPF_DELAY_DEFAULT 0
OSPF_SPF_HOLDTIME_DEFAULT 50
OSPF_SPF_MAX_HOLDTIME_DEFAULT 5000

OSPF_LSA_MAXAGE_CHECK_INTERVAL 30
OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT 60

Leave a comment