Before we configure OSPF on a router, we need to know some key point about OSPF. OSPF has three step to became operational.
· Neighbor-ship
· LSDBs exchange
· Route calculation
Neighbor-ship: When a router gets started(bootup), she first communicates with other router directly connected with her. If the “AREA ID”, “AUTHENTICATION”, “HELLO” and “DEAD intervals” match, then they become neighbor.
LSDBs exchange: in this state routers exchange there Link State Data Base (LSDB) about routes. This process has various steps in it(not going into that).
Route Calculation: OSPF use Dijkstra algorithm to calculate Shortest path.
You just learn lill bit of OSPF fundamentals. Now get into configuration of OSPF
I’m assuming, that you already have configured various ports with respective ip address and its subnets and you have knowledge about Wildcard Mask, do you?
as you can see, that I’m using cisco 2811 router on each lan. From the right: goto the routers CLI-> goto the global configuration mode. in the global configuration mode.
- type “Router ospf 1”
- type “Network 172.16.0.1 0.0.0.3 area 0” for directly connected LAN 1.
- again “Network 192.168.1.1 0.0.0.3 area 0” for directly connected WAN 1.
Now comes to the middle one router:goto the routers CLI-> goto global configuration mode.
- type “Router ospf 1”
- type “Network 172.16.0.5 0.0.0.3 area 0” for the LAN (LAN2 )connected with Fast Ethernet.
- type “Network 192.168.1.2 0.0.0.3 area 0” for the left-side Wan link.
- type “Network 192.168.1.5 0.0.0.3 area 0” for the right-side Wan Link.
Now the router on the right side:goto the routers CLI-> goto global configuration mode. in the global configuration mode.
- type “Router ospf 1”
- type “Network 192.168.1.6 0.0.0.3 area 0” for lefthand side WAN link.
- type “Network 172.16.0.9 0.0.0.3 area 0” for directly connected Lan3.
Now we are done . you can test those connection by pinging each other devices together.
Remember, I used block size of four for each lan and wan, so of that my wildcard mask 0.0.0.3 . you can chose different block size according to your needs. But, do not forget to change the wildcard mask according to block size in “Network” command line.