This objective of this article is to provide a comprehensive guide to configuring Open Shortest Path First (OSPF) routing protocols on Cisco Catalyst 1300X series switches using the Command Line Interface (CLI).
Open Shortest Path First (OSPF) is a widely used link-state routing protocol that enables dynamic routing and efficient path selection in IP networks. On Cisco Catalyst 1300X series switches, OSPFv2 is supported for IPv4 routing and OSPFv3 for IPv6 routing providing robust scalability, fast convergence, and support for hierarchical network design through areas. For more information on OSPF, check out the article Understanding OSPF in Catalyst 1300X Switches.
Configuring OSPF on these switches allows for automatic route advertisement, redundancy, and optimal traffic flow. Key features include support for single and multi-area deployments, interface-specific settings such as cost and authentication, and advanced troubleshooting and verification capabilities. This article details the CLI-based configuration process, ensuring a secure and resilient OSPF deployment tailored to the Catalyst 1300X platform.
Connect to the Catalyst 1300X switch via console, SSH, or Telnet and enter global configuration mode.
Switch#configure terminal
Create an OSPFv2 process by running router ospf followed by the process ID (example: router ospf 1). This will take you to the config-ospf prompt.
Switch(config)#router ospf 1
Set the router ID by entering router-id and the four-digit dotted decimal notation router ID.
Switch(config-ospf)#router-id 100.100.100.100
If you do not set the router-id, it will either use the loopback ip address or if there is no loopback interface, the highest IP address on a physical interface or Switch Virtual Interface (SVI) will be used.
It is highly recommended to set the router id as interfaces may go up or down, and may cause excess traffic as new neighbor relationships are formed.
Add networks to your OSPF areas. The syntax is network (IP address of the physical interface or VLAN) area (Area ID in four-digit dotted decimal notation).
For example, to add the 192.168.10.1 network to area 0:
Switch(config-ospf)#network 192.168.10.1 area 0.0.0.0
To turn on logging adjacency changes, use the command log adjacency changes.
Switch(config-ospf)#log adjacency changes
On the C1300X switch, interface configuration is done on the IP interface.
Switch(config)#interface ip 192.168.200.254
Once you are in config-ip mode, you can configure settings using the ip ospf commands. You can set authentication settings, costs, timings, and configure passive interfaces.
Switch(config-ip)#ip ospf
To set OSPF cost on an interface, use the command ip ospf cost (value).
Switch(config-ip)#ip ospf cost 100
Set the interface as passive if it should not send or receive OSPF packets.
Switch(config-ip)#ip ospf passive-interface
You can configure multiple areas on your OSPF network to control your Link State Database (LSDB) size and to take advantage of route summarization and other options.
To create a normal area, add an interface to another area ID.
Switch(config-ospf)#area 0.0.0.1
To set Area 1 as a stub area, the command would be area 0.0.0.1 stub.
Switch(config-ospf)#area 0.0.0.1 stub
If you want to create a route summarization for all networks in the 10.100.0.0/16 range, the command would be area 0.0.0.1 range 10.100.0.0 255.255.0.0.
Switch(config-ospf)#area 0.0.0.1 range 10.100.0.0 255.255.0.0
Here is a list of show commands that you can use to help troubleshoot OSPFv2.
OSPFv3 is used for IPv6 routing. The configuration is similar to that of OSPFv2 configuration with a few differences.
Enable IPv6 routing by running the command ipv6 unicast-routing from global config mode.
Switch(config)#ipv6 unicast-routing
Create OSPFv3 process by running the command ipv6 router ospf (process ID).
Switch(config)#ipv6 router ospf 1
Set the router ID by entering router-id and the four-digit dotted decimal notation router ID.
switch(config-ipv6-ospf)#router-id x.x.x.x
Add IPv6 networks in interface config mode or IP interface config mode.
Examples include:
switch(config)#interface te 1/0/1
switch(config-if)#no switchport
To assign static IPv6 address:
switch(config-if)#ipv6 address 2008:1:2:1000::1/64
To obtain IPv6 address from a router advertisement or DHCPv6:
switch(config-if)#ipv6 enable
switch(config-if)#ipv6 router ospf 1 area 0.0.0.0
The command to clear the OSPF process is clear ipv6 ospf process.
switch(config-if)#clear ipv6 ospf process
Now you know the steps to configure OSPF on the Catalyst 1300X series switches via CLI.
Refer to the Catalyst 1300X CLI Guide for more information on OSPF feature in Catalyst 1300X series switches.
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
24-Nov-2025
|
Initial Release |