|
This tutorial shows how to set up OSPF with two routers. The routers are connected via serial
lines. This ist the most easy connection to use, it is just the two routers on one line.
Lets take a lab of 2 routers and do some basic OSPF configuration:
Both routers just have the interface serial 1/0 and the interface loopback 0 configured. If you use the basic configuration and start the routers you can ping the other router.
The routing table of R1:
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.17.0.0/32 is subnetted, 1 subnets
C 172.17.0.1 is directly connected, Loopback0
192.168.100.0/30 is subnetted, 1 subnets
C 192.168.100.0 is directly connected, Serial1/0
Two connected routes can be seen, but no routes from dynamic routing protocols. And now for some OSPF configuration. The "network" statements specifies the interfaces on witch OSPF is to be spoken and hellos are to be send. The Loopback interface can have no neighbor, but anyway, in this beginners tutorial we use the network statement to get this interface into OSPF area 0.
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router ospf 100
R1(config-router)#network 192.168.100.1 0.0.0.0 area 0
R1(config-router)#network 172.17.0.1 0.0.0.0 area 0
R1(config-router)#end
R2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 100
R2(config-router)#network 192.168.100.2 0.0.0.0 area 0
R2(config-router)#network 172.17.0.2 0.0.0.0 area 0
R2(config-router)#end
The two routers should have become adjacend. The console log messeages of the two show this. And as always there are show commands to use for verification. R1 has one OSPF neighbor, connected via the serial line.
* %OSPF-5-ADJCHG: Process 100, Nbr 172.17.0.2 on Serial1/0 from LOADING to FULL, Loading Done
* %OSPF-5-ADJCHG: Process 100, Nbr 172.17.0.1 on Serial1/0 from LOADING to FULL, Loading Done
R1#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
172.17.0.2 0 FULL/ - 00:00:30 192.168.100.2 Serial1/0
A look at the routing table of R1 shows one new route, the loopback interface of R2, which is learned via OSPF. The serial line is still shown as connected route. The "Administrative Distance" of a connected route is less than any OSPF route.
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
172.17.0.0/32 is subnetted, 2 subnets
C 172.17.0.1 is directly connected, Loopback0
O 172.17.0.2 [110/65] via 192.168.100.2, 00:08:32, Serial1/0
192.168.100.0/30 is subnetted, 1 subnets
C 192.168.100.0 is directly connected, Serial1/0
R1 and R2 are now adjacent, a FULL neighborship has been established and routes are beeing exchanged. Some more "show" commands reveal more details of this OSPF neighborship.
On each interface that is running OSPF details can bee seen using the "show ip ospf interface interfacename" command.
R1#show ip ospf interface serial 1/0
Serial1/0 is up, line protocol is up
Internet Address 192.168.100.1/30, Area 0
Process ID 100, Router ID 172.17.0.1, Network Type POINT_TO_POINT, Cost: 64
Transmit Delay is 1 sec, State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 172.17.0.2
Suppress hello for 0 neighbor(s)
The OSPF learned route 172.17.0.2 in detail. The route comes from OSPF 100 and the next hop is 192.168.100.2.
R1#show ip route 172.17.0.2
Routing entry for 172.17.0.2/32
Known via "ospf 100", distance 110, metric 65, type intra area
Last update from 192.168.100.2 on Serial1/0, 00:01:38 ago
Routing Descriptor Blocks:
* 192.168.100.2, from 172.17.0.2, 00:01:38 ago, via Serial1/0
Route metric is 65, traffic share count is 1
Save this configuration, it will be used as a base for other tutorials on this website. The configuration for this tutorial can be downloaded from here.
|