|
This tutorial shows how to set up OSPF with two areas on three routers. The routers are connected via serial lines. This ist the most easy connection to use.
Lets take a lab of 3 routers and do some basic OSPF configuration.
If you use the basic configuration and start the routers you can ping the other router.
The goal of the tutorial is to configure 2 ospf areas with IPv4. The configuration made here will be used as a basis for more tutorials later on.
Tasks:
- Use OSPF process 100 for the lab.
- Set the router id to the address of the loopback interface.
- Put the R1 loopback 0 and the serial connection between R1 and R2 into area 0.
- The loopback 0 interfaces of R2 and R3 go into area 10.
- The serial connection between R2 and R3 goes into area 10
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router ospf 100
R1(config-router)#router-id 172.17.0.1
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)#router-id 172.17.0.2
R2(config-router)#network 192.168.100.2 0.0.0.0 area 0
R2(config-router)#end
The routers are adjacend and R2 know about the loopback 0 interface of R1 via OSPF. Setting the router id manually is good practice and should always be done. Otherwise the router id is taken from interfaces and can change. This could break late configurations that depend on the router id.
R2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 100
R2(config-router)#network 172.17.0.2 0.0.0.0 area 10
R2(config-router)#network 192.168.100.5 0.0.0.0 area 10
R2(config-router)#end
R3#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#router ospf 100
R3(config-router)#router-id 172.17.0.3
R3(config-router)#network 192.168.100.6 0.0.0.0 area 10
R3(config-router)#network 172.17.0.3 0.0.0.0 area 10
R3(config-router)#end
After this configuration the routers R2 and R3 also have become adjacend and have exchanged routes. The routing table on R1 shows the routes from R2 and R3 as OSPF routes. These routes are marked with "IA" as OSPF inter area routes.
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, 3 subnets
C 172.17.0.1 is directly connected, Loopback0
O IA 172.17.0.3 [110/129] via 192.168.100.2, 00:04:10, Serial1/0
O IA 172.17.0.2 [110/65] via 192.168.100.2, 00:05:40, Serial1/0
192.168.100.0/30 is subnetted, 2 subnets
O IA 192.168.100.4 [110/128] via 192.168.100.2, 00:05:30, Serial1/0
C 192.168.100.0 is directly connected, Serial1/0
The routing table on R3 shows the routes from R1 as "IA" routes.
R3#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, 3 subnets
O IA 172.17.0.1 [110/129] via 192.168.100.5, 00:05:25, Serial1/1
C 172.17.0.3 is directly connected, Loopback0
O 172.17.0.2 [110/65] via 192.168.100.5, 00:05:25, Serial1/1
192.168.100.0/30 is subnetted, 2 subnets
C 192.168.100.4 is directly connected, Serial1/1
O IA 192.168.100.0 [110/128] via 192.168.100.5, 00:05:25, Serial1/1
Final Configuration :
R1
R2
R3
|