Girai Kaku

先延ばしと爆睡のバランスが得意です

github twitter keybase email
Multiple Area OSPF
Dec 15, 2016
3 minutes read
Requirements
  • GNS3
  • Cisco IOS image(c3725-adventerprisek9-mz.124-15.T5 in this example)
Topology

Multiple Area OSPF

Goals
  • Set up R2 as Area Border Router (ABR)
  • Designate OSPF summarization for three Loopback interfaces on R3
PC Setting
PC1(config)#no ip routing
PC1(config)#ip default-gateway 172.16.1.254
PC1(config)#interface fastEthernet 0/0
PC1(config-if)#ip address 172.16.1.1 255.255.255.0
PC1(config-if)#no shutdown
PC1(config-if)#exit
Router Setting

First, configure interfaces for each router

On R1

R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 172.16.1.254 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit

R1(config)#interface serial 1/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit

R1(config)#interface loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#exit

On R2

R2(config)#interface serial 1/0
R2(config-if)#clock rate 64000
R2(config-if)#ip address 192.168.12.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#interface serial 1/1
R2(config-if)#clock rate 64000
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#interface loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.255
R2(config-if)#exit

On R3

R3(config)#interface serial 1/0
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit

R3(config)#interface loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
R3(config-if)#exit

R3(config)#interface loopback 1
R3(config-if)#ip address 172.16.32.1 255.255.255.0
R3(config-if)#exit

R3(config)#interface loopback 2
R3(config-if)#ip address 172.16.33.1 255.255.255.0
R3(config-if)#exit

R3(config)#interface loopback 3
R3(config-if)#ip address 172.16.34.1 255.255.255.0
R3(config-if)#exit

Then, apply Multiple Area OSPF

On R1

R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 172.16.1.0 0.0.0.255 area 0
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R1(config-router)#exit

On R2

R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.168.12.0 0.0.0.255 area 0
R2(config-router)#network 192.168.23.0 0.0.0.255 area 1
R2(config-router)#exit

On R3

R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 192.168.23.0 0.0.0.255 area 1
R3(config-router)#network 172.16.32.1 0.0.0.0 area 1
R3(config-router)#network 172.16.33.1 0.0.0.0 area 1
R3(config-router)#network 172.16.34.1 0.0.0.0 area 1
R3(config-router)#exit

In this case, Loopback interfaces on R3 are treated as stub hosts. To adjust subnet musk to /24

R3(config)#interface loopback 1
R3(config-if)#ip ospf network point-to-point
R3(config-if)#exit

R3(config)#interface loopback 2
R3(config-if)#ip ospf network point-to-point
R3(config-if)#exit

R3(config)#interface loopback 3
R3(config-if)#ip ospf network point-to-point
R3(config-if)#exit

Finally, optimize OSPF summarization

R2(config)#router ospf 1
R2(config-router)#area 1 range 172.16.32.0 255.255.252.0
R2(config-router)#exit
Check Routing Information

On R1

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

C    192.168.12.0/24 is directly connected, Serial1/0
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
O IA    172.16.32.0/22 [110/129] via 192.168.12.2, 00:39:42, Serial1/0
C       172.16.1.0/24 is directly connected, FastEthernet0/0
O IA 192.168.23.0/24 [110/128] via 192.168.12.2, 00:47:03, Serial1/0(s)
Connectivity Test

On PC1

PC1#ping 172.16.32.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.32.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/130/136 ms

Back to posts


comments powered by Disqus