Professional Documents
Culture Documents
Redistribute Gi A ISIS Và OSPF
Redistribute Gi A ISIS Và OSPF
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
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
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
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
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
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