Basic OSPF Configuration Tasks

To configure OSPF on a PicOS device, complete the tasks described in the following sections.

Configuring OSPF Router ID

The OSPF router ID is a 32-bit value similar to an IP address by which the OSPF router or switch is uniquely identified within the OSPF domain. 

Use the following command to configure OSPF router ID:

set protocols ospf router-id <router-id>

The following example configures 1.1.1.1 as the OSPF router ID:

admin@XorPlus# set protocols ospf router-id 1.1.1.1
admin@XorPlus# commit
Commit OK.
Save done.

Do not change the router ID after completing the configuration.

Configuring OSPF Areas

Divide an OSPF domain into areas, which contains the flow of most routing protocol traffic within a single area and reduces the impact of protocol on CPU and memory.

Use the following command to configure OSPF areas:

set protocols ospf area <area-id> area-type <type>

Area ID 0.0.0.0 is reserved for the backbone and each OSPF domain must have the backbone area. All traffic between two non-backbone areas must pass through the backbone area. OSPF area types supported by PicOS are: normal, stub, and NSSA. A normal or standard area in OSPF is one that is configured neither as Stub nor NSSA.

The example that follows demonstrates configuration of three different areas:

Area IDArea Type
0.0.0.0Normal
1.1.1.1Stub
2.2.2.2

NSSA

admin@XorPlus# set protocols ospf area 0.0.0.0
admin@XorPlus# set protocols ospf area 1.1.1.1 area-type stub
admin@XorPlus# set protocols ospf area 2.2.2.2 area-type nssa
admin@XorPlus# commit
Commit OK.
Save done.

Configuring OSPF Interfaces

After configuring OSPF areas, assign a switch interface to the area. Once an interface is assigned to an OSPF area, it will start sending OSPF hello messages.

Use the following command to assign a Layer 3 interface to an OSPF area, where the Layer 3 interface can be the VLAN interface, loopback interface, routed interface or sub-interface:

set protocol ospf interface <interface-name> area {<ipv4>|<0-4294967295>}

The following commands create Layer 3 VLAN interfaces vlan20 and vlan30. The interfaces are given IP addresses and switch ports are assigned to them. Finally, both interfaces are configured to be in the OSPF backbone area according to the table shown below.

VLAN InterfaceIP Address / Mask LengthAssigned Switch Interface(s)OSPF Area
vlan2010.10.70.10 / 24ge-1/1/10.0.0.0
vlan3010.10.71.10 / 24ge-1/1/20.0.0.0


admin@XorPlus# set vlans vlan-id 20 l3-interface vlan20
admin@XorPlus# set vlans vlan-id 30 l3-interface vlan30
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 20
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 30
admin@XorPlus# set l3-interface vlan-interface vlan20 address 10.10.70.10 prefix-length 24
admin@XorPlus# set l3-interface vlan-interface vlan30 address 10.10.71.10 prefix-length 24
admin@XorPlus# set protocols ospf interface vlan20 area 0.0.0.0
admin@XorPlus# set protocols ospf interface vlan30 area 0.0.0.0
admin@XorPlus# commit
Commit OK.
Save done.
admin@XorPlus#

Configuring Additional OSPF Parameters

Fine-tune OSPF operation by configuring additional OSPF interface parameters including hello interval, interface cost, passive interface, BFD, router dead interval, MD5 authentication and MD5 key.

The following example demonstrates how to configure some of the OSPF interface parameters:

admin@XorPlus# set protocols ospf interface vlan20 hello-interval 5
admin@XorPlus# set protocols ospf interface vlan20 cost 8
admin@XorPlus# set protocols ospf interface vlan20 dead-interval 120
admin@XorPlus# commit
Commit OK.
Save done.

Copyright © 2024 Pica8 Inc. All Rights Reserved.