Configuring OSPF
Configuration Hierarchy
The diagram illustrates the OSPF configuration hierarchy. All OSPF configuration is performed within an instance, for example, the default instance or a VPN service instance. The OSPF instance configuration hierarchy includes parameters that are generic to the respective OSPF instance. The sub-hierarchies include parameters that are specific to redistribution or authentication.
Configuration Syntax and Commands
The following sections describe the OSPF configuration syntax and commands.
OSPF Instance Configuration
At this configuration hierarchy, you can configure an OSPF instance.
Syntax:
set instance <instance-name> protocol ospf
Attribute | Description |
---|---|
<instance-name> |
Name of the OSPF instance. |
OSPF Address Family Configuration
At this configuration level, you configure OSPF protocol address family. IPv4 is the currently supported address family.
You must complete configuring OSPF address family on an OSPF instance before configuring other OSPF features supported. |
Syntax
set instance <instance-name> protocol ospf address-family ipv4
Attribute | Description |
---|---|
<instance-name> |
Name of the instance |
ipv4 <ipv4> |
Address family identifier (AFI). Supported value: IPv4. |
The following example shows OSPF address family (IPv4) configuration.
Example: OSPF Instance Address Family Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4
{
"rtbrick-config:address-family": [
{
"afi-type": "ipv4",
"router-id": "198.51.100.10",
"area": [
{
"area-id": "198.51.100.0",
"interface": [
{
"name": "lo-0/0/0/1"
},
{
"name": "ifl-0/1/2/12",
"network-type": "p2p"
}
]
}
]
}
]
}
OSPF Router ID Configuration
The router ID is an IP address that OSPF uses to identify a device on the network. The router ID should be configured under the address family hierarchy.
Syntax
set instance <instance-name> protocol ospf address-family ipv4 router-id <router-id>
Attribute | Description |
---|---|
router-id <ipv4-address> |
The router ID of the routing instance. It is required to specify the router ID manually as RBFS does not pick a router ID dynamically. |
Example: OSPF Router Identifier Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4 router-id
{
"rtbrick-config:router-id": "198.51.100.15"
}
OSPF Interface Configuration
Enable OSPF protocol on the router interfaces.
Syntax:
set instance <instance-name> protocol ospf address-family ipv4 area <area-id> interface <interface-name> <options>
Attribute | Description |
---|---|
authentication |
OSPF interface authentication configuration allows enabling an authentication process before becoming neighbors. |
metric <metric> |
Specify the metric value (also known as cost which is used by the router to make routing decisions) of an OSPF interface. |
network-type <broadcast | p2p> |
broadcast - Sets the network type to broadcast; p2p - Sets the network type to point-to-point. |
router-priority <router-priority> |
Sets the router priority for an interface. Allowed range: 0 - 255, Default: 1. Routers with priority value '0' do not participate in the DR or BDR election. |
segment-routing <true | false> |
Enable or disable segment routing forwarding in OSPF. |
timer <hello | dead> |
Interface timer for configuring |
Example: OSPF Interface Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4 area 198.51.100.0 interface
{
"rtbrick-config:interface": [
{
"name": "ifl-0/0/0/1"
},
{
"name": "ifl-0/0/0/100",
"metric": 20000,
"network-type": "p2p"
},
{
"name": "ifl-0/0/1/1",
"metric": 40000,
"network-type": "p2p"
},
{
"name": "ifl-0/0/1/100",
"metric": 30000
},
{
"name": "ifl-0/0/4/1",
"metric": 60000
},
{
"name": "lo-0/0/0/1"
},
{
"name": "lo-0/0/0/2"
}
]
}
OSPF Area Configuration
A particular area is defined by its area ID.
set instance <instance-name> protocol ospf address-family ipv4 area <area-id> <options>
Attribute | Description |
---|---|
area-type |
OSPF area type. |
metric |
Area scope default metric. Range: 1 - 65535. Default: 10000. |
stub |
Stub area is an area that does not allow the entry of link-state advertisements from external routes. |
totally-stub |
Totally stub area is a type of stub area in which summary link-state advertisements (type 3 LSAs) are not allowed. |
Example: Area Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4 area 198.51.100.0
{
"rtbrick-config:area": [
{
"area-id": "198.51.100.0",
"interface": [
{
"name": "ifl-0/0/0/1"
},
{
"name": "ifl-0/0/0/100",
"metric": 20000,
"network-type": "p2p"
},
{
"name": "ifl-0/0/1/1",
"metric": 40000,
"network-type": "p2p"
},
{
"name": "ifl-0/0/1/100",
"metric": 30000
},
{
"name": "ifl-0/0/4/1",
"metric": 60000
},
{
"name": "lo-0/0/0/1"
},
{
"name": "lo-0/0/0/2"
}
]
}
]
}
OSPF Metric Configuration
Metric is the cost that OSPF uses to calculate and identify the best paths to other routers.
Syntax
set instance <instance-name> protocol ospf address-family ipv4 metric <metric>
Attribute | Description |
---|---|
metric <metric> |
OSPF interface metric. Allowed range: 1 - 65535. Default: 10000. |
Example: OSPF Metric Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4 metric
{
"rtbrick-config:metric": 1000
}
OSPF Opaque Capability Configuration
Enables opaque link-state advertisements. Routers in the OSPF network can receive and advertise Type-9, Type-10 and Type-11 opaque LSAs.
Syntax
set instance <instance-name> protocol ospf address-family ipv4 opaque-capability <options>
Attribute | Description |
---|---|
opaque-capability <true | false> |
Enable or disable opaque LSA advertisement and reception. Set as 'true' to enable the router for receiving and advertising opaque LSAs. |
Example: OSPF Opaque Capability Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4 opaque-capability
{
"rtbrick-config:opaque-capability": "true"
}
Segment Routing Configuration
Enable segment routing for OSPF. For configuring segment routing, you must enable the opaque capability by defining it as 'true'. For information, see the section: "Opaque Capability Configuration".
Syntax
set instance <instance-name> protocol ospf address-family ipv4 segment-routing <options>
Attribute | Description |
---|---|
srgb |
Segment routing global block configuration |
srgb base <value> |
Segment Routing Global Block (SRGB) start label. The SRGB is the range of label values reserved for segment routing (SR). These values are assigned as segment identifiers (SIDs) to SR-enabled network nodes and have global significance throughout the routing. |
srgb range <value> |
Segment Routing Global Block (SRGB) label range. |
status <disable | enable> |
Enable or disable the segment routing feature. |
Example: Segment routing Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4 segment-routing
{
"rtbrick-config:segment-routing": {
"status": "enable",
"srgb": {
"base": 1000,
"range": 1000
}
}
}
OSPF Redistribution Configuration
Enable route redistribution for the routes originating from other sources or protocols such as BGP
, Direct
, IPoE
, IS-IS
, PPP
, and Static
.
Syntax
set instance <instance-name> protocol ospf ipv4 redistribute <options>
Attribute | Description |
---|---|
redistribute <protocol> |
Specifies the source protocol from which the routes are to be redistributed. The available options include |
metric <metric> |
Specifies the metric value for the redistributed routes |
metric-type <type 1 | type 2> |
Specifies the external metric type for the redistributed routes. |
Example 1: Redistribution Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4 redistribute bgp
{
"rtbrick-config:redistribute": [
{
"source": "bgp",
"metric": 2000
}
]
}
OSPF Authentication Configuration
OSPF supports the following two types of authentication:
-
Clear text authentication
-
MD5 authentication: The authentication is accomplished by the exchange of an authenticating key that is known to both the sending and receiving router.
This command enables you to set Message Digest 5 (MD5) or plain text authentication for an OSPF interface.
set instance <instance-name> protocol ospf address-family ipv4 area <area-id> interface <interface-name> authentication <attribute> <value>
Attribute | Description |
---|---|
encrypted-text |
Specifies encrypted authentication key. |
key-id |
Specifies the message digest key identifier to be used by the neighboring routers for the OSPF MD5 password authentication. Allowed range: 1 - 255. |
plain-text |
Specifies authentication key in plain text format. |
type <clear_text | md5> |
Specifies the type of authentication. |
Example: OSPF Interface Authentication Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4 area 198.51.100.0 interface ifl-0/0/0/1
{
"rtbrick-config:interface": [
{
"name": "ifl-0/0/0/1",
"authentication": {
"type": "md5",
"key-id": 1,
"encrypted-text": "$2fd842673283fbff1623ba4bc2664eb5c"
}
}
]
}
ECMP Routing Configuration
ECMP (equal-cost multiple paths) routing is a mechanism in which routers forward packets to a destination using the multiple available best paths. This mechanism can increase network bandwidth substantially by load-balancing traffic through multiple best paths.
Syntax
set instance <instance-name> protocol ospf address-family ipv4 max-load-balance <value>
Attribute | Description |
---|---|
<max-load-balance> |
Maximum number of equal-cost multiple paths to be calculated for load balancing. Default: 16. Allowed range: 1 - 255. |
Example: ECMP Routing Configuration
supervisor@rtbrick>SPINE01: cfg> show config instance default protocol ospf address-family ipv4 max-load-balance
{
"rtbrick-config:max-load-balance": 100
}