To configure OSPF on a PicOS device, complete the tasks described in the following sections.
Configuring OSPF Router ID
...
Use the following command to configure OSPF router ID:
set protocols ospf4 ospf router-id <router-id>
The following example configures 1.1.1.1 as the OSPF router ID:
Code Block |
---|
admin@XorPlus# set protocols ospf4ospf 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 ospf4 area <area-id> area-type <type>
Area ID 0.0.0.0 is reserved for the backbone and each OSPF domain should have the backbone area. All traffic between two non-backbone areas must pass through the backbone. OSPF area types supported by PicOS are: normal, stub, and NSSA.
The example that follows demonstrates configuration of three different areas:
Area ID | Area Type |
---|---|
0.0.0.0 | Normal |
1.1.1.1 | Stub |
2.2.2.2 | NSSA |
Code Block |
---|
admin@XorPlus# set protocols ospf4ospf area 0.0.0.0 area-type normal admin@XorPlus# set protocols ospf4ospf area 1.1.1.1 area-type stub admin@XorPlus# set protocols ospf4ospf area 2.2.2.2 area-type nssa admin@XorPlus# commit Commit OK. Save done. |
Configuring OSPF Interfaces
After configuring an OSPF areaareas, 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:
set protocols ospf4 area <area-id> interface <interface-name> vif <interface-name> address <ip-address>protocol ospf interface <vlan-interface> vif <vlan-interface> area {<ipv4>|<0-4294967295>}
The following commands create Layer 3 VLAN interfaces vlan-2 and vlan-3. The interfaces are given IP addresses and switch ports are assiged assigned to them. Finally, both interfaces are configured to be in the OSPF backbone area according to the table shown below.
VLAN Interface | IP Address / Mask Length | Assigned Switch Interface(s) | OSPF Area |
---|---|---|---|
vlan- |
20 | 10.10. |
70. |
10 / 24 | ge-1/1/1 | 0.0.0.0 |
vlan- |
30 | 10.10. |
71. |
10 / 24 | ge-1/1/2 | 0.0.0.0 |
Code Block |
---|
admin@XorPlus# set protocols ospf router-id 4.4.4.4 admin@XorPlus# set vlans vlan-id 220 l3-interface vlan-220 admin@XorPlus# set vlans vlan-id 330 l3-interface vlan-330 admin@XorPlus# set vlan-interface interface vlan-220 vif vlan-220 address 10.10.6070.10 prefix-length 24 admin@XorPlus# set vlan-interface interface vlan-330 vif vlan-330 address 10.10.6171.10 prefix-length 24 admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 220 admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 330 admin@XorPlus# set protocols ospf4 area 0.0.0.0 ospf interface vlan-220 vif vlan-220 addressarea 100.100.600.100 admin@XorPlus# set protocols ospf4 area 0.0.0.0ospf interface vlan-330 vif vlan-330 addressarea 100.100.610.100 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. admin@XorPlus# |
...
Fine-tune OSPF operation by configuring additional OSPF interface parameters including hello interval, interface cost, passive interface, priority, retransmit intervalBFD, router dead interval, MD5 authentication and transmit delayMD5 key.
The following example demonstrates how to configure some of the OSPF interface parameters:
Code Block |
---|
admin@XorPlus# set protocols ospf4 area 0.0.0.0ospf interface vlan-220 vif vlan-2 address 10.10.60.10 20 hello-interval 5 admin@XorPlus# set protocols ospf4 area 0.0.0.0 ospf interface vlan-220 vif vlan-2 address 10.10.60.10 20 interface-cost 8 admin@XorPlus# set protocols ospf4 area 0.0.0.0 ospf interface vlan-220 vif vlan-2 address 10.10.60.10 transmit-delay 220 dead-interval 120 admin@XorPlus# commit Waiting for merging configuration. Commit OK. Save done. |