OSPFv3 Component
Enabling the OSPFv3 Component
The OSPFv3 configuration is held under the top level ospfv3 object in /etc/flockd/flockd.json. If the ospfv3 object exists OSPFv3 will be enabled.
OSPFv3 (RFC 5340) is the IPv6 version of OSPF. The configuration structure mirrors OSPFv2.
With this configuration file:
-
OSPFv3 will be enabled
-
The OSPFv3 router will advertise a router id of
10.0.100.1 -
All interfaces with names starting with
r301will be placed in OSPF area 0. -
The loopback interface will also be placed in area 0.
"ospfv3": { "vrfs": { "default": { "router_id": "10.0.100.1", "areas": { "0.0.0.0": { "intfs": { "lo": {}, "^r301": { "hello_interval": 1 } } } } } } }
Redistribution of routes into OSPFv3
You may wish to redistribute routes from the RIB into OSPFv3. Use the redistribute JSON array. The origin field specifies the protocol that programmed the routes into the RIB: static, kernel-connected or kernel-static, as for OSPFv2.
"ospfv3": {
"vrfs": {
"default": {
"router_id": "10.0.100.1",
"redistribute": [
{
"origin": "static",
"metric_type": 2,
"metric": 1000
}
],
"areas": {
"0.0.0.0": {
"intfs": {
"lo": {},
"^r301": {}
}
}
}
}
}
}
Implicit and Explicit Router Id
As with OSPFv2, the router id can be set explicitly via the router_id field, or left unset to use the highest IPv4 address.
Interface Configuration
OSPFv3 interfaces support the same configuration options as OSPFv2:
"ospfv3": {
"vrfs": {
"<vrf-name>": {
"areas": {
"<area-id>": {
"intfs": {
"<interface-name>": {
# Interface type (default: broadcast)
"ospf_intf_type": ["broadcast" | "point-to-point" | "nbma" | "point-to-multipoint"],
# Interface output cost (default: 10)
"cost": ( 1..65535 ),
# Router Priority (default: 1)
"priority": ( 0..255 ),
# HelloInterval in seconds (default: 10)
"hello_interval": ( 1..65535 ),
# RouterDeadInterval in seconds (default: 40)
"dead_interval": ( 1..65535 ),
# Retransmit interval in milliseconds (default: 5000)
"rxmt_interval": ( 1..65535 ),
# Ignore MTU mismatch with neighbor
"mtu_ignore": [ true | false ],
# BFD failure detection
"bfd": {
"multiplier": 3,
"min_tx": 1000
}
}
}
}
}
}
}
}
Area Configuration
Area summary ranges
Area summary ranges allow aggregation of prefixes at area boundaries. When a summary range is configured, individual prefixes within that range are suppressed and replaced with a single summary prefix.
"ospfv3": {
"vrfs": {
"default": {
"areas": {
"0.0.0.1": {
"summary": {
"fc00:1::/32": {
"advertise": true
}
},
"intfs": {
"^eth": {}
}
}
}
}
}
}
Global Configuration Options
Stub router
Configure the router to advertise maximum metric in its Router LSA, causing other routers to avoid using it as a transit node.
"ospfv3": {
"vrfs": {
"default": {
"stub_router": {
"mode": "MaxMetric",
"always": true
}
}
}
}
Default route origination
"ospfv3": {
"vrfs": {
"default": {
"default_originate": {
"always": true
}
}
}
}
Administrative distance
"ospfv3": {
"vrfs": {
"default": {
"admin_distance": 115
}
}
}
LSA arrival timer
The timer_lsa_arrival sets the minimum interval (in milliseconds) between accepting the same LSA from a neighbor. This helps dampen rapid LSA flooding.
"ospfv3": {
"vrfs": {
"default": {
"timer_lsa_arrival": 1000
}
}
}
LSA mode
lsa_mode selects which RFC 8362 LSA behaviour OSPFv3 uses (there is no
on-the-wire negotiation, so it is operator config):
-
legacy(default): classic RFC 5340 LSAs only. -
sparse: compute SPF from the classic LSAs but also originate extended LSAs to carry Prefix SIDs (RFC 8362 section 6.2) — interoperates with a classic OSPFv3 router while still advertising Segment Routing. -
full-extended: originate and compute SPF from the RFC 8362 extended LSA set (section 6.1), for an all-flock area."ospfv3": { "vrfs": { "default": { "lsa_mode": "full-extended" } } }
lsa_mode is set per OSPFv3 instance and applies to all of its areas; there is
no per-area override.
The mode an instance is running in is reported as lsa_mode by
flockc ospfv3 instances.
lsa_mode may be changed on a running instance. A change between legacy and
sparse is applied in place, only adding or removing the extended LSA that
carries Prefix SIDs. A change to or from full-extended resets the OSPFv3
instance so it re-originates every LSA in the new mode, which briefly drops the
instance's adjacencies; make such a change during a maintenance window. An area
running full-extended must run it on every router: a legacy or sparse
router ignores the extended LSAs a full-extended router originates, and a
full-extended router likewise ignores the classic LSAs the extended ones
replace. A router left on the other mode is therefore not routed to at all.
Migrating to full-extended
There is no node-by-node migration into full-extended. A router originates
either the classic or the extended form of each topology LSA and never both, so
it leaves the topology of every router still in the other mode as soon as it
changes, and they leave its own.
There is no per-area migration either. lsa_mode is instance-wide, so setting
full-extended converts every area the instance serves at once; an ABR cannot
migrate one of its areas and leave the other. The E-AS-External-LSA also floods
the whole routing domain rather than a single area, and a legacy or sparse
router anywhere in that domain ignores it. Plan the change as one maintenance
window covering every OSPFv3 router in the domain.
A router left behind does not degrade, it disappears from the topology. Its
adjacencies still reach Full, because a router stores and floods every LSA
form whatever mode it is in, so the neighbour table looks healthy while the
route table has no route to the router or through it. A Full neighbour that
no route uses is the signature of a mode mismatch; check lsa_mode on every
router after migrating.
Segment Routing and Flexible Algorithm
OSPFv3 supports Segment Routing with Prefix SIDs and Flexible Algorithms (RFC 9350).
Prefix SIDs are carried in the extended Intra-Area-Prefix LSA, which only
sparse and full-extended originate. With lsa_mode left at its legacy
default a configured prefix_sid_map is not advertised, so set the mode as
well as the SID map.
Prefix SID Map
Prefix SIDs assign MPLS labels to IPv6 prefixes, enabling Segment Routing forwarding.
"ospfv3": {
"vrfs": {
"default": {
"router_id": "10.0.100.53",
"prefix_sid_map": {
"fc00::0161/128": {
"prefix_sid": 353,
"flex_algo_sids": {
"201": {
"sid": 90569
}
}
}
}
}
}
}
Flexible Algorithm
Flexible Algorithms allow defining custom constraint-based paths through the network.
"ospfv3": {
"vrfs": {
"default": {
"flex_algos": {
"201": {
"advertise_definition": true
},
"202": {
"advertise_definition": true
}
}
}
}
}
Operational State Overview
Check OSPFv3 is enabled
Check OSPFv3 is listed in the enabled_protocols field.
flock@r301:~$ flockc sys overview
{...,"enabled_protocols":["OSPFv3","Static"],...}
Show OSPFv3 Overview
flock@r301:~$ flockc ospfv3 inst default ospfv3_default show
{"my_router":{"id":"10.0.100.1","class":"ASBR"},"vrf_name":"default", ...,"instance_name":"ospfv3_default", ...,"version":"V3","lsa_mode":"full-extended", ...,"admin_distance":110, ...,"stats":{"ls_db_counters":{...},"route_count":11,"neigh_state_count":{"down":0,"attempt":0,"init":0,"two_way":0,"ex_start":0,"exchange":0,"loading":0,"full":4}}}
An OSPFv2 instance has no RFC 8362 mode and reports "lsa_mode":null.
Show all neighbors on an interface in Area 0
flock@r301:~$ flockc ospfv3 inst default ospfv3_default area 0 intf r301-eth0 neighbors
Show Area Link State Database
flock@r301:~$ flockc ospfv3 inst default ospfv3_default area 0 lsdb
Filter LSDB by LSA type
--lsa-type takes the OSPFv3 LS Type as a decimal number, including the U bit
and flooding scope bits it carries in its top three bits. The classic RFC 5340
types and the RFC 8362 extended types that replace them are:
| LSA | Extended LSA |
|---|---|
| Router 8193 (0x2001) | E-Router 40993 (0xa021) |
| Network 8194 (0x2002) | E-Network 40994 (0xa022) |
| Inter-Area-Prefix 8195 (0x2003) | E-Inter-Area-Prefix 40995 (0xa023) |
| Inter-Area-Router 8196 (0x2004) | E-Inter-Area-Router 40996 (0xa024) |
| AS-External 16389 (0x4005) | E-AS-External 49189 (0xc025) |
| NSSA 8199 (0x2007) | E-NSSA 40999 (0xa027) |
| Link 8 (0x0008) | E-Link 32808 (0x8028) |
| Intra-Area-Prefix 8201 (0x2009) | E-Intra-Area-Prefix 41001 (0xa029) |
Router Information LSAs (40972, 0xa00c) carry the router's hostname and its Segment Routing and Flexible Algorithm capabilities. They are TLV based and have no classic form, so they are originated in every mode.
A type number outside this set is not rejected. It matches no LSA, so the filter returns an empty list rather than an error.
flock@r301:~$ flockc ospfv3 inst default ospfv3_default area 0 lsdb --lsa-type 40993
Filter LSDB by originating router ID
flock@r301:~$ flockc ospfv3 inst default ospfv3_default area 0 lsdb --router-id <router-id>
Show an interface's link-local LSDB
The link-local-scope LSDB (OSPFv3 Link-LSAs) for one interface:
flock@r301:~$ flockc ospfv3 inst default ospfv3_default area 0 intf r301-eth0 lsdb
The same --lsa-type, --router-id, and --lsa-id filters apply as for
the area LSDB.
Show network route table prefixes
flock@r301:~$ flockc ospfv3 inst default ospfv3_default rib lookup <ipv6-network>
flock@r301:~$ flockc ospfv3 inst default ospfv3_default rib walk
Show router route table prefixes
flock@r301:~$ flockc ospfv3 inst default ospfv3_default router-rib lookup <router-id>
Show event buffer
flock@r301:~$ flockc ospfv3 event-log
Show redistributed RIB
flock@r301:~$ flockc ospfv3 inst default ospfv3_default redist-rib walk
Show Flexible Algorithm routes
flock@r301:~$ flockc ospfv3 inst default ospfv3_default fa-rib <algo-id> walk
OSPFv3 Operation Commands Reference
Help
flockc ospfv3 -h
List OSPFv3 instances
flockc ospfv3 instances
Overview of an instance (default VRF, default instance name ospfv3_default)
flockc ospfv3 inst default ospfv3_default show
List areas
flockc ospfv3 inst default ospfv3_default areas
Area overview
flockc ospfv3 inst default ospfv3_default area <area-id> show
All interfaces in an area
flockc ospfv3 inst default ospfv3_default area <area-id> interfaces
All neighbors on an interface
flockc ospfv3 inst default ospfv3_default area <area-id> intf <intf-name> neighbors
Specific neighbor detail
flockc ospfv3 inst default ospfv3_default area <area-id> intf <intf-name> neigh <router-id>
Link State Database
flockc ospfv3 inst default ospfv3_default lsdb
Area Link State Database
flockc ospfv3 inst default ospfv3_default area <area-id> lsdb
LSDB filtered by LSA type
flockc ospfv3 inst default ospfv3_default area <area-id> lsdb --lsa-type <type>
LSDB filtered by originating router ID
flockc ospfv3 inst default ospfv3_default area <area-id> lsdb --router-id <router-id>
Interface link-local LSDB (OSPFv3 Link-LSAs)
flockc ospfv3 inst default ospfv3_default area <area-id> intf <intf-name> lsdb [--lsa-type <type>] [--router-id <router-id>] [--lsa-id <id>]
Network route table prefixes
flockc ospfv3 inst default ospfv3_default rib lookup <ipv6-network>
flockc ospfv3 inst default ospfv3_default rib walk
Router route table prefixes
flockc ospfv3 inst default ospfv3_default router-rib lookup <router-id>
flockc ospfv3 inst default ospfv3_default router-rib walk
Redistributed RIB lookup / walk
flockc ospfv3 inst default ospfv3_default redist-rib lookup <ipv6-network>
flockc ospfv3 inst default ospfv3_default redist-rib walk
Event buffer
flockc ospfv3 event-log
Flexible Algorithm routes
flockc ospfv3 inst default ospfv3_default fa-rib <algo-id> lookup <ipv6-network>
flockc ospfv3 inst default ospfv3_default fa-rib <algo-id> walk