Objective

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).

Applicable Devices | Software Version

- Catalyst 1300X Series | 4.10.0.82

Introduction

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.

Configuration of OSPF via CLI

Step 1

Connect to the Catalyst 1300X switch via console, SSH, or Telnet and enter global configuration mode.

Switch#configure terminal

Step 2

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

Step 3

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.

Step 4

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

Step 5

To turn on logging adjacency changes, use the command log adjacency changes.

Switch(config-ospf)#log adjacency changes

Step 6

On the C1300X switch, interface configuration is done on the IP interface.

Switch(config)#interface ip 192.168.200.254

Step 7

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

Step 8 (Optional)

To set OSPF cost on an interface, use the command ip ospf cost (value).

Switch(config-ip)#ip ospf cost 100

Step 9

Set the interface as passive if it should not send or receive OSPF packets.

Switch(config-ip)#ip ospf passive-interface

Configure Multi-Area OSPF

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.

Step 1

To create a normal area, add an interface to another area ID.

Switch(config-ospf)#area 0.0.0.1

Step 2

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

Step 3

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

OSPFv2 Show Commands

Here is a list of show commands that you can use to help troubleshoot OSPFv2.

- show ip ospf – general OSPF information

- show ip ospf neighbor – neighbor information on a per-interface basis

- show ip ospf neighbor detail – detailed neighbor information

- show ip ospf database – information about the OSPF Database

- show ip ospf database router – information about Router LSAs

- show ip ospf database network – Information about Network LSAs

- show ip ospf database summary – Information about summary LSAs

- show ip ospf database as-summary – information about ASBR Summary LSAs

- show ip ospf database as-external – Information about External LSAs

- show ip ospf database nssa-external – Only information about NSSA External LSAs

- show ip ospf interface – Information about the ospf interfaces

- show ip ospf interface brief – a brief overview of ospf interface information

- show ip ospf virtual-links – information about any configured Virtual Links

- show ip ospf snmp – OSPF SNMP configuration

- show ip ospf router-id – show an ospf process and its router-ID

- show ip route – show the IPv4 routing table

- show ip route ospf – shows routes distributed from OSPF

OSPFv3 Configuration

OSPFv3 is used for IPv6 routing. The configuration is similar to that of OSPFv2 configuration with a few differences.

Step 1

Enable IPv6 routing by running the command ipv6 unicast-routing from global config mode.

Switch(config)#ipv6 unicast-routing

Step 2

Create OSPFv3 process by running the command ipv6 router ospf (process ID).

Switch(config)#ipv6 router ospf 1

Step 3

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

Step 4

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

Step 5

The command to clear the OSPF process is clear ipv6 ospf process.

switch(config-if)#clear ipv6 ospf process

OSPFv3 Show Commands

- Show ipv6 ospf

- Show ipv6 ospf neighbor

- Show ipv6 ospf neighbor detail

- Show ipv6 ospf database

- Show ipv6 ospf database adv-router

- Show ipv6 ospf database external

- Show ipv6 ospf database inter-area-prefix

- Show ipv6 ospf database inter-area-router

- Show ipv6 ospf database link

- Show ipv6 ospf database network

- Show ipv6 ospf database nssa-external

- Show ipv6 ospf database router

- Show ipv6 ospf database prefix

- Show ipv6 ospf interface

- Show ipv6 ospf interface brief

- Show ipv6 ospf virtual-links

- Show ipv6 ospf snmp

- Show ipv6 ospf router-id

- Show ipv6 route – show the ipv6 routing table

- Show ipv6 route ospf – show the OSPFv3 routes

Conclusion

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.