IP OSPF Command on CISCO Router/Switch

Other Cisco Other Cisco Material Original source

Command

IP OSPF #

Use

Enables OSPF on an interface.

Syntax

Router(config-if)#ip ospf

Example

In this example, OSPF is enabled on int fa0/0 on R1. Before doing so, ospf is disabled at the router level on R1. The empty route table
is first displayed.

Copy

R1(config)#no router ospf 1

R1(config)#do show ip route ospf



R1(config)#

After that, ospf is then enabled directly on fa0/0.

Copy

R1(config)#int fa0/0

R1(config-if)#ip ospf 1 area 0

Finally, the route table is displayed.

Copy

R1(config-if)#do show ip route ospf

2.0.0.0/32 is subnetted, 1 subnets

O 2.2.2.2 [110/2] via 10.1.1.2, 00:00:13, FastEthernet0/0

33.0.0.0/32 is subnetted, 1 subnets

O 33.33.33.33 [110/3] via 10.1.1.2, 00:00:13, FastEthernet0/0

3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/3] via 10.1.1.2, 00:00:13, FastEthernet0/0

10.0.0.0/24 is subnetted, 3 subnets

O 10.2.2.0 [110/2] via 10.1.1.2, 00:00:13, FastEthernet0/0

133.133.0.0/32 is subnetted, 1 subnets

O 133.133.133.133 [110/3] via 10.1.1.2, 00:00:13, FastEthernet0/0
← All Other Cisco articles Home