CHƯƠNG TRÌNH ỨNG DỤNG

Một phần của tài liệu Tìm hiểu các giao thức định tuyến trên nền công nghệ cisco (Trang 86 - 104)

DEMO VÀI PHƯƠNG PHÁP ROUTING THÔNG DỤNG TRÊN NỀN ĐỊNH TUYẾN CỦA CISCO

Trở lại với bài toán của công ty bảo hiểm A, ta chọn hai phương pháp tiêu biểu đại diện cho hai giao thức dạng distance vector và link state:

Giao thức dạng distance vector: ta chọn RIP. Giao thức dạng link state: ta chọn OSPF.

Mô hình của công ty bảo hiểm A.

Phần 1.

RIP (ROUTING INFORMATION PROTOCOL)

Cấu hình RIP trên các router.

Ta chọn RIP Timer: thời gian update là 5 giây, thời gian invalid là 15 giây, thời gian holddown là 15 giây, thời gian flush time là 30 giây.

Ta xem bảng định tuyến của các router: RouterA#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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

R 192.168.4.0/24 [120/1] via 192.168.2.2, 00:00:03, Serial0 R 192.168.5.0/24 [120/2] via 192.168.2.2, 00:00:03, Serial0 C 192.168.1.0/24 is directly connected, Ethernet0

C 192.168.2.0/24 is directly connected, Serial0

R 192.168.3.0/24 [120/1] via 192.168.2.2, 00:00:03, Serial0

Bảng định tuyến của router A.

Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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.4.0/24 is directly connected, Serial0

R 192.168.5.0/24 is possibly down, routing via 192.168.4.2, Serial0 R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:04, Serial1

C 192.168.2.0/24 is directly connected, Serial1 C 192.168.3.0/24 is directly connected, Ethernet0

Bảng định tuyến của router B.

RouterC#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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.4.0/24 is directly connected, Serial1 C 192.168.5.0/24 is directly connected, Ethernet0

R 192.168.1.0/24 [120/2] via 192.168.4.1, 00:00:03, Serial1 R 192.168.2.0/24 [120/1] via 192.168.4.1, 00:00:03, Serial1 R 192.168.3.0/24 [120/1] via 192.168.4.1, 00:00:03, Serial1

RouterB#show ip protocols

Routing Protocol is "rip"

Sending updates every 5 seconds, next due in 2 seconds Invalid after 15 seconds, hold down 15, flushed after 30 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Redistributing: rip

Default version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chain Ethernet0 1 1 2 (adsbygoogle = window.adsbygoogle || []).push({});

Serial0 1 1 2 Serial1 1 1 2 Automatic network summarization is in effect Maximum path: 4

Routing for Networks: 192.168.2.0

192.168.3.0 192.168.4.0

Routing Information Sources:

Gateway Distance Last Update 192.168.2.1 120 00:00:04 192.168.4.2 120 00:00:21 Distance: (default is 120)

Ta xem quá trình cập nhật định tuyến trên router C: RouterC#debug ip rip

RIP protocol debugging is on RouterC#

RIP: received v1 update from 192.168.4.1 on Serial1 00:38:11: 192.168.1.0 in 2 hops

00:38:11: 192.168.2.0 in 1 hops 00:38:11: 192.168.3.0 in 1 hops

00:38:16: RIP: received v1 update from 192.168.4.1 on Serial1 00:38:16: 192.168.1.0 in 2 hops

00:38:16: 192.168.2.0 in 1 hops 00:38:16: 192.168.3.0 in 1 hops

00:38:17:RIP: sending v1 update to 255.255.255.255 via Ethernet0 (192.168.5.1) 00:38:17: RIP: build update entries

00:38:17: network 192.168.1.0 metric 3 00:38:17: network 192.168.2.0 metric 2 00:38:17: network 192.168.3.0 metric 2 00:38:17: network 192.168.4.0 metric 1

00:38:17: RIP: sending v1 update to 255.255.255.255 via Serial1 (192.168.4.2) 00:38:17: RIP: build update entries

00:38:17: network 192.168.5.0 metric 1

00:38:20: RIP: received v1 update from 192.168.4.1 on Serial1 00:38:20: 192.168.1.0 in 2 hops

00:38:20: 192.168.2.0 in 1 hops 00:38:20: 192.168.3.0 in 1 hops

RouterC#debug ip rip events

RIP event debugging is on RouterC#

00:39:08:RIP: sending v1 update to 255.255.255.255 via Ethernet0 (192.168.5.1) 00:39:08: RIP: Update contains 4 routes

00:39:08: RIP: Update queued

00:39:08: RIP: sending v1 update to 255.255.255.255 via Serial1 (192.168.4.2) 00:39:09: RIP: Update contains 1 routes

00:39:09: RIP: Update queued

00:39:09: RIP: Update sent via Ethernet0 00:39:09: RIP: Update sent via Serial1

00:39:11: RIP: received v1 update from 192.168.4.1 on Serial1 00:39:11: RIP: Update contains 3 routes

Ta xem tiến trình cập nhật cơ sở dữ liệu định tuyến RIP của router C:

RouterC#debug ip rip database

RIP database events debugging is on RouterC#

00:27:31: RIP-DB: network_update with 192.168.1.0/24 succeeds

00:27:31: RIP-DB: adding 192.168.1.0/0 (metric 2) via 192.168.4.1 on Serial1 to RIP database (adsbygoogle = window.adsbygoogle || []).push({});

00:27:31: RIP-DB: network_update with 192.168.2.0/24 succeeds

00:27:31: RIP-DB: adding 192.168.2.0/0 (metric 1) via 192.168.4.1 on Serial1 to RIP database

00:27:31: RIP-DB: network_update with 192.168.3.0/24 succeeds

00:27:31: RIP-DB: adding 192.168.3.0/0 (metric 1) via 192.168.4.1 on Serial1 to RIP database

00:27:36: RIP-DB: network_update with 192.168.1.0/24 succeeds

00:27:36: RIP-DB: adding 192.168.1.0/0 (metric 2) via 192.168.4.1 on Serial1 to RIP database

00:27:36: RIP-DB: network_update with 192.168.2.0/24 succeeds

00:27:36: RIP-DB: adding 192.168.2.0/0 (metric 1) via 192.168.4.1 on Serial1 to RIP database

00:27:36: RIP-DB: network_update with 192.168.3.0/24 succeeds

00:27:36: RIP-DB: adding 192.168.3.0/0 (metric 1) via 192.168.4.1 on Serial1 to RIP database

Phần 2. OSPF (OPEN SHORTEST PATH FIRST)

Ta cấu hình OSPF trên các router:

Cấu hình OSPF trên các router.

Trên router A:

Mạng 192.168.1.0 trên interface E0 của router A thuộc vùng stub nên ta phải cấu hình area 1 là stub: area 1 stub. Vùng stub có đặc điểm là không nhận các thông tin từ bên ngoài (external LSA) mà chỉ nhận các thông tin tóm tắt từ các vùng khác (summary LSA) hoặc là các thông tin mặc định. Vì vậy, địa chỉ 192.168.2.1 va 192.168.2.2 phải được tóm tắt lại thành mạng 192.168. 2.0 với 24 bit subnet mask để đưa vào vùng stub.

Trên router B:

Trong OSPF, tất cả các area khác phải kết nối trực tiếp với area 0 hoặc kết nối qua virtual-link với area mà trực tiếp kết nối với area 0. Trong trường hợp này area 1 và area 2 kết nối trực tiếp với area 0, còn area 3 không kết nối trực tiếp với area 0, cho nên nó sẽ tạo một kết nối virtual-link với area 2. Và area 2 cũng kết nối virtual link lại đến area 3: area 2 virtual-link 192.168.5.1. Địa chỉ 192.168.5.1 chính là router ID của router 3.

Trên router C:

Area 3 tạo kết nối virtual link với area 2: area 2 virtual-link 192.168.4.1. Địa chỉ 192.168.4.1 chính là router ID của router 2.

Ta xem bảng định tuyến của các router:

RouterA#show ip route

Codes: C - connected, S – static, I - IGRP, 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, E - EGP i - IS-IS, 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

O IA 192.168.4.0/24 [110/132] via 192.168.2.2, 00:01:08, Serial0 O IA 192.168.5.0/24 [110/142] via 192.168.2.2, 00:01:08, Serial0 C 192.168.1.0/24 is directly connected, Ethernet0

C 192.168.2.0/24 is directly connected, Serial0

O IA 192.168.3.0/24 [110/76] via 192.168.2.2, 00:01:08, Serial0

RouterB#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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.4.0/24 is directly connected, Serial0 (adsbygoogle = window.adsbygoogle || []).push({});

O IA 192.168.5.0/24 [110/76] via 192.168.4.2, 00:02:21, Serial0 O IA 192.168.1.0/24 [110/76] via 192.168.2.1, 00:02:21, Serial1 C 192.168.2.0/24 is directly connected, Serial1

C 192.168.3.0/24 is directly connected, Ethernet0

Bảng định tuyến của router B.

RouterC#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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.4.0/24 is directly connected, Serial1 C 192.168.5.0/24 is directly connected, Ethernet0

O IA 192.168.1.0/24 [110/142] via 192.168.4.1, 00:00:04, Serial1 O 192.168.2.0/24 [110/132] via 192.168.4.1, 00:00:04, Serial1 O 192.168.3.0/24 [110/76] via 192.168.4.1, 00:00:04, Serial1

Ta xem giao thức IP mà router C đang sử dụng:

RouterC# show ip protocols

Routing Protocol is "ospf 64"

Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 192.168.5.1

It is an area border router

Number of areas in this router is 3. 3 normal 0 stub 0 nssa Maximum path: 4

Routing for Networks: 192.168.4.0 0.0.0.3 area 2 192.168.5.0 0.0.0.255 area 3 Routing Information Sources:

Gateway Distance Last Update 192.168.2.1 110 00:00:18 192.168.5.1 110 00:00:18 192.168.4.1 110 00:00:18 Distance: (default is 110)

Xem thông tin về OSPF và các area: RouterC#show ip ospf 64

Routing Process "ospf 64" with ID 192.168.5.1 Supports only single TOS(TOS0) routes Supports opaque LSA

It is an area border router

SPF schedule delay 5 secs, Hold time between two SPFs 10 secs Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs Number of external LSA 0. Checksum Sum 0x0

Number of opaque AS LSA 0. Checksum Sum 0x0 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 3. 3 normal 0 stub 0 nssa External flood list length 0

Area BACKBONE(0)

Number of interfaces in this area is 1 Area has no authentication

SPF algorithm executed 50 times Area ranges are

Number of LSA 34. Checksum Sum 0xB8341

Number of opaque link LSA 0. Checksum Sum 0x0 Number of DCbitless LSA 0

Number of indication LSA 0 Number of DoNotAge LSA 30 Flood list length 0

Area 2

Number of interfaces in this area is 1 Area has no authentication

SPF algorithm executed 44 times Area ranges are (adsbygoogle = window.adsbygoogle || []).push({});

Number of LSA 28. Checksum Sum 0xC66FD

Number of opaque link LSA 0. Checksum Sum 0x0 Number of DCbitless LSA 0

Number of indication LSA 0 Number of DoNotAge LSA 0 Flood list length 0

Area 3

Number of interfaces in this area is 1 Area has no authentication

SPF algorithm executed 34 times Area ranges are

Number of opaque link LSA 0. Checksum Sum 0x0 Number of DCbitless LSA 0

Number of indication LSA 0 Number of DoNotAge LSA 0 Flood list length 0

Xem thông tin OSPF về các router biên: RouterC#sh ip ospf border-routers

OSPF Process 64 internal Routing Table Codes: i - Intra-area route, I - Inter-area route

i 192.168.2.1 [132] via 192.168.4.1, Serial1, ABR, Area 0, SPF 50 i 192.168.4.1 [66] via 192.168.4.1, Serial1, ABR, Area 0, SPF 50 I 192.168.4.1 [66] via 192.168.4.1, Serial1, ABR, Area 2, SPF 44

Xem thông tin về router láng giềng OSPF: RouterC# sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface 192.168.4.1 1 FULL/ - 00:00:25 192.168.4.1 Serial1

Xem virtual link của router C: RouterC#sh ip ospf virtual-links

Virtual Link OSPF_VL2 to router 192.168.4.1 is up Run as demand circuit

DoNotAge LSA allowed.

Transit area 2, via interface Serial1, Cost of using 66 Transmit Delay is 1 sec, State POINT_TO_POINT,

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 00:00:06

Adjacency State FULL (Hello suppressed)

Index 1/2, retransmission queue length 0, number of retransmission 0 First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)

Last retransmission scan length is 0, maximum is 0

Xem thông tin về OSPF và các area: RouterC#show ip ospf 64

Routing Process "ospf 64" with ID 192.168.5.1 Supports only single TOS(TOS0) routes Supports opaque LSA

It is an area border router

SPF schedule delay 5 secs, Hold time between two SPFs 10 secs Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs Number of external LSA 0. Checksum Sum 0x0

Number of opaque AS LSA 0. Checksum Sum 0x0 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 3. 3 normal 0 stub 0 nssa External flood list length 0

Area BACKBONE(0)

Number of interfaces in this area is 1 Area has no authentication

SPF algorithm executed 50 times Area ranges are

Number of LSA 34. Checksum Sum 0xB8341 (adsbygoogle = window.adsbygoogle || []).push({});

Number of opaque link LSA 0. Checksum Sum 0x0 Number of DCbitless LSA 0

Number of indication LSA 0 Number of DoNotAge LSA 30 Flood list length 0

Area 2

Number of interfaces in this area is 1 Area has no authentication

SPF algorithm executed 44 times Area ranges are

Number of LSA 28. Checksum Sum 0xC66FD

Number of opaque link LSA 0. Checksum Sum 0x0 Number of DCbitless LSA 0

Number of indication LSA 0 Number of DoNotAge LSA 0 Flood list length 0

Area 3

SPF algorithm executed 34 times Area ranges are

Number of LSA 5. Checksum Sum 0x18F29

Number of opaque link LSA 0. Checksum Sum 0x0 Number of DCbitless LSA 0

Number of indication LSA 0 Number of DoNotAge LSA 0 Flood list length 0

Xem cơ sở dữ liệu OSPF trên router C:

OSPF Router with ID (192.168.5.1) (Process ID 64) Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count 192.168.2.1 192.168.2.1 16 (DNA) 0x80000010 0x5021 2 192.168.4.1 192.168.4.1 5 (DNA) 0x80000020 0xE448 3 192.168.5.1 192.168.5.1 43 0x8000000E 0x9A8A 1

Summary Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum 192.168.1.0 192.168.2.1 2 (DNA) 0x80000001 0x114B 192.168.3.0 192.168.4.1 10 (DNA) 0x80000007 0xE071 192.168.3.0 192.168.5.1 49 0x80000001 0x7C98 192.168.4.0 192.168.4.1 11 (DNA) 0x80000001 0x140B 192.168.4.0 192.168.5.1 49 0x80000001 0xD11 192.168.5.0 192.168.5.1 49 0x80000001 0xCF85

Router Link States (Area 2)

Link ID ADV Router Age Seq# Checksum Link count 192.168.4.1 192.168.4.1 57 0x80000013 0x7C62 3

192.168.5.1 192.168.5.1 51 0x8000001B 0x5605 2 Summary Net Link States (Area 2)

Link ID ADV Router Age Seq# Checksum 192.168.1.0 192.168.4.1 61 0x80000001 0x997E 192.168.1.0 192.168.5.1 41 0x80000001 0x29AB 192.168.2.0 192.168.4.1 61 0x80000001 0x2AF6 192.168.2.0 192.168.5.1 41 0x80000001 0xB924 192.168.5.0 192.168.4.1 41 0x80000001 0x6DA6 192.168.5.0 192.168.5.1 45 0x8000000A 0xBD8E

Router Link States (Area 3)

Link ID ADV Router Age Seq# Checksum Link count 192.168.5.1 192.168.5.1 51 0x80000008 0x22B1 1

Summary Net Link States (Area 3)

Link ID ADV Router Age Seq# Checksum 192.168.1.0 192.168.5.1 41 0x80000001 0x29AB 192.168.2.0 192.168.5.1 42 0x80000001 0xB924 192.168.3.0 192.168.5.1 53 0x80000001 0x7C98 192.168.4.0 192.168.5.1 53 0x80000001 0xD11

Trong tương lai, khi các công ty mở rộng hệ thống mạng, lúc đó hệ thống mạng sẽ rất phức tạp và ta phải tính toán lại việc sử dụng các giao thức sao cho vừa tiết kiệm địa chỉ, tài nguyên mạng và băng thông lại vừa có hiệu quả. Khi đó giao thức OSPF rất thích hợp cho việc mở rộng mạng.

1. CCIE PROFESSIONAL DEVELOPMENT ROUTING TCP/ IP Volume 1– Jeff Dolye, CCIE# 1919.

2. CNNP BSCI Exam Certification Guide Third Edition – Cleare Gough

3. CCNP LabPro Routing Verion 7.5 – Đặng Quang Minh, CCIE#11897, 2004. (adsbygoogle = window.adsbygoogle || []).push({});

Một phần của tài liệu Tìm hiểu các giao thức định tuyến trên nền công nghệ cisco (Trang 86 - 104)