Configure OSPF
The OSPF basic configuration is very simple and requires only two steps:
- enable OSPF on a router using the router ospf PROCESS-ID global configuration command.
- define on which interfaces OSPF will run and what networks will be advertised with the network IP_ADDRESS WILDCARD_MASK AREA command in the OSPF configuration mode.
Let’s get started with some basic OSPF configuration. Here is our example network:
We have a network of two routers and two hosts. To configure routers to use OSPF and exchange topology information, we first need to enable OSPF on both routers. We then need to define which networks will be advertised into OSPF. This can be done by using the following set of commands on R1 and R2:
The network commands entered on two routers include their directly connected subnets. We can verify that the routers have have established a neighbor relationship by typing the show ip ospf neighbor command on R1:
To verify that the topology information were exchanged, we can use the show ip route ospf command on R1:
Note that the OSPF routes are marked with the O character. In the output above you can see that R1 has learned about the network 192.168.0.0/24.