Configure OSPF on the CLI
Learn how to configure OSPF (Open Shortest Path First) routing through the command-line interface. Find out how to enter OSPF configuration mode, specify a unique router ID, define networks and areas, and apply optional settings, such as adjacency change logging.
Note
When you apply Global configuration settings through the web admin console, the firewall removes any CLI configurations that conflict with those settings.
Configure OSPF
To configure OSPF, do as follows:
-
To enter the OSPF configuration mode, enter the following options:
- For Route configuration: 3
- For Configure unicast routing: 1
- For OSPF: 2
-
Run the following commands:
- Enter the global configuration mode:
enable - Enter the OSPF configuration mode:
conf torconfigure terminal - Start the OSPF configuration:
router ospf -
(Optional) Enter the router ID:
ospf router-id <number or IP address>.- Use the IPv4 address format, for example,
12.13.14.15. - It doesn't need to be a valid IP address in your routing domain.
- It must be unique within your routing domain.
- You can't use
0.0.0.0.
Note
If you don't enter a value, the firewall uses the highest interface IP address.
- Use the IPv4 address format, for example,
-
Configure the network address, its netmask, and the area:
network <ip-address/netmask> area <area-id>The area ID defines an area in the network. On the CLI, you can use one of the following options:
- A number from 0 to 4294967295
- IP address format, for example,
1.2.3.4
Note
OSPF is turned on for the interfaces belonging to the network's subnets, and adjacency with neighbors is established.
The firewall stores the IP address based on the netmask you specify. For example, if you enter
11.11.11.11/24, it's stored as11.11.11.0/24. -
(Optional) To generate logs when a neighbor becomes available or unavailable without turning on debug mode:
log-adjacency-changesWhen you configure OSPF from the web admin console, this command is applied by default.
-
To save the configuration:
write - To see the OSPF configuration:
show running-config - To exit the router configuration mode:
end -
To go back to the router management menu:
exitExample
ospf> enable ospf# conf t ospf(config)# router ospf ospf(config-router)# ospf router-id 12.13.14.15 ospf(config-router)# network 11.11.11.11/24 area 1000 ospf(config-router)# log-adjacency-changes ospf(config-router)# exit ospf(config)# write
- Enter the global configuration mode: