REDISTRIBUTE GIA RIP và IGRP

Một phần của tài liệu Quản trị mạng lan wan CCNA trọn bộ phần 1 (Trang 108 - 119)

Trong bài lab này, chúng ta s c u hình đ hai m ng - m t s d ng RIP version 1, m t s ng d ng IGRP - liên l c đ c v i nhau b ng cách phân ph i các route qua l i gi a các giao th c.

RIP version 1 và IGRP c hai đ u là lo i DISTANCE VECTOR. Tuy nhiên hai giao th c này có nhi u đi m khác nhau nh :

RIP IGRP

Th i gian Update 30 giây 90 giây

Tính metric d a vào Hop count B ng thông (bandwidth), đ tr (delay), đ tin c y (reliability), đ ng t i (load), MTU Giá tr Infinite-Metric 16 4294967295

2. Các l nh s d ng trong bài :

defaultmetric bandwidth delay reliability loading mtu

C u hình giá tr metric cho t t c các route đ c phân ph i vào IGRP, EIGRP, OSPF, BGP, EGP

redistribute protocol [process−id] {level−1 | level−1−2 | level−2} [metric

metric−value]

Phân ph i các route t m t giao th c vào m t giao th c khác

route-map map-tag [permit | deny] [sequence-number]

nh ngh a đi u ki n đ phân ph i route t m t giao th c vào giao th c khác

match ip address {access-list-number [access-list-number... | access-list-

name...]|access-list-name [access-list-number...| access-list-name] | prefix-list prefix-

list-name [prefix-list-name...]}

Phân ph i các route cho phép b i standard access-list, extended access-list

VSIC Education Corporation Trang 109 hình bài lab nh hình trên, đa ch IP c a các c ng đ c cho trong b ng. Hai router Vsic1 và Vsic4 đ c t o interface Loopback Lo0. M ng 1 và m ng 2 s d ng hai giao th c truy n d n khác nhau. M ng 1 g m router Vsic1 và Vsic2 s d ng RIP, m ng 2 g m router Vsic4 s d ng IGRP. Riêng router Vsic3, m ng c a c ng S1 s d ng RIP, m ng c a c ng S0 s d ng IGRP.

4. M c tiêu c a bài lab :

M c tiêu c a bài là t t c các m ng con c a hai m ng 1 và 2 ph i liên l c đ c v i nhau.

5. C u hình router : Chúng ta c u hình cho các router nh sau :

Vsic1#sh run

Building configuration...

Current configuration : 691 bytes version 12.2 hostname Vsic1 interface Loopback0 ip address 1.1.1.1 255.255.255.0 interface Serial0 ip address 192.168.1.1 255.255.255.0 clockrate 64000 router rip network 1.0.0.0 network 192.168.1.0 End Vsic2#sh run Building configuration...

Current configuration : 494 bytes version 12.1 hostname Vsic2 interface Serial0 ip address 192.168.1.2 255.255.255.0 interface Serial1 ip address 192.168.2.1 255.255.255.0 router rip network 192.168.1.0 network 192.168.2.0 End Vsic3#sh run Building configuration...

Current configuration : 556 bytes version 12.1

VSIC Education Corporation Trang 110 interface Serial0 ip address 192.168.3.1 255.255.255.0 no fair-queue clockrate 64000 interface Serial1 ip address 192.168.2.2 255.255.255.0 clockrate 64000 router rip network 192.168.2.0 router igrp 1 network 192.168.3.0 End Vsic4#sh run Building configuration...

Current configuration : 680 bytes version 12.1 hostname Vsic4 interface Loopback0 ip address 2.2.2.2 255.255.255.0 interface Serial0 ip address 192.168.3.2 255.255.255.0 no fair-queue router igrp 1 network 2.0.0.0 network 192.168.3.0 End

Sau khi c u hình nh trên, ta đánh l nh show ip route l n l t trên b n router đ xem b ng đnh tuy n :

Vsic1#sh 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

1.0.0.0/24 is subnetted, 1 subnets

C 1.1.1.0 is directly connected, Loopback0 C 192.168.1.0/24 is directly connected, Serial0

R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:23, Serial0

Vsic2#sh 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

VSIC Education Corporation Trang 111 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 1.0.0.0/8 [120/1] via 192.168.1.1, 00:00:20, Serial0

C 192.168.1.0/24 is directly connected, Serial0 C 192.168.2.0/24 is directly connected, Serial1 Vsic3#sh 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 1.0.0.0/8 [120/2] via 192.168.2.1, 00:00:25, Serial1

I 2.0.0.0/8 [100/8976] via 192.168.3.2, 00:00:08, Serial0

R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:25, Serial1

C 192.168.2.0/24 is directly connected, Serial1 C 192.168.3.0/24 is directly connected, Serial0 Vsic4#sh 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

2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Loopback0 C 192.168.3.0/24 is directly connected, Serial0

Trong b ng đ nh tuy n c a router Vsic1 và Vsic2 ch có nh ng route ch y RIP trong M ng 1, khơng có các route ch y IGRP c a M ng 2 (c th là không th y đ c các m ng 192.168.3.0 va 2.0.0.0). T ng t , b ng đnh tuy n c a Vsic4 khơng có các route ch y RIP c a M ng 1. Nguyên nhân là gi a router Vsic2 và router Vsic3 ch y RIP; ng c l i gi a Vsic3 và Vsic4 ch y IGRP.

router Vsic4 bi t đ c các route c a M ng 1 (s d ng giao th c RIP), chúng ta c n s d ng l nh redistribute. Câu l nh này đ c dùng đ phân ph i các route c a m t giao th c vào m t giao th c khác ( đây là t RIP vào IGRP).

router Vsic3, ta phân ph i các route c a M ng 1 (s d ng RIP) vào M ng 2 (s d ng IGRP) nh sau :

VSIC Education Corporation Trang 112 Vsic3(config-router)#redistribute rip

Ki m tra l i b ng đnh tuy n c a router Vsic4 : Vsic4#sh 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

2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Loopback0

I 192.168.2.0/24 [100/10476] via 192.168.3.1, 00:01:06, Serial0

C 192.168.3.0/24 is directly connected, Serial0

Nh n xét : router Vsic4 nh n đ c route c a m ng 192.168.2.0 nh ng còn hai m ng

192.168.1.0 và 1.0.0.0 thì khơng nh n đ c.Ta nh p l nh : Vsic4#debug ip igrp transactions

sau m t kho ng th i gian ta nh n đ c thông báo sau :

00:40:20: IGRP: received update from 192.168.3.1 on Serial0 00:40:20: network 1.0.0.0, metric 4294967295 (inaccessible) 00:40:20: network 192.168.1.0, metric 4294967295 (inaccessible) 00:40:20: network 192.168.2.0, metric 10476 (neighbor 8476)

M c dù router Vsic4 nh n đ c update c a hai route 1.0.0.0 và 192.168.1.0 nh ng b đánh d u là inaccessible. Nguyên nhân c a l i trên là cách tính metric c a giao th c RIP và IGRP khác nhau. Nh ph n gi i thi u đã đ c p đ n, RIP s d ng hop count đ tính metric; cịn IGRP s d ng b ng thông, đ tr , đ tin c y, đ ng t i và MTU đ tính metric. Do đó, đ gi i quy t l i này chúng ta ph i c u hình cách tính metric cho router Vsic3 khi phân ph i route t RIP sang IGRP.

(Tham kh o ph n Cách tính metric c a giao th c IGRP trong bài C u hình IGRP load balancing đ bi t tính metric)

Cisco cung c p cho ta ba cách th c hi n :

Cách 1 : c u hình metric cho t t các các route c a b t k giao th c nào đ c phân ph i.

C u hình nh sau :

Vsic3(config)#router igrp 1

Vsic3(config-router)#default-metric 1540 100 255 1 1500 Xem l i b ng đnh tuy n c a router Vsic4 :

Vsic4#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,

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

VSIC Education Corporation Trang 113 P - periodic downloaded static route

Gateway of last resort is not set

I 1.0.0.0/8 [100/8593] via 192.168.3.1, 00:00:00, Serial0

2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Loopback0

I 192.168.1.0/24 [100/8593] via 192.168.3.1, 00:00:00, Serial0

I 192.168.2.0/24 [100/10476] via 192.168.3.1, 00:00:00, Serial0 C 192.168.3.0/24 is directly connected, Serial0

Nh n xét :

¬ Hai route 1.0.0.0 và 192.168.1.0 đã đ c update vào b ng đnh tuy n c a router Vsic4

¬ Metric c a c hai route b ng nhau (8593)

Khuy t đi m c a cách c u hình này là t t c các route c a b t k m t giao th c nào đ c phân ph i đ u có giá tr metric b ng nhau khơng c n bi t đ c route đó g n hay xa. Do đó ta khơng có đ c m t giá tr metric chính xác đ c.

Th c hi n thêm các l nh sau :

Vsic3(config)#router igrp 1

Vsic3(config-router)#no default-metric 1540 100 255 1 1500 Vsic3(config-router)#no redistribute rip

đ g b default-metric và redistribute rip tr c khi ta kh o sát cách 2.

Cách 2 : c u hình metric cho t ng giao th c

Cách c u hình :

Vsic3(config)#router igrp 1

Vsic3(config-router)#redistribute rip metric 1540 100 255 1 1500 Ki m tra lai b ng đnh tuy n c a router Vsic4 ta đ c k t qu nh sau :

Vsic4#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,

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

I 1.0.0.0/8 [100/8593] via 192.168.3.1, 00:00:00, Serial0

2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Loopback0

I 192.168.1.0/24 [100/8593] via 192.168.3.1, 00:00:00, Serial0

I 192.168.2.0/24 [100/10476] via 192.168.3.1, 00:00:00, Serial0 C 192.168.3.0/24 is directly connected, Serial0

Nh n xét : router Vsic4 v n nh n đ c k t qu nh cách 1 nh ng v i cách này ta có th linh ho t h n trong vi c c u hình metric cho t ng giao th c c th .

Cách 3 : c u hình metric cho t ng route.

Cách c u hình :

VSIC Education Corporation Trang 114 Vsic3(config)#access-list 1 permit 1.0.0.0

Vsic3(config)#access-list 2 permit 192.168.1.0

C u hình m t route map có tên là rip_to_igrp cho phép thi t l p bandwidth, delay, realibility, load và MTU (đ tính metric c a IGRP) theo các đi u ki n sau :

Route th a đi u ki n c a access-list 1 thì các giá tr là “56 100 255 1 1500” Vsic3(config)#route-map rip_to_igrp 10

Vsic3(config-route-map)#match ip address 1

Vsic3(config-route-map)#set metric 56 100 255 1 1500 Vsic3(config-route-map)#exit

Route th a đi u ki n c a access-list 2 thì các giá tr là “1000 100 255 1 1500” Vsic3(config)#route-map rip_to_igrp 15

Vsic3(config-route-map)#match ip address 2

Vsic3(config-route-map)#set metric 1000 100 255 1 1500 Vsic3(config-route-map)#exit

Route không th a hai đi u ki n trên thì giá tr là “10000 100 255 1 1500” Vsic3(config)#route-map rip_to_igrp 20

Vsic3(config-route-map)#set metric 10000 100 255 1 1500 Vsic3(config-route-map)#exit

S d ng route map cho t t c các route đ c phân ph i t RIP sang IGRP Vsic3(config)#router igrp 1

Vsic3(config-router)#redistribute rip route-map rip_to igrp Ki m tra l i b ng đnh tuy n c a router Vsic4 :

Vsic4#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,

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

I 1.0.0.0/8 [100/180671] via 192.168.3.1, 00:00:17, Serial0

2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Loopback0

I 192.168.1.0/24 [100/12100] via 192.168.3.1, 00:00:17, Serial0 I 192.168.2.0/24 [100/8576] via 192.168.3.1, 00:00:17, Serial0

C 192.168.3.0/24 is directly connected, Serial0

Trên đây, ta ch phân ph i route c a RIP vào IGRP. router Vsic1 và Vsic2 có đ c các route trong M ng 2, ta c n ph i phân ph i các route c a IGRP vào RIP.

phân ph i route t IGRP vào RIP, ta c u hình nh sau : Vsic3#conf t

Vsic3(config)#router rip

Vsic3(config-router)#redistribute igrp 1 metric 2 Ki m tra b ng đnh tuy n c a router Vsic1 và Vsic2 :

Vsic1#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

VSIC Education Corporation Trang 115 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

1.0.0.0/24 is subnetted, 1 subnets

C 1.1.1.0 is directly connected, Loopback0

R 2.0.0.0/8 [120/3] via 192.168.1.2, 00:00:04, Serial0

C 192.168.1.0/24 is directly connected, Serial0

R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:05, Serial0

R 192.168.3.0/24 [120/3] via 192.168.1.2, 00:00:05, Serial0

Vsic2#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,

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 1.0.0.0/8 [120/1] via 192.168.1.1, 00:00:25, Serial0

R 2.0.0.0/8 [120/2] via 192.168.2.2, 00:00:19, Serial1

C 192.168.1.0/24 is directly connected, Serial0 C 192.168.2.0/24 is directly connected, Serial1

Một phần của tài liệu Quản trị mạng lan wan CCNA trọn bộ phần 1 (Trang 108 - 119)

Tải bản đầy đủ (PDF)

(127 trang)