Trong bài này sẽ thực hiện redistribute giữa hai giao thức classless là OSPF và ISIS với nhau .
Trang 1Redistribute gi a ISIS và OSPF ữ
Tác gi : Nguy n Th Băng Tâm ả ễ ị
Trong bài này s th c hi n redistribute gi a hai giao th c classless là OSPF vàẽ ự ệ ữ ứISIS v i nhau ớ
M c tiêu bài làm ụ :
Th c hi n multiple redistribute points (redistribute t i nhi u đi m )ự ệ ạ ề ể
Ch ra v n đ g p ph i khi redistribute và cách gi i quy t v n đ đó ỉ ấ ề ặ ả ả ế ấ ề
T m t router ping th y t t c các đ a ch trong m ng ừ ộ ấ ấ ả ị ỉ ạ
Mô hình m ng nh sau : router R3 và R4 s ch y giao th c OSPF , R5 ch yạ ư ẽ ạ ứ ạ giao th c ISIS Router R4 và R1 s là các router th c hi n redistribute ứ ẽ ự ệ
Đ a ch trên các interface c a các router :ị ỉ ủ
S0/0
172.16.1.1/24172.16.2.2 /30
E0/0
172.16.2.1/30192.168.4.2/24
S0/0
192.168.4.1/24192.168.1.1/24
S0/0 192.168.1.2/24192.168.2.1/30
E0/0Loopback 0
192.168.2.2/30172.16.1.2/2410.1.1.1/24
Trang 2interface Serial0/0
Trang 3no fair-queue
!
interface Serial0/1
ip address 192.168.1.2 255.255.255.0 clockrate 64000
Trang 4Router# configure terminal
Enter configuration commands, one per line End with CNTL/Z.Router(config)#hostname R1
Trang 5c u hình cho router R3 : ấ
Router# configure terminal
Enter configuration commands, one per line End with CNTL/Z.Router(config)#hostname R3
Router# configure terminal
Enter configuration commands, one per line End with CNTL/Z.Router(config)#hostname R4
Router# configure terminal
Enter configuration commands, one per line End with CNTL/Z.Router(config)#hostname R5
R5(config)#line console 0
R5(config-line)#password cisco
R5(config-line)#line vty 0 4
Trang 6R5(config-line)#no login
R5(config-line)#exit
R5(config)#interface s0/0
R5(config-if)#ip address 192.168.2.2 255.255.255.252R5(config-if)#clock rate 64000
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, Ethernet0/0
C 172.16.2.0/30 is directly connected, Serial0/0
R2#show ip route
Gateway of last resort is not set
172.16.0.0/30 is subnetted, 1 subnets
C 172.16.2.0 is directly connected, Serial0/0
C 192.168.4.0/24 is directly connected, Ethernet0/0
R3#show ip route
Gateway of last resort is not set
C 192.168.4.0/24 is directly connected, Ethernet0/0
C 192.168.1.0/24 is directly connected, Serial0/0
R4#show ip route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, Serial0/1
Trang 710.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Loopback0
192.168.2.0/30 is subnetted, 1 subnets
C 192.168.2.0 is directly connected, Serial0/0
C u hình đ nh tuy n cho các router Router R2,R3, interface s0/0 c a R1 vàấ ị ế ủinterface s0/1 c a R4 ch y OSPF process 1 ,còn l i là ch y ISIS ủ ạ ạ ạ
Ta bi t c u hình ISIS đòi h i c n ph i có đ a ch NET ,m i system-ID đ iế ấ ỏ ầ ả ị ỉ ỗ ạ
di n cho m i node, ta có th g n nó m t cách tùy ý nh ng đ đ m b oệ ỗ ể ắ ộ ư ể ả ả system-ID là duy nh t c a m i router trong m t area ta s s d ng đ a chấ ủ ỗ ộ ẽ ử ụ ị ỉ Mac
Ta ki m tra đ a ch Mac c a thi t b b ng cách show arp ho c show interface ể ị ỉ ủ ế ị ằ ặR1#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 172.16.1.1 - 0004.c052.7ce0 ARPA Ethernet0/0
R4#show interface e0/0
Ethernet0/0 is administratively down, line protocol is down
Hardware is AmdP2, address is 0002.4b79.9ca0 (bia 0002.4b79.9ca0)
Internet address is 192.168.100.1/24
MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
reliability 252/255, txload 1/255, rxload 1/255
<omitted>
R5#sh arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 172.16.1.2 - 00d0.ba1a.f080 ARPA Ethernet0/0
Trang 8Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, Ethernet0/0
C 172.16.2.0/30 is directly connected, Serial0/0
O 192.168.4.0/24 [110/74] via 172.16.2.1, 00:03:18, Serial0/0 10.0.0.0/24 is subnetted, 1 subnets
i L1 10.1.1.0 [115/20] via 172.16.1.2, Ethernet0/0
O 192.168.1.0/24 [110/138] via 172.16.2.1, 00:03:18, Serial0/0 192.168.2.0/30 is subnetted, 1 subnets
i L1 192.168.2.0 [115/20] via 172.16.1.2, Ethernet0/0
Trang 9Nh ng route nào h c t ISIS s b t đ u b ng i Trong bài này các routerữ ọ ừ ẽ ắ ầ ằ
ch y ISIS đ m c đ nh là L1/L2 router và các router đang ch y level – 1ạ ể ặ ị ạ
routing nên có kí hi u là L1 Đ i v i metric c a ISIS thì lo i metric có chi uệ ố ớ ủ ạ ề dài là 1 byte Bit 8 ch ra s hi n di n c a lo i metric trong TLV.Bit 7 đỉ ự ệ ệ ủ ạ ượ cdùng đ phân lo i metric là internal hay là external Internal metric đ c p đ nể ạ ề ậ ế các route đượ ạc t o ra trong mi n ISIS , trong khi đó external route đ c p đ nề ề ậ ế các route bên ngoài mi n ISIS ho c là t các giao th c đ nh tuy n khác 6 bitề ặ ừ ứ ị ếcòn l i dành cho vi c tính toán th c s giá tr c a metric Do đó ta có giá trạ ệ ự ự ị ủ ị cost c c đ i c a default metric là 63 trên m t link Đ i v i Cisco router costự ạ ủ ộ ố ớ
c a m t link đủ ộ ược quy t đ nh b i giá tr đế ị ở ị ược đăng kí đ n interface ngõ ra ếCisco đăng kí default metric là 10 cho m i interface mà không quan tâmỗ
interface đó thu c lo i nào Lúc này m i subnetwork độ ạ ỗ ược xem là b ng nhauằ
và ISIS metric được tính toán đ n gi n b ng cách tính t ng các hop-count nóơ ả ằ ổ
ph i đi qua đ đ n đích , m i hop có cost là 10 Ví d trong b ng đ nh tuy nả ể ế ỗ ụ ả ị ế
c a R1 ta th y ,route 192.168.2.0 có metric là 20 vì nó đi qua R5,R1 Cost c aủ ấ ủ các route h c đọ ượ ừc t OSPF được tính tương t nh bài redistribute gi aự ư ữ classfull và classless Cost c a 192.168.1.0/24 là 138 vì nó ph i đi qua 2 serialủ ảinterface (m i interface có cost là 64) và m t ethernet interface (có cost là 10).ỗ ộCách tính cost c a OSPF là không đ i khi th c hi n redistribute ,do đó trongủ ổ ự ệbài này ta s không xét kĩ v nó ẽ ề
R2#show ip route
Gateway of last resort is not set
172.16.0.0/30 is subnetted, 1 subnets
C 172.16.2.0 is directly connected, Serial0/0
C 192.168.4.0/24 is directly connected, Ethernet0/0
C 192.168.4.0/24 is directly connected, Ethernet0/0
C 192.168.1.0/24 is directly connected, Serial0/0
R4#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
Trang 10Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/40 ms
R2#ping 192.168.1.1
Type escape sequence to abort
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms
R4#ping 10.1.1.1
Type escape sequence to abort
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/29/32 ms
R4#ping 192.168.4.2
Type escape sequence to abort
Sending 5, 100-byte ICMP Echos to 192.168.4.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/31/32 ms
R2#ping 192.168.2.1
Type escape sequence to abort
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
Success rate is 0 percent (0/5)
R2 không th ping 192.168.2.1 để ược vì R2 ch y giao th c OSPF còn m ngạ ứ ạ 192.168.2.0/24 s d ng ISIS Mu n th c hi n ping thành công ta ph iử ụ ố ự ệ ả
redistribute gi a hai giao th c c u hình redistribute đữ ứ ấ ược th c hi n trên cự ệ ả hai routert R1 và R4 được g i là multiple redistribute points C u hình nh sau :ọ ấ ư
Trang 11R4(config)#router ospf 1
R4(config-router)#redistribute isis level-1 metric 20
% Only classful networks will be redistributed
R4(config-router)#router isis
R4(config-router)#redistribute ospf 1 metric 10 level-1-2
R4(config-router)#exit
R1(config)#router ospf 1
R1(config-router)#redistribute isis level-1 metric 20
% Only classful networks will be redistributed
à redistribute các route ISIS vào OSPF v i metric là 20 và các route này đóngớvai trò là
level-1
R1(config-router)#router isis
R1(config-router)#redistribute ospf 1 metric 10 level-1-2
à redistribute nh ng route OSPF vào ISIS v i metric là 10 và các route có vaiữ ớtrò level-1-2 route
Ki m tra b ng đ nh tuy n : ể ả ị ế
R2#show ip route
Gateway of last resort is not set
172.16.0.0/30 is subnetted, 1 subnets
C 172.16.2.0 is directly connected, Serial0/0
C 192.168.4.0/24 is directly connected, Ethernet0/0
O 192.168.1.0/24 [110/74] via 192.168.4.1, 00:11:09, Ethernet0/0
à trên b ng đ nh tuy n c a R2 không h c đả ị ế ủ ọ ược route nào t ISIS lí do là vìừ
ch có nh ng classfull networks m i đỉ ữ ớ ược đi vào OSPF
R5#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, Ethernet0/0
Trang 12Đ R2,R3 th y để ấ ược các route trong ISIS ta thêm vào trong câu l nhệ
redistribute m t subnets.ộ
R4(config)#router ospf 1
R4(config-router)#no redistribute isis level-1 metric 20
R4(config-router)#redistribute isis level-1 metric 20 subnets
R4(config-router)#router isis
R4(config-router)#no redistribute ospf 1 metric 10 level-1-2
R4(config-router)#redistribute ospf 1 metric 10 metric-type external
à các route được redistribute vào ISIS có th là internal route ho c externalể ặroute (internal là default) ho c là level 1 ,ho c là level 2 (level 2 là default ).ặ ặTrong c u hình trên các OSPF route đấ ược redistribute nh là external route v iư ớ default metric là 10
R1(config)#router ospf 1
R1(config-router)#no redistribute isis level-1 metric 20
R1(config-router)#redistribute isis level-1 metric 20 subnets
R1(config-router)#router isis
R1(config-router)#no redistribute ospf 1 metric 10 level-1-2
R1(config-router)#redistribute ospf 1 metric 10 metric-type external
Ki m tra b ng đ nh tuy n: ể ả ị ế
R4#show ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0 is directly connected, Serial0/0
à b ng đ nh tuy n c a R4 không có gì thay đ i ả ị ế ủ ổ
R1#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, Ethernet0/0
C 172.16.2.0/30 is directly connected, Serial0/0
Trang 13R1#traceroute 10.1.1.1
Type escape sequence to abort
Tracing the route to 10.1.1.1
1 172.16.2.1 16 msec 16 msec 12 msec
2 192.168.4.1 16 msec 16 msec 16 msec
3 192.168.1.2 28 msec 28 msec 28 msec
4 192.168.2.2 44 msec 16 msec *
R4#traceroute 10.1.1.1
Type escape sequence to abort
Tracing the route to 10.1.1.1
1 192.168.2.2 20 msec 24 msec *
Ta reload l i router R4 ,quan sát b ng đ nh tuy n c a c 2 router R1 và R4 :ạ ả ị ế ủ ảR1#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, Ethernet0/0
C 172.16.2.0/30 is directly connected, Serial0/0
94 cho th y đây là external route ấ
Trong khi đó thì R4 l i xem 10.1.1.0 nh là m t route bên ngoài mà nó h cạ ư ộ ọ
được thông qua R3
R4#show ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
i L1 172.16.1.0/24 [115/20] via 192.168.2.2, Serial0/0
Trang 14C 192.168.2.0 is directly connected, Serial0/0
S h i t trong m t m ng : các router chia s thông tin đ nh tuy n v i nhau ,ự ộ ụ ộ ạ ẽ ị ế ớ
nh ng m i cá nhân router ph i t tính toán b ng đ nh tuy n c a chúng Đ iư ỗ ả ự ả ị ế ủ ố
v i m i b ng đ nh tuy n cá nhân đó đớ ỗ ả ị ế ược chính xác , các router đã có m t cáiộnhìn chung v topology m ng Lúc này m ng đề ạ ạ ược xem là h i t N u m ngộ ụ ế ạ đang trong quá trình h i t ,s d dàng x y ra nhi u v n đ đ nh tuy n nhộ ụ ẽ ễ ả ề ấ ề ị ế ư router nghĩ r ng m t link đang up trong khi th t s là nó đang b down d nằ ộ ậ ự ị ẫ
đ n b ng đ nh tuy n sai và loop d dàng x y ra M ng đế ả ị ế ễ ả ạ ược xem là h i tộ ụ nhanh khi khôi ph c đụ ượ ự ốc s c (nh l i liên k t ho c s thay đ i v m ng )ư ỗ ế ặ ự ổ ề ạ
m t cách nhanh chóng ộ
Các giao th c link-state h i t m ng r t nhanh vì khi có s thay đ i x y raứ ộ ụ ạ ấ ự ổ ảtrong m ng ,s thay đ i này ngay l p t c đạ ự ổ ậ ứ ược g i đi b ng multicast t i cácử ằ ớneighbor trong partial update (t c là update ch g m có s thay đ i này ) đi uứ ỉ ồ ự ổ ề này làm loop khó có th x y ra trong m t m ng ch y toàn giao th c link- stateể ả ộ ạ ạ ứ
Tr l i v i bài trên ,ta th y loop đã không x y ra nh ng trong c hai trở ạ ớ ấ ả ư ả ườ ng
h p ,router R1 và R4 đ u ch n con đợ ề ọ ường đi không t i u đ n m ng 10.1.1.0ố ư ế ạ.R1 thay vì xem R5 nh là next hop đ đ n đích thì nó l i xem R2 nh là nextư ể ế ạ ưhop R4 cũng tương t Ta có th gi i thích đi u này nh sau : (xem b ng đ nhự ể ả ề ư ả ị tuy n trế ước khi R4 được reload )
gi s c hai router R1 và R4 th c hi n redistribute cùng m t th i đi m Cả ử ả ự ệ ộ ờ ể ả hai router đ u g i OSPF update trong đó có m ng 10.1.1.0 ,R4 may m nề ử ạ ắ
h n ,nó g i update nhanh h n R1 R4 ch g i nh ng route mà nó h c t ISISơ ử ơ ỉ ử ữ ọ ừvào OSPF , đó là nh ng route 172.16.1.0 và 10.1.1.0 , nó không g i nh ngữ ử ữ route k t n i tr c ti p ho c là nh ng route nó đã đế ố ự ế ặ ữ ược h c thông qua OSPF.ọR3 nh n update t R4 , xem R4 nh là next –hop router (quan sát b ng đ nhậ ừ ư ả ị tuy n c a R3 ,nh ng route h c t R4 đế ủ ữ ọ ừ ược tô đ m ) và g i update đ n R2 ậ ử ế
R3#show ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
Trang 15C 192.168.1.0/24 is directly connected, Serial0/0
C 172.16.2.0/30 is directly connected, Serial0/0
C 192.168.4.0/24 is directly connected, Ethernet0/0
b ng đ nh tuy n c a nó đã t n t i nh ng route đó v i AD t t h n Khi R2ả ị ế ủ ồ ạ ữ ớ ố ơ
nh n update t R1 , nó ch c p nh p route 192.168.2.0 Lúc này R2 xem R1ậ ừ ỉ ậ ậ
nh là next-hop đ đi đ n m ng 192.168.2.0 , R2 l i g i update v m ngư ể ế ạ ạ ử ề ạ 192.168.2.0 cho R3 ,R3 xem R2 là next –hop đ đ n m ng 192.168.2.0 (xemể ế ạ
b ng đ nh tuy n ).ả ị ế
B ng đ nh tuy n c a R5 ,R5 cân b ng t i gi a hai đả ị ế ủ ằ ả ữ ường :
R5#show ip route
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, Ethernet0/0
C 192.168.2.0 is directly connected, Serial0/0
Khi ra reload lai router R4 , quá trình h c route c a các router di n ra nhọ ủ ễ ư
Trang 16sau :
R5 ,R3 nh n ra s thay đ i trong m ng ,ngay l p t c chúng g i update ch baoậ ự ổ ạ ậ ứ ử ỉ
g m thông tin v s thay đ i đó cho các router ch y cùng giao th c v iồ ề ự ổ ạ ứ ớ
chúng ,trong trường h p này R5 g i update cho R1 , R3 g i update cho R2 R1ợ ử ửcũng có th nh n update cho bi t v s thay đ i trong m ng t R2 nh ng vìể ậ ế ề ự ổ ạ ừ ưISIS h i t nhanh h n OSPF nên R1 s update thông tin t R5 R1 xem R5 làộ ụ ơ ẽ ừnext-hop đ đi đ n các route còn l i trong m ng ể ế ạ ạ
R1#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, Ethernet0/0
C 172.16.2.0/30 is directly connected, Serial0/0
Khi R1 đã có đ y đ thông tin v m ng c a nó , là khi các m ng trong ISIS đãầ ủ ề ạ ủ ạ
h i t xong , R1 li n g i ngay update đ n cho R2 ,trong update ch bao g mộ ụ ề ử ế ỉ ồ
nh ng route bên trong nó h c đữ ọ ượ ừc t ISIS (nh ng route có kí t L1 phíaữ ự
trước ), R2 c p nh p update và g i cho R3 ,R3 l i g i cho R4 R4 xem R3 nhậ ậ ử ạ ử ư
là next-hop Do đó khi R4 c p nh p update nó s ch n đậ ậ ẽ ọ ường đi đ n m ngế ạ 10.1.1.0 qua R3 vì nó th y đấ ường đi qua R3 có AD nh h n ỏ ơ
R4#show ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0 is directly connected, Serial0/0
Qua phân tích trên ta th y administrative distance có th gây vi c ch n đấ ể ệ ọ ườ ng
đi không t i u mà trong m t vài giao th c khác nh RIP ,IGRP có th gâyố ư ộ ứ ư ểloop , làm ch m l i quá trình h i t có nhi u cách gi i quy t v n đ này nhậ ạ ộ ụ ề ả ế ấ ề ư
là s d ng route filtering , thay đ i administrative distance b ng phử ụ ổ ằ ương pháp
th công , hay là s d ng route map Trong bài này ta s thay đ i AD b ngủ ử ụ ẽ ổ ằ cách dùng thêm câu l nh distance đ gi i quy t v n đ sub-optimal route , màệ ể ả ế ấ ề