You are on page 1of 22

Redistribute gia ISIS v OSPF

Tc gi: Nguyn Th Bng Tm


Trong bi ny s thc hin redistribute gia hai giao thc classless l OSPF v
ISIS vi nhau .
Mc tiu bi lm :
Thc hin multiple redistribute points (redistribute ti nhiu im )
Ch ra vn gp phi khi redistribute v cch gii quyt vn .
T mt router ping thy tt c cc a ch trong mng .
M hnh mng nh sau : router R3 v R4 s chy giao thc OSPF , R5 chy giao
thc ISIS. Router R4 v R1 s l cc router thc hin redistribute .

a ch trn cc interface ca cc router :


Router
Router R1
Router R2
Router R3
Router R4
Router R5

Interface
E0/0
S0/0
S0/0
E0/0
E0/0
S0/0
S0/1
S0/0
S0/0
E0/0
Loopback 0

a ch
172.16.1.1/24
172.16.2.2 /30
172.16.2.1/30
192.168.4.2/24
192.168.4.1/24
192.168.1.1/24
192.168.1.2/24
192.168.2.1/30
192.168.2.2/30
172.16.1.2/24
10.1.1.1/24

Cu hnh 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
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
Cu hnh ban u cho cc router :
R1

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)#
cu hnh 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#
cu hnh 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#
cu hnh 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
cu hnh 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
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#
kim tra bng nh tuyn :
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
C
C

172.16.0.0/30 is subnetted, 1 subnets


172.16.2.0 is directly connected, Serial0/0
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
C

172.16.0.0/24 is subnetted, 1 subnets


172.16.1.0 is directly connected, Ethernet0/0
10.0.0.0/24 is subnetted, 1 subnets

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
Cu hnh nh tuyn cho cc router .Router R2,R3, interface s0/0 ca R1 v
interface s0/1 ca R4 chy OSPF process 1 ,cn li l chy ISIS .
Ta bit cu hnh ISIS i hi cn phi c a ch NET ,mi system-ID i din
cho mi node, ta c th gn n mt cch ty nhng m bo system-ID l
duy nht ca mi router trong mt area ta s s dng a ch Mac .
Ta kim tra a ch Mac ca thit b bng cch show arp hoc show interface .
R1#show arp
Protocol Address
Internet 172.16.1.1

Age (min) Hardware Addr Type Interface


- 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
Internet 172.16.1.2

Age (min) Hardware Addr Type Interface


- 00d0.ba1a.f080 ARPA Ethernet0/0

Cu hnh 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
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
kim tra li bng nh tuyn :
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
Nhng route no hc t ISIS s bt u bng i. Trong bi ny cc router chy
ISIS mc nh l L1/L2 router v cc router ang chy level 1 routing nn

c k hiu l L1 .i vi metric ca ISIS th loi metric c chiu di l 1 byte.


Bit 8 ch ra s hin din ca loi metric trong TLV.Bit 7 c dng phn loi
metric l internal hay l external .Internal metric cp n cc route c to
ra trong min ISIS , trong khi external route cp n cc route bn ngoi
min ISIS hoc l t cc giao thc nh tuyn khc. 6 bit cn li dnh cho vic
tnh ton thc s gi tr ca metric. Do ta c gi tr cost cc i ca default
metric l 63 trn mt link . i vi Cisco router cost ca mt link c quyt
nh bi gi tr c ng k n interface ng ra . Cisco ng k default metric
l 10 cho mi interface m khng quan tm interface thuc loi no. Lc ny
mi subnetwork c xem l bng nhau v ISIS metric c tnh ton n gin
bng cch tnh tng cc hop-count n phi i qua n ch , mi hop c cost
l 10. V d trong bng nh tuyn ca R1 ta thy ,route 192.168.2.0 c metric l
20 v n i qua R5,R1. Cost ca cc route hc c t OSPF c tnh tng t
nh bi redistribute gia classfull v classless. Cost ca 192.168.1.0/24 l 138 v
n phi i qua 2 serial interface (mi interface c cost l 64) v mt ethernet
interface (c cost l 10). Cch tnh cost ca OSPF l khng i khi thc hin
redistribute ,do trong bi ny ta s khng xt 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
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
Kim tra bng lnh 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 khng th ping 192.168.2.1 c v R2 chy giao thc OSPF cn mng
192.168.2.0/24 s dng ISIS .Mun thc hin ping thnh cng ta phi
redistribute gia hai giao thc . cu hnh redistribute c thc hin trn c hai
routert R1 v R4 c gi l multiple redistribute points Cu hnh nh sau :
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 cc route ISIS vo OSPF vi metric l 20 v cc route ny ng
vai tr l
level-1.
R1(config-router)#router isis
R1(config-router)#redistribute ospf 1 metric 10 level-1-2
redistribute nhng route OSPF vo ISIS vi metric l 10 v cc route c vai
tr level-1-2 route .
Kim tra bng nh tuyn :
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
trn bng nh tuyn ca R2 khng hc c route no t ISIS l do l v ch
c nhng classfull networks mi c i vo 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
R2,R3 thy c cc route trong ISIS ta thm vo trong cu lnh redistribute
mt 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
cc route c redistribute vo ISIS c th l internal route hoc external
route (internal l default) hoc l level 1 ,hoc l level 2 (level 2 l default ).
Trong cu hnh trn cc OSPF route c redistribute nh l external route vi
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
Kim tra bng nh tuyn:
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
bng nh tuyn ca R4 khng 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
172.16.1.0/24 is directly connected, Ethernet0/0
172.16.2.0/30 is directly connected, Serial0/0
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
i L1 192.168.2.0 [115/20] via 172.16.1.2, Ethernet0/0
bng nh tuyn khc trc ,c s xut hin mt external route . l
route 10.1.1.0 c hc thng qua OSPF qua interface 172.16.2.1 thay v hc
C
C
O

trc tip t router R5 . y ta gp phi mt vn ,c R1 v R4 u ang


redistribute cc route c hc bi ISIS vo OSPF.R4 hc mng 10.1.1.0 thng
qua ISIS v qung b vo OSPF domain .Kt qu l R1 hc mng 10.1.1.0
khng phi t R5 m t R2 thng 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 li router R4 ,quan st bng nh tuyn ca 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 hiu L1
.Bng nh tuyn cng cho thy R1 xem route 192.168.1.0 l level-2 , metric 94
cho thy y l external route.
Trong khi th R4 li xem 10.1.1.0 nh l mt route bn ngoi m n hc c
thng 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
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 hi t trong mt mng : cc router chia s thng tin nh tuyn vi nhau ,
nhng mi c nhn router phi t tnh ton bng nh tuyn ca chng .i vi
mi bng nh tuyn c nhn c chnh xc , cc router c mt ci nhn
chung v topology mng .Lc ny mng c xem l hi t .Nu mng ang
trong qu trnh hi t ,s d dng xy ra nhiu vn nh tuyn nh router ngh
rng mt link ang up trong khi tht s l n ang b down dn n bng nh
tuyn sai v loop d dng xy ra .Mng c xem l hi t nhanh khi khi phc
c s c (nh li lin kt hoc s thay i v mng ) mt cch nhanh chng .
Cc giao thc link-state hi t mng rt nhanh v khi c s thay i xy ra trong
mng ,s thay i ny ngay lp tc c gi i bng multicast ti cc neighbor
trong partial update (tc l update ch gm c s thay i ny ) iu ny lm
loop kh c th xy ra trong mt mng chy ton giao thc link- state .
Tr li vi bi trn ,ta thy loop khng xy ra nhng trong c hai trng
hp ,router R1 v R4 u chn con ng i khng ti u n mng 10.1.1.0
.R1 thay v xem R5 nh l next hop n ch th n li xem R2 nh l next
hop .R4 cng tng t .Ta c th gii thch iu ny nh sau : (xem bng nh
tuyn trc khi R4 c reload )
gi s c hai router R1 v R4 thc hin redistribute cng mt thi im .C hai
router u gi OSPF update trong c mng 10.1.1.0 ,R4 may mn hn ,n
gi update nhanh hn R1. R4 ch gi nhng route m n hc t ISIS vo OSPF ,
l nhng route 172.16.1.0 v 10.1.1.0 , n khng gi nhng route kt ni trc
tip hoc l nhng route n c hc thng qua OSPF.
R3 nhn update t R4 , xem R4 nh l next hop router (quan st bng nh
tuyn ca R3 ,nhng route hc t R4 c t m ) v gi 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
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 , nhn 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 gi update cho nhau . Khi nhn c update ca R2 v mng
10.1.1.0 , router R1 ngh rng ng i n mng 10.1.1.0 qua R2 tt hn v c
AD nh hn , dn n R1 cp nhp bng nh tuyn v xem R2 nh l next-hop.
R1 khng cp nhp nhng route cn li t R2 v bn thn trong bng nh tuyn
ca n tn ti nhng route vi AD tt hn . Khi R2 nhn update t R1 ,
n ch cp nhp route 192.168.2.0 . Lc ny R2 xem R1 nh l next-hop i
n mng 192.168.2.0 , R2 li gi update v mng 192.168.2.0 cho R3 ,R3 xem
R2 l next hop n mng 192.168.2.0 (xem bng nh tuyn ).
Bng nh tuyn ca R5 ,R5 cn bng ti gia 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 trnh hc route ca cc router din ra nh sau :
R5 ,R3 nhn ra s thay i trong mng ,ngay lp tc chng gi update ch bao
gm thng tin v s thay i cho cc router chy cng giao thc vi chng
,trong trng hp ny R5 gi update cho R1 , R3 gi update cho R2 . R1 cng
c th nhn update cho bit v s thay i trong mng t R2 nhng v ISIS hi
t nhanh hn OSPF nn R1 s update thng tin t R5. R1 xem R5 l next-hop
i n cc route cn li trong mng .

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 thng tin v mng ca n , l khi cc mng trong ISIS
hi t xong , R1 lin gi ngay update n cho R2 ,trong update ch bao gm
nhng route bn trong n hc c t ISIS (nhng route c k t L1 pha
trc ), R2 cp nhp update v gi cho R3 ,R3 li gi cho R4 .R4 xem R3 nh
l next-hop .Do khi R4 cp nhp update n s chn ng i n mng
10.1.1.0 qua R3 v n thy ng i qua R3 c AD nh hn .
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 phn tch trn ta thy administrative distance c th gy vic chn ng i
khng ti u m trong mt vi giao thc khc nh RIP ,IGRP c th gy loop ,
lm chm li qu trnh hi t. c nhiu cch gii quyt vn ny nh l s
dng route filtering , thay i administrative distance bng phng php th
cng , hay l s dng route map .Trong bi ny ta s thay i AD bng cch
dng thm cu lnh distance gii quyt vn sub-optimal route , m trong
mt vi trng hp loop v black-hole c th xy ra .
Thay i AD sao cho R1 mun i n mng 10.1.1.0 v 192.168.1.0 phi coi
router R5 l next-hop .R4 mun i n mng 10.1.1.0 v 172.16.1.0 phi coi R5
l next-hop. R2,R3 c th ty chn la ng .
cu hnh 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
!
!
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
!
Cu lnh distance u tin trong hai cu hnh thit lp distance mc nh cho cc
route ca OSPF v ISIS l 130 . Cu lnh distance th hai thit lp mt distance
khc ty theo router qung b no c ch nh v c tham chiu n accesslist .Chng hn trn router R1 , tin trnh ISIS ca R1 ng k distance l 115
cho cc route c qung b bi R5 v c cho php bi access-list 2 .Tt c
cc route cn li c gn distance bng 130 . Inverse mask c s dng trong
a ch ca router qung b (c th l R5 ) ch ra chnh xc interface no m R1
cn i n .i vi OSPF , a ch v inverse mask trong cu lnh distance l
0.0.0.0 255.255.255.255 ch nh bt k router no .Cc route OSPF t tt c cc
router c cho php bi access- list 1 c ng k mt distance l 110 , tt c
cc route cn li khc c distance l 130 .
Cu lnh distance trong R4 c gii thch tng t .
Kt qu l ta c bng nh tuyn 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
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
172.16.1.0/24 is directly connected, Ethernet0/0
172.16.2.0/30 is directly connected, Serial0/0
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
C
C
O

Trong bng nh tuyn ca R4 ta thy rng , R4 ang nh tuyn n tt c cc


mng trong min OSPF thng qua R3 v n tt c cc mng trong min ISIS
thng qua R5 . Distance ca OSPF v ISIS c gn cho cc route .Bng nh
tuyn ca R1 tng t .
thy r hn ngha ca cu lnh distance 130 ,ta gi s interface gia 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
kim tra li bng nh tuyn ca 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
Bng nh tuyn cho thy tt c cc route by gi i n R4 thng qua R3 .Cc
route n cc mng trong min ISIS c distance l 130 , y l route m R4 hc
c thng qua OSPF c metric l 20 v l external route .Khi kt ni trn
interface ca R4 v R5 c khi phc tr li, cc bn tin qung b ISIS t R5
vi distance 115 s thay th cc bn tin qung b OSPF vi distance 130 .
Tng t ,gi s khi kt ni gia R5 v R1 b down th R1 cng hc cc route
trong min ISIS thng qua OSPF vi 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
Bng nh tuyn ca cc router cn li khi tt c cc 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
R5#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
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
Hin ti R5 ang thc hin cn bng ti vi chi ph bng nhau trn c hai router
R1 v R4 i n cc route trong min OSPF .Ta xy dng chnh sch trn R5
sao cho R5 s dng R1 nh l gateway chnh i n min OSPF , cc route
ch i qua R4 khi R1 khng cn thch hp .Tc l s dng R1 nh l primary
gateway cn R4 l backup gateway .S dng cu lnh distance thc hin iu
ny :
R5(config)#router isis
R5(config-router)#distance 100 172.16.1.1 0.0.0.0
R5# clear ip route *
R5#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
i L2 172.16.2.0/30 [100/84] via 172.16.1.1, Ethernet0/0
i L2 192.168.4.0/24 [100/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 [100/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
R5 xem R1 nh l next-hop .
gi s R1 khng cn chy na .
R5(config)#int e0/0
R5(config-if)#shutdown
R5#debug ip packet
IP packet debugging is on
03:27:42: IP: s=172.16.1.2 (local), d=172.16.1.1, len 56, unroutable
03:28:02: IP: s=172.16.1.2 (local), d=172.16.1.1, len 56, unroutable
03:28:21: IP: s=172.16.1.2 (local), d=172.16.1.1, len 56, unroutable
R5#sh ip route
172.16.0.0/30 is subnetted, 1 subnets
i L2 172.16.2.0 [115/84] via 192.168.2.1, Serial0/0

i L2 192.168.4.0/24 [115/84] via 192.168.2.1, Serial0/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
192.168.2.0/30 is subnetted, 1 subnets
C
192.168.2.0 is directly connected, Serial0/0
R5 by gi chuyn sang xem R4 nh l next-hop .

You might also like