Redistribute giữa ISIS và OSPF - Nguyễn Thị Băng Tâm

THThiNganHang
0 Downloads
22
0

Vorschau wird generiert...

Inhalt des Dokuments

Seite 1

Redistribute 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 : Router Interface đ a chị ỉ Router R1 E0/0 172.16.1.1/24 S0/0 172.16.2.2 /30 Router R2 S0/0 172.16.2.1/30 E0/0 192.168.4.2/24 Router R3 E0/0 192.168.4.1/24 S0/0 192.168.1.1/24 Router R4 S0/1 192.168.1.2/24 S0/0 192.168.2.1/30 Router R5 S0/0 192.168.2.2/30 E0/0 172.16.1.2/24 Loopback 0 10.1.1.1/24

Seite 2

Cấu hình ban đầu : R1 ! hostname R1 ! enable password cisco ! interface Ethernet0/0 ip address 172.16.1.1 255.255.255.0 ! interface Serial0/0 ip address 172.16.2.2 255.255.255.252 ! end R2 ! hostname R2 ! interface Ethernet0/0 ip address 192.168.4.2 255.255.255.0 ! interface Serial0/0 ip address 172.16.2.1 255.255.255.252 clockrate 64000 ! ip classless ! end R3 ! hostname R3 ! interface Ethernet0/0 ip address 192.168.4.1 255.255.255.0 half-duplex ! interface Serial0/0

Seite 3

ip address 192.168.1.1 255.255.255.0 no fair-queue ! end R4 ! hostname R4 ! interface Ethernet0/0 ip address 192.168.100.1 255.255.255.0 ! interface Serial0/0 ip address 192.168.2.1 255.255.255.0 clockrate 64000 no fair-queue ! interface Serial0/1 ip address 192.168.1.2 255.255.255.0 clockrate 64000 ! ip http server ip classless ! end R5 ! hostname R5 ! interface Loopback0 ip address 10.1.1.1 255.255.255.0 no ip directed-broadcast ! interface Ethernet0/0 ip address 172.16.1.2 255.255.255.0 no ip directed-broadcast ! interface Serial0/0 ip address 192.168.2.2 255.255.255.252 ! ip classless end Cấu hình ban đầu cho các router : R1

Seite 4

Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R1 R1(config)#line console 0 R1(config-line)#password cisco R1(config-line)#login R1(config)#line vty 0 4 R1(config-line)#password cisco R1(config-line)#login R1(config-line)#exit R1(config)#enable password cisco R1(config)#interface s0/0 R1(config-if)#ip address 172.16.2.2 255.255.255.252 R1(config-if)#clock rate 64000 R1(config-if)#no shutdown R1(config-if)#int e0/0 R1(config-if)#ip address 172.16.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#exit R1(config)# cấu hình cho router R2 : Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R2 R2(config)#line console 0 R2(config-line)#password cisco R2(config-line)#line vty 0 4 R2(config-line)#no login R2(config-line)#exit R2(config)#interface e0/0 R2(config-if)#ip address 192.168.4.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#interface s0/0 R2(config-if)#ip address 172.16.2.1 255.255.255.252 R2(config-if)#clock rate 64000 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#^Z R2#

Seite 5

cấu hình cho router R3 : Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R3 R3(config)#line console 0 R3(config-line)#password cisco R3(config-line)#line vty 0 4 R3(config-line)#no login R3(config-line)#exit R3(config)#interface s0/0 R3(config-if)#ip address 192.168.1.1 255.255.255.0 R3(config-if)#clock rate 64000 R3(config-if)#no shutdown R3(config-if)#interface e0/0 R3(config-if)#ip address 192.168.4.1 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#exit R3(config)#^Z R3# cấu hình cho router R4 : Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R4 R4(config)#line console 0 R4(config-line)#password cisco R4(config-line)#line vty 0 4 R4(config-line)#no login R4(config-line)#exit R4(config)#interface s0/1 R4(config-if)#ip address 192.168.1.2 255.255.255.0 R4(config-if)#clock rate 64000 R4(config-if)#no shutdown R4(config-if)#interface s0/0 R4(config-if)#ip address 192.168.2.1 255.255.255.252 R4(config-if)#clock rate 64000 R4(config-if)#no shutdown R4(config-if)#exit cấu hình cho router R5 : 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

Seite 6

R5(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.252 R5(config-if)#clock rate 64000 R5(config-if)#no shutdown R5(config-if)#interface e0/0 R5(config-if)#ip address 172.16.1.2 255.255.255.0 R5(config-if)#no shutdown R5(config-if)#interface loopback 0 R5(config-if)#ip address 10.1.1.1 255.255.255.0 R5(config-if)#^Z R5# kiểm tra bảng đ nh tuyị ến : R1#show 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 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 192.168.2.0/30 is subnetted, 1 subnets C 192.168.2.0/30 is directly connected, Serial0/0 R5#show ip route Gateway of last resort is not set 172.16.0.0/24 is subnetted, 1 subnets C 172.16.1.0 is directly connected, Ethernet0/0

Seite 7

10.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 Cấu hình như sau : R1(config)#router ospf 1 R1(config-router)#network 172.16.2.0 0.0.0.3 area 0 R1(config-router)#exit R1(config)#clns routing R1(config)#router isis R1(config-router)#net 01.0001.0004.c052.7ce0.00 R1(config-router)#exit R1(config)#interface e0/0 R1(config-if)#ip router isis R1(config-if)#^Z R1# R2(config)#router ospf 1 R2(config-router)#network 192.168.4.0 0.0.0.255 area 0 R2(config-router)#network 172.16.2.0 0.0.0.3 area 0 R2(config-router)#exit

Seite 8

R2(config)#^Z R3(config)#router ospf 1 R3(config-router)#network 192.168.4.0 0.0.0.255 area 0 R3(config-router)#network 192.168.1.0 0.0.0.255 area 0 R3(config-router)#exit R3(config)#^Z R4(config)#router ospf 1 R4(config-router)#network 192.168.1.0 0.0.0.255 area 0 R4(config-router)#exit R4(config)#clns routing R4(config)#router isis R4(config-router)#net 01.0001.0002.4b79.9ca0.00 R4(config-router)#exit R4(config)#int s0/0 R4(config-if)#ip router isis R4(config-if)#^Z R5(config)#clns routing R5(config)#router isis R5(config-router)#net 01.0001.00d0.ba1a.f080.00 R5(config-router)#int s0/0 R5(config-if)#ip router isis R5(config-if)#int e0/0 R5(config-if)#ip router isis R5(config-if)#exit R5(config)#int loopback 0 R5(config-if)#ip router isis R5(config)#^Z kiểm tra lại bảng đ nh tuyị ến : 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 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

Seite 9

Nhữ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 được dù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 O 192.168.1.0/24 [110/74] via 192.168.4.1, 00:00:05, Ethernet0/0 R3#sh ip route Gateway of last resort is not set 172.16.0.0/30 is subnetted, 1 subnets O 172.16.2.0 [110/74] via 192.168.4.2, 00:01:07, 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 i L1 172.16.1.0/24 [115/20] via 192.168.2.2, Serial0/0 O 172.16.2.0/30 [110/138] via 192.168.1.1, 00:01:51, Serial0/1 O 192.168.4.0/24 [110/74] via 192.168.1.1, 00:01:51, Serial0/1 10.0.0.0/24 is subnetted, 1 subnets i L1 10.1.1.0 [115/20] via 192.168.2.2, Serial0/0 C 192.168.1.0/24 is directly connected, Serial0/1 192.168.2.0/30 is subnetted, 1 subnets C 192.168.2.0 is directly connected, Serial0/0

Seite 10

R5#show ip route Gateway of last resort is not set 172.16.0.0/24 is subnetted, 1 subnets C 172.16.1.0 is directly connected, Ethernet0/0 10.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 Kiểm tra bằng lệnh ping : R4#ping 172.16.2.1 Type 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 :

Seite 11

R4(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 i L1 172.16.2.0/30 [115/20] via 192.168.2.1, Serial0/0 [115/20] via 172.16.1.1, Ethernet0/0 i L1 192.168.4.0/24 [115/20] via 192.168.2.1, Serial0/0 [115/20] via 172.16.1.1, Ethernet0/0 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Loopback0 i L1 192.168.1.0/24 [115/20] via 192.168.2.1, Serial0/0 [115/20] via 172.16.1.1, Ethernet0/0 192.168.2.0/30 is subnetted, 1 subnets C 192.168.2.0 is directly connected, Serial0/0

Seite 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 i L1 172.16.1.0/24 [115/20] via 192.168.2.2, Serial0/0 O 172.16.2.0/30 [110/138] via 192.168.1.1, 00:23:26, Serial0/1 O 192.168.4.0/24 [110/74] via 192.168.1.1, 00:23:26, Serial0/1 10.0.0.0/24 is subnetted, 1 subnets i L1 10.1.1.0 [115/20] via 192.168.2.2, Serial0/0 C 192.168.1.0/24 is directly connected, Serial0/1 192.168.2.0/30 is subnetted, 1 subnets 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 O 192.168.4.0/24 [110/74] via 172.16.2.1, 00:23:14, Serial0/0 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 172.16.2.1, 00:10:32, Serial0/0 O 192.168.1.0/24 [110/138] via 172.16.2.1, 00:23:14, Serial0/0 192.168.2.0/30 is subnetted, 1 subnets

Seite 13

i L1 192.168.2.0 [115/20] via 172.16.1.2, Ethernet0/0 à bảng đ nh tuyị ến đã khác trước ,có sự xuất hiện một external route .Đó là route 10.1.1.0 được h c thông qua OSPF qua interface 172.16.2.1 thay vì h cọ ọ trực tiếp từ router R5 .Ở đây ta gặp phải một vấn đề ,cả R1 và R4 đều đang redistribute các route được h c bọ ởi ISIS vào OSPF.R4 h c mọ ạng 10.1.1.0 thông qua ISIS và quảng bá vào OSPF domain .Kết quả là R1 h c mọ ạng 10.1.1.0 không phải từ R5 mà từ R2 thông qua OSPF . R1#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 i L2 192.168.4.0/24 [115/94] via 172.16.1.2, Ethernet0/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 i L2 192.168.1.0/24 [115/94] via 172.16.1.2, Ethernet0/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 à R1 xem R5 như là next hop để đi đến route 10.1.1.0 ,do đó có kí hiệu L1 .Bảng đ nh tuyị ến cũng cho thấy R1 xem route 192.168.1.0 là level-2 , metric 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

Seite 14

O 172.16.2.0/30 [110/138] via 192.168.1.1, 00:00:18, Serial0/1 O 192.168.4.0/24 [110/74] via 192.168.1.1, 00:00:18, Serial0/1 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 192.168.1.1, 00:00:00, Serial0/1 C 192.168.1.0/24 is directly connected, Serial0/1 192.168.2.0/30 is subnetted, 1 subnets C 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 O E2 172.16.1.0/24 [110/20] via 192.168.1.2, 00:28:39, Serial0/0 O 172.16.2.0/30 [110/74] via 192.168.4.2, 00:41:20, Ethernet0/0 C 192.168.4.0/24 is directly connected, Ethernet0/0 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 192.168.1.2, 00:28:39, Serial0/0

Seite 15

C 192.168.1.0/24 is directly connected, Serial0/0 192.168.2.0/30 is subnetted, 1 subnets O E2 192.168.2.0 [110/20] via 192.168.4.2, 00:14:14, Ethernet0/0 R2 , nhận update từ R3 ,xem R3 là next-hop router . R2#show ip route 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks O E2 172.16.1.0/24 [110/20] via 192.168.4.1, 00:00:40, Ethernet0/0 C 172.16.2.0/30 is directly connected, Serial0/0 C 192.168.4.0/24 is directly connected, Ethernet0/0 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 192.168.4.1, 00:00:40, Ethernet0/0 O 192.168.1.0/24 [110/74] via 192.168.4.1, 00:00:40, Ethernet0/0 192.168.2.0/30 is subnetted, 1 subnets O E2 192.168.2.0 [110/20] via 172.16.2.2, 00:00:40, Serial0/0 R1 và R2 gửi update cho nhau . Khi nhận được update của R2 về mạng 10.1.1.0 , router R1 nghĩ rằng đường đi đến mạng 10.1.1.0 qua R2 tốt h n vìơ có AD nhỏ hơn , dẫn đến R1 cập nhập bảng đ nh tuyị ến và xem R2 như là next-hop. R1 không cập nhập những route còn lại từ R2 vì bản thân trong 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 i L2 172.16.2.0/30 [115/84] via 192.168.2.1, Serial0/0 [115/84] via 172.16.1.1, Ethernet0/0 i L2 192.168.4.0/24 [115/84] via 192.168.2.1, Serial0/0 [115/84] via 172.16.1.1, Ethernet0/0 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Loopback0 i L2 192.168.1.0/24 [115/84] via 192.168.2.1, Serial0/0 [115/84] via 172.16.1.1, Ethernet0/0 192.168.2.0/30 is subnetted, 1 subnets 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ư

Seite 16

sau : 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 i L2 192.168.4.0/24 [115/94] via 172.16.1.2, Ethernet0/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 i L2 192.168.1.0/24 [115/94] via 172.16.1.2, Ethernet0/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 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 i L1 172.16.1.0/24 [115/20] via 192.168.2.2, Serial0/0 O 172.16.2.0/30 [110/138] via 192.168.1.1, 00:00:18, Serial0/1 O 192.168.4.0/24 [110/74] via 192.168.1.1, 00:00:18, Serial0/1 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 192.168.1.1, 00:00:00, Serial0/1 C 192.168.1.0/24 is directly connected, Serial0/1 192.168.2.0/30 is subnetted, 1 subnets 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à

Seite 17

trong một vài trường hợp loop và black-hole có thể xảy ra . Thay đổi AD sao cho R1 mu n đi đố ến mạng 10.1.1.0 và 192.168.1.0 phải coi router R5 là next-hop .R4 mu n đi đố ến mạng 10.1.1.0 và 172.16.1.0 phải coi R5 là next-hop. R2,R3 có thể tùy ý ch n lọ ựa đường . cấu hình như sau : R4(config)#router ospf 1 R4(config-router)#distance 130 R4(config-router)#distance 110 0.0.0.0 255.255.255.255 1 R4(config-router)#router isis R4(config-router)#distance 130 R4(config-router)#distance 115 192.168.2.2 0.0.0.0 2 R4(config-router)#exit R4(config)#access-list 1 permit 192.168.4.0 R4(config)#access-list 1 permit 172.16.2.0 0.0.0.3 R4(config)#access-list 2 permit 10.1.1.0 0.0.0.255 R4(config)#access-list 2 permit 172.16.1.0 0.0.0.255 R1(config)#router ospf 1 R1(config-router)#distance 130 R1(config-router)#distance 110 0.0.0.0 255.255.255.255 1 R1(config-router)#router isis R1(config-router)#distance 130 R1(config-router)#distance 115 172.16.1.2 0.0.0.0 2 R1(config-router)#exit R1(config)#access-list 1 permit 192.168.4.0 0.0.0.255 R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255 R1(config)#access-list 2 permit 10.1.1.0 0.0.0.255 R1(config)#access-list 2 permit 172.16.1.0 0.0.0.255 R1#sh run ! router ospf 1 log-adjacency-changes redistribute isis level-1 metric 20 subnets network 172.16.2.0 0.0.0.3 area 0 distance 130 distance 110 0.0.0.0 255.255.255.255 1 ! router isis net 01.0001.0004.c052.7ce0.00 redistribute ospf 1 metric 10 metric-type external distance 130 clns distance 115 172.16.1.2 0.0.0.0 2 !

Seite 18

! access-list 1 permit 192.168.4.0 0.0.0.255 access-list 1 permit 192.168.1.0 0.0.0.255 access-list 2 permit 10.1.1.0 0.0.0.255 access-list 2 permit 192.168.2.0 0.0.0.255 ! R4#sh run ! router ospf 1 log-adjacency-changes redistribute isis level-1 metric 20 subnets network 192.168.1.0 0.0.0.255 area 0 distance 130 distance 110 0.0.0.0 255.255.255.255 1 ! router isis net 01.0001.0002.4b79.9ca0.00 redistribute ospf 1 metric 10 metric-type external distance 130 clns distance 115 192.168.2.2 0.0.0.0 2 ! access-list 1 permit 192.168.4.0 access-list 1 permit 172.16.2.0 0.0.0.3 access-list 2 permit 10.1.1.0 0.0.0.255 access-list 2 permit 172.16.1.0 0.0.0.255 ! Câu lệnh distance đầu tiên trong hai cấu hình thiết lập distance mặc đ nh choị các route của OSPF và ISIS là 130 . Câu lệnh distance thứ hai thiết lập một distance khác tùy theo router quảng bá nào được ch đ nh và có tham chiỉ ị ếu đến access-list .Chẳng hạn trên router R1 , tiến trình ISIS của R1 đăng kí distance là 115 cho các route được quảng bá bởi R5 và được cho phép bởi access-list 2 .Tất cả các route còn lại được gán distance bằng 130 . Inverse mask được sử dụng trong đ a ch cị ỉ ủa router quảng bá (cụ thể là R5 ) ch ra chính xácỉ interface nào mà R1 cần đi đến .Đối với OSPF , đ a ch và inverse mask trongị ỉ câu lệnh distance là 0.0.0.0 255.255.255.255 ch đ nh bỉ ị ất kì router nào .Các route OSPF từ ất t cả các router được cho phép b i access- list 1 đở ược đăng kí một distance là 110 , tất cả các route còn lại khác có distance là 130 . Câu lệnh distance trong R4 được giải thích tương tự . Kết quả là ta có bảng đ nh tuyị ến sau : R4#sh ip route 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

Seite 19

O 172.16.2.0/30 [110/138] via 192.168.1.1, 00:57:37, Serial0/1 O 192.168.4.0/24 [110/74] via 192.168.1.1, 00:57:37, Serial0/1 10.0.0.0/24 is subnetted, 1 subnets i L1 10.1.1.0 [115/20] via 192.168.2.2, Serial0/0 C 192.168.1.0/24 is directly connected, Serial0/1 192.168.2.0/30 is subnetted, 1 subnets C 192.168.2.0 is directly connected, Serial0/0 R1#sh 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 172.16.2.0/30 is directly connected, Serial0/0 O 192.168.4.0/24 [110/74] via 172.16.2.1, 00:00:53, 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:00:53, 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 Trong bảng đ nh tuyị ến của R4 ta thấy rằng , R4 đang đ nh tuyị ến đến tất cả các mạng trong miền OSPF thông qua R3 và đến tất cả các mạng trong miền ISIS thông qua R5 . Distance của OSPF và ISIS được g n cho các route .Bắ ảng đ nh tuyị ến của R1 tương tự . Để thấy rõ h n ý nghĩa cơ ủa câu lệnh distance 130 ,ta giả sử interface giữa R5 và R4 down . R4(config)#int s0/0 R4(config-if)#shutdown *Mar 1 01:44:29.056: %LINK-5-CHANGED: Interface Serial0/0, changed state to administratively down *Mar 1 01:44:30.058: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down kiểm tra lại bảng đ nh tuyị ến của R4 : R4#sh ip route Gateway of last resort is not set 172.16.0.0/30 is subnetted, 1 subnets O 172.16.2.0 [110/138] via 192.168.1.1, 00:37:45, Serial0/1 O 192.168.4.0/24 [110/74] via 192.168.1.1, 00:37:45, Serial0/1 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [130/20] via 192.168.1.1, 00:00:22, Serial0/1 C 192.168.1.0/24 is directly connected, Serial0/1 Bảng đ nh tuyị ến cho thấy tất cả các route bây giờ đi đến R4 thông qua R3 .Các route đến các mạng trong miền ISIS có distance là 130 , đây là route mà

Seite 20

R4 học được thông qua OSPF có metric là 20 vì là external route .Khi kết nối trên interface của R4 và R5 được khôi phục trở ạl i, các bản tin quảng bá ISIS từ R5 v i distance 115 sớ ẽ thay thế các bản tin quảng bá OSPF với distance 130 . Tương tự ,giả sử khi kết nối giữa R5 và R1 b down thì R1 cũng hị ọc các route trong miền ISIS thông qua OSPF với distance là 130 . R1#sh ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks O E2 172.16.1.0/24 [130/20] via 172.16.2.1, 00:00:03, Serial0/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:00:03, Serial0/0 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [130/20] via 172.16.2.1, 00:00:03, Serial0/0 O 192.168.1.0/24 [110/138] via 172.16.2.1, 00:00:03, Serial0/0 Bảng đ nh tuyị ến của các router còn lại khi tất cả các interface đều up là : R2#sh ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks O E2 172.16.1.0/24 [110/20] via 192.168.4.1, 00:00:45, Ethernet0/0 C 172.16.2.0/30 is directly connected, Serial0/0 C 192.168.4.0/24 is directly connected, Ethernet0/0 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 172.16.2.2, 00:00:45, Serial0/0 O 192.168.1.0/24 [110/74] via 192.168.4.1, 01:32:57, Ethernet0/0 192.168.2.0/30 is subnetted, 1 subnets O E2 192.168.2.0 [110/20] via 172.16.2.2, 00:00:50, Serial0/0 R3#sh ip route Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks O E2 172.16.1.0/24 [110/20] via 192.168.1.2, 00:01:49, Serial0/0 O 172.16.2.0/30 [110/74] via 192.168.4.2, 01:34:01, Ethernet0/0 C 192.168.4.0/24 is directly connected, Ethernet0/0 10.0.0.0/24 is subnetted, 1 subnets O E2 10.1.1.0 [110/20] via 192.168.1.2, 00:01:49, Serial0/0 C 192.168.1.0/24 is directly connected, Serial0/0 192.168.2.0/30 is subnetted, 1 subnets O E2 192.168.2.0 [110/20] via 192.168.4.2, 00:01:54, Ethernet0/0

Die ersten 20 Seiten werden angezeigt. Laden Sie das Dokument herunter, um alles zu sehen.

Kommentare (0)

Anmelden um an der Diskussion teilzunehmen

Noch keine Kommentare. Seien Sie der Erste!