OSPFv2 Component

Configuration Overview

The OSPFv2 configuration is held under the top level ospfv2 object in /etc/flockd/flockd.json. If the ospfv2 object exists OSPFv2 will be enabled and an OSPFv2 master thread will be spawned.

The Flock Networks Routing Suite is designed for massive scale so placing all routers in a single OSPF area is recommended. (If you are adding a device to an existing multi-area OSPF Autonomous System, multiple areas are fully supported)

flock@flocknet:~$ cat /etc/flockd/flockd.json
...
"ospfv2": {
    "router_id": "10.0.100.2",
    "area": [
        {
            "area_id": "0.0.0.0",
            "intf": [
                {
                    "name": "^en"
                }
            ]
        }
    ]
}

The "name": "^en" will match all interfaces that have names starting with en (and place them in OSPFv2 area 0).

This is all the OSPFv2 configuration you need, to create an OSPF network as large as you like. Each device has an identical configuration which simplifies the operation of the network. A management station can easily determine all the Router Id's in the network by querying a single device for all of its Router LSA's.

Redistribution of Kernel routes into OSPF

You may wish to redistribute static routes from the RIB into OSPFv2.

flock@flocknet:~$ cat /etc/flockd/flockd.json
...
"ospfv2": {
    "redistribute": [
        {
            "metric": 200,
            "metric_type": 2,
            "origin": "kernel-static"
        }
    ]
}

As a minimum we may want a default route added to the kernel of each ASBR router. This route will appear in the RIB and then be redistributed into OSPFv2. OSPFv2 will advertise this route across the AS, so all nodes learn the route to exit the network. Static routes are added using the Linux command line.

# ip route add 0.0.0.0/0 via 192.168.122.171 dev enp9s0

In Debian make this permanent by adding the following lines in /etc/network/interfaces under the iface enp9s0 entry.

post-up /bin/ip route add 0.0.0.0/0 via 192.168.122.171 dev enp9s0

Explicit Router Id

By default the highest IPv4 Address is used as the Router Id. To explicitly set the Router Id to 10.0.100.1;

flock@flocknet:~$ cat /etc/flockd/flockd.json
...
"ospfv2": {
    "router_id": "10.0.100.1",
    ...
}

An alternative approach that can be useful when operating the network, is to create a dummy interface with an IP Address that becomes the Router ID.

First create the dummy interface. On Debian add this entry in /etc/network/interfaces.

flock@r01:~$ cat /etc/network/interfaces
auto dummy0
iface dummy0 inet static
address 10.0.100.1/32
pre-up /bin/ip link add dummy0 type dummy
post-down /bin/ip link del dummy0

flock@r01:~$ sudo systemctl restart networking
flock@r01:~$

Second place the dummy0 interface in OSPF area 0. The Flock Networks Routing Suite will select the Router Id from IP Addresses on dummy interfaces in preference to other interface types. So with this method you do not need the explicit router_id configuration shown above.

flock@flocknet:~$ cat /etc/flockd/flockd.json
...
"ospfv2": {
    "area": [
        {
            "area_id": "0.0.0.0",
            "intf": [
                {
                    "name": "dummy0"
                }
            ]
        }
    ]
}

flock@r01:~$ sudo systemctl restart flockd
flock@r01:~$

For detailed configuration information see OSPFv2 Configuration.

Operational State Overview

Check OSPFv2 is enabled

Check OSPFv2 is listed in the enabled_protocols field.

flock@flocknet$ flockc system
"hostname": "flocknet"
"software": "Flock Networks Routing Suite"
"version": "20.4.0"
"model": "Multi-threaded"
"pid": 2423
"compile_mode": "Release"
"log_level": "info"
"uptime": Uptime { days: 0, hours: 0, mins: 0, secs: 19 }
"enabled_protocols": ["OSPFv2"]
flock@flocknet:~$

Show OSPFv2 Overview

flock@r01:~$ flockc ospfv2
{"router_id":"10.0.100.4","class":"IR","redistribute":[]}

Show all neighbors (out of all interfaces, in all areas)

flock@r01:~$ flockc ospfv2 -n
{"ospf_area_id":"0.0.0.0"}
{"ospf_intf":"enp1s0"}
{"id":"10.0.100.3","ip":"10.0.5.225","state":"Full","dr":"10.0.5.204","bdr":"10.0.5.225"}
{"ospf_area_id":"0.0.0.20"}
{"ospf_intf":"enp7s0"}
{"id":"10.20.100.20","ip":"10.20.20.189","state":"Full","dr":"10.20.20.189","bdr":"10.20.20.214"}

Show Area 0 Link State Database

flock@flocknet:~$ flockc ospfv2 -a 0 -l
{"lsa_age":279,"lsa_opts":{"bits":2},"lsa_type":"Router","lsa_id":"10.0.100.4","lsa_router_id":"10.0.100.4","lsa_seq":-2147483646,"lsa_checksum":28411,"lsa_len":36}
{"lsa_age":266,"lsa_opts":{"bits":2},"lsa_type":"Router","lsa_id":"10.0.100.5","lsa_router_id":"10.0.100.5","lsa_seq":-2147483646,"lsa_checksum":22802,"lsa_len":36}
...

For detailed operational state information see OSPFv2 Operation.