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 and the OSPFv3 master thread will be started.
OSPFv3 (RFC 5340) is the IPv6 version of OSPF. The configuration structure mirrors OSPFv2.
With this configuration file:
-
The OSPFv3 master thread will be started
-
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.
"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 seconds
"rxmt_interval": <seconds>,
# Ignore MTU mismatch with neighbor
"mtu_ignore": [ true | false ],
# BFD failure detection
"bfd": {
"multiplier": 3,
"min_tx": "1s"
}
}
}
}
}
}
}
}
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
}
}
}
Segment Routing and Flexible Algorithm
OSPFv3 supports Segment Routing with Prefix SIDs and Flexible Algorithms (RFC 9350).
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 system
{...,"enabled_protocols":["OSPFv3"],...}
Show OSPFv3 Overview
flock@r301:~$ flockc ospfv3
Show all neighbors
flock@r301:~$ flockc ospfv3 -n
Show Area Link State Database
flock@r301:~$ flockc ospfv3 -a 0 -l
Filter LSDB by LSA type
flock@r301:~$ flockc ospfv3 -a 0 -l --lsa-type <type>
Filter LSDB by router ID
flock@r301:~$ flockc ospfv3 -a 0 -l --lsa-router-id <router-id>
Show network route table prefixes
flock@r301:~$ flockc ospfv3 -p [<ipv6-network>]
Show router route table prefixes
flock@r301:~$ flockc ospfv3 -P [<router-id>]
Show event buffer
flock@r301:~$ flockc ospfv3 --events
Show redistributed RIB
flock@r301:~$ flockc ospfv3 -r
Show Flexible Algorithm routes
flock@r301:~$ flockc ospfv3 --flex-algo <algo-id>
OSPFv3 Operation Commands Reference
Help
flockc ospfv3 -h
Overview
flockc ospfv3
Overview of areas
flockc ospfv3 -a [<area-id>]
All interfaces in an area
flockc ospfv3 -i -a <area-id>
All neighbors
flockc ospfv3 -n
Link State Database
flockc ospfv3 -l
Area Link State Database
flockc ospfv3 -a <area-id> -l
LSDB filtered by LSA type
flockc ospfv3 -a <area-id> -l --lsa-type <type>
LSDB filtered by router ID
flockc ospfv3 -a <area-id> -l --lsa-router-id <router-id>
Network route table prefixes
flockc ospfv3 -p [<ipv6-network>]
Router route table prefixes
flockc ospfv3 -P [<router-id>]
Redistributed RIB
flockc ospfv3 -r
Event buffer
flockc ospfv3 --events
Flexible Algorithm routes
flockc ospfv3 --flex-algo <algo-id>