Configure OSPF+Virtual link+Summarize+Default Route

อัพเดตเมื่อ: ส.ค. 22

จาก Network Diagram ทำการตั้งค่าบน Router ตามหัวข้อดังต่อไปนี้

1. ทำการ Check Pre-Configure ของ R1, R2 และ R3 พร้อมทั้ง Check ความพร้อมต่างๆ

2. ทำการเพิ่ม Configure OSPF

3. ทำการ Configure virtual link

4. ทำการ Configure OSPF Summarize area

5. ทำการ Configure Generate a default route into OSPF

Task and Configuration

1. ทำการ Check Pre-Configure ของ R1, R2 และ R3 พร้อมทั้ง Check ความพร้อมต่างๆ


1.1 ที่ Router R1

R1#show running-config
hostname R1
!
!
interface Loopback1
 description Engineering Department
 ip address 10.1.1.1 255.255.255.0
!
interface Loopback30
 ip address 172.30.30.1 255.255.255.252
!
interface Ethernet0/0
 ip address 10.1.12.1 255.255.255.0
!
!
!
end
 
R1#
!
R1#show ip interface brief | e un
Interface        IP-Address     OK? Method  Status           Protocol
Ethernet0/0      10.1.12.1      YES manual  up               up
Loopback1        10.1.1.1       YES manual  up               up
Loopback30       172.30.30.1    YES manual  up               up
 

1.2 ที่ Router R2


R2#show running-config
!
hostname R2
!
interface Loopback2
 description Marketing Department
 ip address 10.1.2.1 255.255.255.0
!
interface Ethernet0/0
 ip address 10.1.12.2 255.255.255.0
!
interface Ethernet0/1
 ip address 10.1.23.2 255.255.255.0
!
end
R2#show ip interface brief | e un
Interface         IP-Address    OK? Method Status             Protocol
Ethernet0/0       10.1.12.2     YES manual up                 up
Ethernet0/1       10.1.23.2     YES manual up                 up
Loopback2         10.1.2.1      YES manual up                 up

1.3 ที่ Router R3


R3#show running-config
hostname R3
!
interface Loopback3
 description Accounting Department
 ip address 10.1.3.1 255.255.255.0
!
interface Loopback100
 ip address 192.168.100.1 255.255.255.0
!
interface Loopback101
 ip address 192.168.101.1 255.255.255.0
!
interface Loopback102
 ip address 192.168.102.1 255.255.255.0
!
interface Loopback103
 ip address 192.168.103.1 255.255.255.0
!
interface Ethernet0/0
 no ip address
 shutdown
!
interface Ethernet0/1
 ip address 10.1.23.3 255.255.255.0
!
end
R3#show ip interface brief | e un
Interface        IP-Address       OK? Method Status           Protocol
Ethernet0/1      10.1.23.3        YES manual up               up
Loopback3        10.1.3.1         YES manual up               up
Loopback100      192.168.100.1    YES manual up               up
Loopback101      192.168.101.1    YES manual up               up
Loopback102      192.168.102.1    YES manual up               up
Loopback103      192.168.103.1    YES manual up               up

2. ทำการเพิ่ม Configure OSPF


2.1. ตั้งค่า OSPF process 1 และ OSPF router ID บน router R1 R2 และ R3 โดยการใช้คำสั่ง network และทำการ configure subnet ของ ethernet link ระหว่าง R1 และ R2 ให้อยู่ใน OSPF area 0 แล้วทำการเพิ่ม loopback 1 บน router R1 และ loopback 2 บน router R2 ให้อยู่ใน OSPF area 0 เช่นกัน


ตั้งค่า OSPF process 1 และ OSPF router ID บน router R1

 R1#conf t
 Enter configuration commands, one per line. End with CNTL/Z.
 R1(config)#router ospf 1
 R1(config-router)#router-id 1.1.1.1
 R1(config-router)#network 10.1.12.0 0.0.0.255 area 0
 R1(config-router)#network 10.1.1.0 0.0.0.255 area 0
 R1(config-router)#exit
 R1(config)#interface loopback 1
 R1(config-if)#ip ospf network point-to-point
 R1(config-if)#end
 

2.2. ใช้คำสั่ง show ip ospf เพื่อตรวจสอบ OSPF router ID โดย OSPF router ID จะเป็นค่า 32-bit หากเป็นค่าอื่นๆ ที่ไม่ใช่ค่าที่ได้กำหนดเข้าไป เราสามารถทำการ reset โดยใช้คำสั่ง Cleaar ip ospf pid process

 R1#show ip ospf
 Routing Process "ospf 1" with ID 1.1.1.1  ----> Router ID คือ 1.1.1.1
 Start time: 00:23:13.687, Time elapsed: 00:01:15.158
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 Supports area transit capability
 Supports NSSA (compatible with RFC 3101)
 Supports Database Exchange Summary List Optimization (RFC 5243)
 Event-log enabled, Maximum number of events: 1000, Mode: cyclic
 Router is not originating router-LSAs with maximum metric
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs
 Incremental-SPF disabled
 Minimum LSA interval 5 secs
 Minimum LSA arrival 1000 msecs
 LSA group pacing timer 240 secs
 Interface flood pacing timer 33 msecs
 Retransmission pacing timer 66 msecs
 Number of external LSA 0. Checksum Sum 0x000000
 Number of opaque AS LSA 0. Checksum Sum 0x000000
 Number of DCbitless external and opaque AS LSA 0
 Number of DoNotAge external and opaque AS LSA 0
 Number of areas in this router is 1. 1 normal 0 stub 0 nssa
 
 ตั้งค่า OSPF process 1 และ OSPF router ID บน router R2
 
 R2(config)#router ospf 1
 R2(config-router)#router-id 2.2.2.2
 R2(config-router)#network 10.1.12.0 0.0.0.255 area 0
 R2(config-router)#network 10.1.2.0 0.0.0.255 area 0
 R2(config-router)#exit
 R2(config)#interface loopback 2
 R2(config-if)#ip ospf network point-to-point
 R2(config-if)#end
 
R2#
*Nov 1 18:13:43.670: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Nov 1 18:13:48.996: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Ethernet0/0 from LOADING to FULL, Loading Done
R2#

2.3 ทำการตรวจสอบว่าสามารถเห็น Router OSPF เพื่อนบ้านหรือไม่ โดยใช้คำสั่ง show ip ospf neighbor บน router ทั้งสองตัว และใช้คำสั่ง show ip route เพื่อตรวจสอบว่า routing สามารถเห็น loopback ของกันและกันหรือไม่




 R1#show ip ospf neighbor
 
Neighbor ID     Pri     State      Dead Time    Address    Interface
2.2.2.2         1       FULL/BDR   00:00:34     10.1.12.2  Ethernet0/0
 
 R1#show ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is not set
 
 10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Loopback1
L 10.1.1.1/32 is directly connected, Loopback1
O 10.1.2.0/24 [110/11] via 10.1.12.2, 00:02:32, Ethernet0/0
C 10.1.12.0/24 is directly connected, Ethernet0/0
L 10.1.12.1/32 is directly connected, Ethernet0/0
 172.30.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.30.30.0/30 is directly connected, Loopback30
L 172.30.30.1/32 is directly connected, Loopback30
 
 R2#show ip ospf neighbor
 
 
Neighbor ID     Pri     State     Dead Time     Address     Interface
1.1.1.1         1       FULL/DR   00:00:33      10.1.12.1   Ethernet0/0
 
 R2#show ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is not set
 
 10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O 10.1.1.0/24 [110/11] via 10.1.12.1, 00:03:24, Ethernet0/0
C 10.1.2.0/24 is directly connected, Loopback2
L 10.1.2.1/32 is directly connected, Loopback2
C 10.1.12.0/24 is directly connected, Ethernet0/0
L 10.1.12.2/32 is directly connected, Ethernet0/0
C 10.1.23.0/24 is directly connected, Ethernet0/1
L  10.1.23.2/32 is directly connected, Ethernet0/1

2.4. ทำการเพิ่ม subnet ระหว่าง R2 และ R3 เข้าไปยัง OSPF area 23 โดยใช้คำสั่ง network พร้อมทั้งเพิ่ม Interface loopback 3 บน router R3 เข้าไปยัง area 23




 R2(config)#router ospf 1
 R2(config-router)#network 10.1.23.0 0.0.0.255 area 23
 
 R3(config)#router ospf 1
 R3(config-router)#router-id 3.3.3.3
 R3(config-router)#network 10.1.23.0 0.0.0.255 area 23
 R3(config-router)#network 10.1.3.0 0.0.0.255 area 23
 R3(config-router)#exit
 R3(config)#interface loopback 3
 R3(config-if)#ip ospf network point-to-point
 

2.5. ตรวจสอบความสัมพันธ์ระหว่างเพื่อนบ้านด้วยคำสั่ง show ip ospf neighbors

R2#show ip ospf neighbor
 
Neighbor ID     Pri     State     Dead Time     Address     Interface
1.1.1.1         1       FULL/DR   00:00:34      10.1.12.1   Ethernet0/0
3.3.3.3         1       FULL/BDR  00:00:37      10.1.23.3   Ethernet0/1

ตรวจสอบ Routing Table ที่ Router R3



R3#show ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is not set
 
 10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O IA 10.1.1.0/24 [110/21] via 10.1.23.2, 00:01:09, Ethernet0/1
O IA 10.1.2.0/24 [110/11] via 10.1.23.2, 00:01:09, Ethernet0/1
C 10.1.3.0/24 is directly connected, Loopback3
L 10.1.3.1/32 is directly connected, Loopback3
O IA 10.1.12.0/24 [110/20] via 10.1.23.2, 00:01:09, Ethernet0/1
C 10.1.23.0/24 is directly connected, Ethernet0/1
L 10.1.23.3/32 is directly connected, Ethernet0/1
 192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.100.0/24 is directly connected, Loopback100
L 192.168.100.1/32 is directly connected, Loopback100
 192.168.101.0/24 is variably subnetted, 2 subnets, 2 masks
C  192.168.101.0/24 is directly connected, Loopback101
L 192.168.101.1/32 is directly connected, Loopback101
 192.168.102.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.102.0/24 is directly connected, Loopback102
L 192.168.102.1/32 is directly connected, Loopback102
 192.168.103.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.103.0/24 is directly connected, Loopback103
L 192.168.103.1/32 is directly connected, Loopback103
 
 
R1(config)#interface ethernet 0/0
R1(config-if)#ip ospf network point-to-point
 
R1(config-if)#
*Nov 1 18:21:43.507: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Ethernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Nov 1 18:21:43.507: %OSPF-4-NET_TYPE_MISMATCH: Received Hello from 2.2.2.2 on Ethernet0/0 indicating a potential
 network type mismatch
R1(config-if)#
*Nov 1 18:21:43.508: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Ethernet0/0 from LOADING to FULL, Loading Done
R1(config-if)#
 
R1#show ip ospf neighbor
 
Neighbor ID     Pri     State     Dead Time     Address     Interface
2.2.2.2         0       FULL/ -   00:00:35      10.1.12.2   Ethernet0/0
 
R1#sh ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is not set
 
 10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Loopback1
L 10.1.1.1/32 is directly connected, Loopback1
C 10.1.12.0/24 is directly connected, Ethernet0/0
L 10.1.12.1/32 is directly connected, Ethernet0/0
 172.30.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.30.30.0/30 is directly connected, Loopback30
L 172.30.30.1/32 is directly connected, Loopback30
R1#
 
R2(config)#interface ethernet 0/0
R2(config-if)#ip ospf network point-to-point
 
R2(config-if)#
*Nov 1 18:23:48.757: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Ethernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
*Nov 1 18:23:48.759: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Ethernet0/0 from LOADING to FULL, Loading Done
R2(config-if)#
 
R2#show ip ospf neighbor
  
Neighbor ID     Pri     State     Dead Time     Address     Interface
1.1.1.1         0       FULL/ -   00:00:34      10.1.12.1   Ethernet0/0
3.3.3.3         1       FULL/BDR  00:00:32      10.1.23.3   Ethernet0/1
 
R2#show ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is not set
 
 10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O 10.1.1.0/24 [110/11] via 10.1.12.1, 00:01:08, Ethernet0/0
C 10.1.2.0/24 is directly connected, Loopback2
L 10.1.2.1/32 is directly connected, Loopback2
O 10.1.3.0/24 [110/11] via 10.1.23.3, 00:05:23, Ethernet0/1
C 10.1.12.0/24 is directly connected, Ethernet0/0
L 10.1.12.2/32 is directly connected, Ethernet0/0
C 10.1.23.0/24 is directly connected, Ethernet0/1
L 10.1.23.2/32 is directly connected, Ethernet0/1
 
R1#sh ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is not set
 
 10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Loopback1
L 10.1.1.1/32 is directly connected, Loopback1
O 10.1.2.0/24 [110/11] via 10.1.12.2, 00:00:50, Ethernet0/0
O IA 10.1.3.0/24 [110/21] via 10.1.12.2, 00:00:50, Ethernet0/0
C 10.1.12.0/24 is directly connected, Ethernet0/0
L 10.1.12.1/32 is directly connected, Ethernet0/0
O IA 10.1.23.0/24 [110/20] via 10.1.12.2, 00:00:50, Ethernet0/0
 172.30.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.30.30.0/30 is directly connected, Loopback30
L 172.30.30.1/32 is directly connected, Loopback30 

3. ทำการ Configure virtual link


3.1. ประกาศ loopback Interface ตั้งแต่ 100 ถึง 103 บน router R3 ให้อยู่ใน OSPF process 1 area 100 โดยใช้คำสั่ง network และทำการเปลี่ยน network type เป็น network point-to-point



 R3(config)#router ospf 1
 R3(config-router)#network 192.168.100.0 0.0.3.255 area 100
 R3(config-router)#exit
 R3(config)#interface loopback 100
 R3(config-if)#ip ospf network point-to-point
 R3(config-if)#interface loopback 101
 R3(config-if)#ip ospf network point-to-point
 R3(config-if)#interface loopback 102
 R3(config-if)#ip ospf network point-to-point
 R3(config-if)#interface loopback 103
 R3(config-if)#ip ospf network point-to-point

3.2. ใช้คำสั่ง show ip route บน router R2


R2#show ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
  a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is not set
 
 10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O 10.1.1.0/24 [110/11] via 10.1.12.1, 00:03:42, Ethernet0/0
C 10.1.2.0/24 is directly connected, Loopback2
L 10.1.2.1/32 is directly connected, Loopback2
O 10.1.3.0/24 [110/11] via 10.1.23.3, 00:07:57, Ethernet0/1
C 10.1.12.0/24 is directly connected, Ethernet0/0
L 10.1.12.2/32 is directly connected, Ethernet0/0
C 10.1.23.0/24 is directly connected, Ethernet0/1
L 10.1.23.2/32 is directly connected, Ethernet0/1

ปรากฎว่าไม่พบ Route ของ Loopback Interface ตั้งแต่ 100 ถึง 103 บน router R3 เนื่องจาก Loopback ดังกล่าถูกประกาศให้อยู่น Area ที่ไม่ได้เชื่อมต่อกับ Backbone Area หรือ Area ซึ่งใน LAB นี้จะแก้ปัญหาด้วยการสร้าง Virtual link ระหว่าง R2 และ R3


3.3. ก่อนที่จะสร้าง virtual link เราจำเป็นต้องระบุ OSPF router ID ให้ router ที่เกี่ยวข้องกัน (R2 และ R3) โดยใช้คำสั่ง show ip ospf, show ip protocols หรือ show ip ospf interface เพื่อตรวจสอบ router ID


 R2#show ip ospf
 
 Routing Process "ospf 1" with ID 2.2.2.2
<output omitted>
 
 R3#show ip ospf
 
 Routing Process "ospf 1" with ID 3.3.3.3
<output omitted>

3.4. ทำการสร้าง virtual บน R2 และ R3 link ด้วยคำสั่ง area transit_area virtual-link router-id


R2#conf t
 
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#area 23 virtual-link 3.3.3.3
 
 
R3(config)#router ospf 1
R3(config-router)#area 23 virtual-link 2.2.2.2
 
R3(config-router)#
*Nov 1 18:34:58.798: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on OSPF_VL0 from LOADING to FULL, Loading Done
R3(config-router)#

3.5. ใช้คำสั่ง show ip route บน router R2 และพิจารณาเส้นทางจาก area 100 ทั้งนี้เราสามารถตรวจสอบ virtual link ด้วยการใช้คำสั่ง show ip ospf neighbor และ show ip ospf interface


R2#show ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is not set
 
 10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O 10.1.1.0/24 [110/11] via 10.1.12.1, 00:11:42, Ethernet0/0
C 10.1.2.0/24 is directly connected, Loopback2
L 10.1.2.1/32 is directly connected, Loopback2
O 10.1.3.0/24 [110/11] via 10.1.23.3, 00:15:57, Ethernet0/1
C 10.1.12.0/24 is directly connected, Ethernet0/0
L 10.1.12.2/32 is directly connected, Ethernet0/0
C 10.1.23.0/24 is directly connected, Ethernet0/1
L 10.1.23.2/32 is directly connected, Ethernet0/1
O IA 192.168.100.0/24 [110/11] via 10.1.23.3, 00:00:28, Ethernet0/1
O IA 192.168.101.0/24 [110/11] via 10.1.23.3, 00:00:28, Ethernet0/1
O IA 192.168.102.0/24 [110/11] via 10.1.23.3, 00:00:28, Ethernet0/1
O IA 192.168.103.0/24 [110/11] via 10.1.23.3, 00:00:28, Ethernet0/1
 
R2# show ip ospf neighbor
  
Neighbor ID     Pri     State     Dead Time     Address     Interface
3.3.3.3         0       FULL/ -   -             10.1.23.3   OSPF_VL0
1.1.1.1         0       FULL/ -   00:00:31      10.1.12.1   Ethernet0/0
3.3.3.3         1       FULL/BDR  00:00:35      10.1.23.3   Ethernet0/1
 
R2#show ip ospf interface
 
OSPF_VL0 is up, line protocol is up
 Internet Address 10.1.23.2/24, Area 0, Attached via Not Attached
 Process ID 1, Router ID 2.2.2.2, Network Type VIRTUAL_LINK, Cost: 10
 Topology-MTID Cost Disabled Shutdown Topology Name
 0 10 no no Base
 Configured as demand circuit
 Run as demand circuit
 DoNotAge LSA allowed
 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:03
<output omitted>


4. ทำการ Configure OSPF Summarize area


4.1. ทำการ configure router R3 (ABR) เพื่อ summarize area โดยใช้คำสั่ง area area range network mask


 R3(config)#router ospf 1
 R3(config-router)#area 100 range 192.168.100.0 255.255.252.0
 

4.2. เราสามารถดู summarize route บน router R2 ด้วยคำสั่ง show ip route และ show ip ospf database


R2#show ip route
 
<output omitted>
 10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O 10.1.1.0/24 [110/11] via 10.1.12.1, 00:21:41, Ethernet0/0
C 10.1.2.0/24 is directly connected, Loopback2
L 10.1.2.1/32 is directly connected, Loopback2
O 10.1.3.0/24 [110/11] via 10.1.23.3, 00:25:56, Ethernet0/1
C 10.1.12.0/24 is directly connected, Ethernet0/0
L 10.1.12.2/32 is directly connected, Ethernet0/0
C 10.1.23.0/24 is directly connected, Ethernet0/1
L 10.1.23.2/32 is directly connected, Ethernet0/1
O IA 192.168.100.0/22 [110/11] via 10.1.23.3, 00:00:44, Ethernet0/1
 

R2#
R2#
R2#show ip ospf database
 
OSPF Router with ID (2.2.2.2) (Process ID 1)
 
Router Link States (Area 0)
 
Link ID     ADV Router     Age    Seq#       Checksum Link count
1.1.1.1     1.1.1.1        1484   0x80000003 0x007141 3
2.2.2.2     2.2.2.2        688    0x80000006 0x008BD1 4
3.3.3.3     3.3.3.3        1 (DNA)0x80000002 0x00DD03 1
 
Summary Net Link States (Area 0)
 
Link ID       ADV Router    Age     Seq#       Checksum
10.1.3.0      2.2.2.2       1608    0x80000001 0x000C10
10.1.3.0      3.3.3.3       6 (DNA) 0x80000001 0x008998
10.1.23.0     2.2.2.2       1674    0x80000001 0x0025E3
10.1.23.0     3.3.3.3       6 (DNA) 0x80000001 0x0007FD
192.168.100.0 3.3.3.3       1 (DNA) 0x80000002 0x00263E
 
Router Link States (Area 23)
 
Link ID      ADV Router     Age      Seq#       Checksum Link count
2.2.2.2      2.2.2.2        688      0x80000003 0x00F5D4 1
3.3.3.3      3.3.3.3        689      0x80000005 0x007A26 2
 
Net Link States (Area 23)
 
Link ID      ADV Router      Age      Seq#       Checksum
10.1.23.2    2.2.2.2         1613     0x80000001 0x009D5C
 
Summary Net Link States (Area 23)
 
Link ID       ADV Router      Age      Seq#       Checksum
10.1.1.0      2.2.2.2         1353     0x80000001 0x0022FB
10.1.2.0      2.2.2.2         1679     0x80000001 0x00B274
10.1.12.0     2.2.2.2         1679     0x80000001 0x009E75
192.168.100.0 3.3.3.3         102      0x80000002 0x00263E
R2#

4.3. สังเกต router R3 ว่า OSPF ได้สร้าง summary route ที่มีค่าเข้าสู่ Null0 (LAB นี้ไม่ได้อธิบายเหตุผลของ Null0)


R3#show ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is not set
 
 10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O 10.1.1.0/24 [110/21] via 10.1.23.2, 00:02:56, Ethernet0/1
O 10.1.2.0/24 [110/11] via 10.1.23.2, 00:02:56, Ethernet0/1
C 10.1.3.0/24 is directly connected, Loopback3
L 10.1.3.1/32 is directly connected, Loopback3
O 10.1.12.0/24 [110/20] via 10.1.23.2, 00:02:56, Ethernet0/1
C 10.1.23.0/24 is directly connected, Ethernet0/1
L 10.1.23.3/32 is directly connected, Ethernet0/1
O 192.168.100.0/22 is a summary, 00:02:56, Null0
 192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.100.0/24 is directly connected, Loopback100
L 192.168.100.1/32 is directly connected, Loopback100
 192.168.101.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.101.0/24 is directly connected, Loopback101
L  192.168.101.1/32 is directly connected, Loopback101
 192.168.102.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.102.0/24 is directly connected, Loopback102
L 192.168.102.1/32 is directly connected, Loopback102
 192.168.103.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.103.0/24 is directly connected, Loopback103
L 192.168.103.1/32 is directly connected, Loopback103


5. ทำการ Configure Generate a default route into OSPF


5.1. ใช้คำสั่ง default-information originate always ที่ router R1 เพื่อสร้าง default route


ทั้งนี้ ถ้าเราไม่ใส่ keyword “always” default route จะถูกสร้างและประกาศยัง OSPF ก็ต่อเมื่อเคยมีอยู่ใน routing table เท่านั้น


 R1#conf t
 Enter configuration commands, one per line. End with CNTL/Z.
 R1(config)#router ospf 1
 R1(config-router)#default-information originate always

ตรวจสอบว่า default route นั้นปรากฎบน router R2 และ R3 หรือไม่ โดยใช้คำสั่ง show ip route


R2#show ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is 10.1.12.1 to network 0.0.0.0
 
O*E2 0.0.0.0/0 [110/1] via 10.1.12.1, 00:00:46, Ethernet0/0
 10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
O 10.1.1.0/24 [110/11] via 10.1.12.1, 00:26:25, Ethernet0/0
C 10.1.2.0/24 is directly connected, Loopback2
L 10.1.2.1/32 is directly connected, Loopback2
O 10.1.3.0/24 [110/11] via 10.1.23.3, 00:30:40, Ethernet0/1
C 10.1.12.0/24 is directly connected, Ethernet0/0
L 10.1.12.2/32 is directly connected, Ethernet0/0
C 10.1.23.0/24 is directly connected, Ethernet0/1
L 10.1.23.2/32 is directly connected, Ethernet0/1
O IA 192.168.100.0/22 [110/11] via 10.1.23.3, 00:05:28, Ethernet0/1
 
R3#show ip route
 
Codes: L - local, 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, H - NHRP, l - LISP
 a - application route
 + - replicated route, % - next hop override
 
Gateway of last resort is 10.1.23.2 to network 0.0.0.0
 
O*E2 0.0.0.0/0 [110/1] via 10.1.23.2, 00:01:15, Ethernet0/1
 10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O 10.1.1.0/24 [110/21] via 10.1.23.2, 00:06:02, Ethernet0/1
O 10.1.2.0/24 [110/11] via 10.1.23.2, 00:06:02, Ethernet0/1
C 10.1.3.0/24 is directly connected, Loopback3
L 10.1.3.1/32 is directly connected, Loopback3
O 10.1.12.0/24 [110/20] via 10.1.23.2, 00:06:02, Ethernet0/1
C 10.1.23.0/24 is directly connected, Ethernet0/1
L 10.1.23.3/32 is directly connected, Ethernet0/1
O 192.168.100.0/22 is a summary, 00:06:02, Null0
 192.168.100.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.100.0/24 is directly connected, Loopback100
L 192.168.100.1/32 is directly connected, Loopback100
 192.168.101.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.101.0/24 is directly connected, Loopback101
L 192.168.101.1/32 is directly connected, Loopback101
 192.168.102.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.102.0/24 is directly connected, Loopback102
L 192.168.102.1/32 is directly connected, Loopback102
 192.168.103.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.103.0/24 is directly connected, Loopback103
L 192.168.103.1/32 is directly connected, Loopback103

5.2. ทำการ ping ไปยัง interface ที่เชื่อมต่อไปยัง internet ที่ R1 จะพบว่าสามารถ ping ได้แม้ว่าจะไม่เคยถูกประกาศเข้าไปใน OSPF เลยก็ตาม


R3#ping 172.30.30.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.30.30.1, timeout is 2 seconds:
!!!!!

  
Full Configuration
Router R1

R1#show running-config
 hostname R1
 !
 !
 interface Loopback1
  description Engineering Department
  ip address 10.1.1.1 255.255.255.0
  ip ospf network point-to-point
 !
 interface Loopback30
  ip address 172.30.30.1 255.255.255.252
 !
 interface Ethernet0/0
  ip address 10.1.12.1 255.255.255.0
  ip ospf network point-to-point
 !
 !
 router ospf 1
  router-id 1.1.1.1
  network 10.1.1.0 0.0.0.255 area 0
  network 10.1.12.0 0.0.0.255 area 0
  default-information originate always
 !
 End
 
 
Router R2
 
R2#show running-config
 hostname R2
 !
 !
 interface Loopback2
  description Marketing Department
  ip address 10.1.2.1 255.255.255.0
  ip ospf network point-to-point
 !
 interface Ethernet0/0
  ip address 10.1.12.2 255.255.255.0
  ip ospf network point-to-point
 !
 interface Ethernet0/1
  ip address 10.1.23.2 255.255.255.0
 !
 !
 router ospf 1
  router-id 2.2.2.2
  area 23 virtual-link 3.3.3.3
  network 10.1.2.0 0.0.0.255 area 0
  network 10.1.12.0 0.0.0.255 area 0
  network 10.1.23.0 0.0.0.255 area 23
 !
 End
 
 
Router R3
 
R3#show running-config
 hostname R3
 !
 !
 interface Loopback3
  description Accounting Department
  ip address 10.1.3.1 255.255.255.0
  ip ospf network point-to-point
 !
 interface Loopback100
  ip address 192.168.100.1 255.255.255.0
  ip ospf network point-to-point
 !
 interface Loopback101
  ip address 192.168.101.1 255.255.255.0
  ip ospf network point-to-point
 !
 interface Loopback102
  ip address 192.168.102.1 255.255.255.0
  ip ospf network point-to-point
 !
 interface Loopback103
  ip address 192.168.103.1 255.255.255.0
  ip ospf network point-to-point
 !
 interface Ethernet0/0
  no ip address
  shutdown
 !
 interface Ethernet0/1
  ip address 10.1.23.3 255.255.255.0
 !
 interface Ethernet0/2
  no ip address
  shutdown
 !
 interface Ethernet0/3
  no ip address
  shutdown
 !
 router ospf 1
  router-id 3.3.3.3
  area 23 virtual-link 2.2.2.2
  area 100 range 192.168.100.0 255.255.252.0
  network 10.1.3.0 0.0.0.255 area 23
  network 10.1.23.0 0.0.0.255 area 23
  network 192.168.100.0 0.0.3.255 area 100
 !
 !
 end
 


หวังว่าน่าจะได้ความรู้ในส่วนของการตั้งค่า กันไปนะครับ


แล้วเจอกันบทความต่อไปครับ


ขอบคุณแหล่งที่มา www.cisco.com, www.ine.com, และ เอกสาร LAB Cisco Networking Academy


กลับสู่ด้านบน


ดู 149 ครั้ง
  • Facebook
  • Twitter
  • YouTube
  • Tumblr Social Icon
  • Instagram

Tel. 087-449-6954, 094-417-8544 | Email : sale@9huatraining.com | Facebook : 9HUA Training