Professional Documents
Culture Documents
Redistribute Gi A OSPF Và IGRP
Redistribute Gi A OSPF Và IGRP
Router R2
Router R3
Router R4
Interface
S0/0
F0/1
F0/0
Loopback 0
S0/0
S0/1
E0/0
S0/0
E0/0
Loopback 0
E0/0
Loopback 0
Loopback 1
Loopback 2
a ch
192.168.2.1/24
172.16.1.1/28
172.16.1.17/28
192.168.6.1/24
192.168.2.2/24
192.168.1.2/24
192.168.3.2/24
192.168.1.3/24
172.16.4.1/24
10.3.1.1/24
192.168.3.4/24
10.1.1.1/24
10.1.2.160/24
172.16.5.1/24
Cu hnh ban u :
R1
!
Hostname R1
!
Interface Loopback0
Ip address 192.168.6.1 255.255.255.0
!
Interface fastethernet0/0
Ip address 172.16.1.16 255.255.255.240
!
Interface Serial0/0
Ip address 192.168.2.1 255.255.255.0
!
Interface fastethernet0/1
Ip address 172.16.1.1 255.255.255.240
!
End
R2
!
Hostname R2
!
Interface Ethernet0/0
Ip address 192.168.3.2 255.255.255.0
!
Interface Serial0/0
Ip address 192.168.2.2 255.255.255.0
Clockrate 64000
!
Interface Serial0/1
Ip address 192.168.1.2 255.255.255.0
!
End
R3
!
Hostname R3
!
Interface Loopback0
Ip address 10.3.1.1 255.255.255.0
!
Interface Ethernet0/0
Ip address 172.16.4.1 255.255.255.0
!
Interface Serial0/0
Ip address 192.168.1.3 255.255.255.0
Clockrate 64000
!
Ip classless
!
End
R4
!
Hostname R4
!
Interface Loopback0
Ip address 10.1.1.1 255.255.255.0
!
Interface Loopback1
Ip address 10.1.2.160 255.255.255.0
!
Interface Loopback2
Ip address 172.16.5.1 255.255.255.0
!
Interface Ethernet0/0
Ip address 192.168.3.4 255.255.255.0
!
End
By gi ta tin hnh cu hnh tng bc cho cc router :
Cu hnh cho router R1 :
Press RETURN to get started!
Router>enable
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)#logging synchronous
R1(config-line)#line vty 0 4
R1(config-line)#no login
R1(config-line)#exit
R1(config)#interface s0/0
R1(config-if)#ip address 192.168.2.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface f0/1
R1(config-if)#ip address 172.16.1.1 255.255.255.240
R1(config-if)#no keepalive
R1(config-if)#no shutdown
00:15:24: %LINK-3-UPDOWN: Interface fastethernet0/1, changed state to up
00:15:25: %LINEPROTO-5-UPDOWN: Line protocol on Interface
fastethernet0/1, changed
State to up
R1(config-if)#interface f0/0
R1(config-if)#ip address 172.16.1.17 255.255.255.240
R1(config-if)#no keepalive
R1(config-if)#no shutdown
R1(config-if)#exit
00:15:45: %LINK-3-UPDOWN: Interface fastethernet0/0, changed state to up
00:15:46: %LINEPROTO-5-UPDOWN: Line protocol on Interface
fastethernet0/0, changed state to up
R1(config)#interface loopback 0
R1(config-if)#ip address 192.168.6.1 255.255.255.0
R1(config)#exit
R1#copy running-config startup-config
Building configuration...
[OK]
(thc hin lu cu hnh)
Cu hnh cho router R2 :
Press RETURN to get started!
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)#logging synchronous
R2(config-line)#line vty 0 4
R2(config-line)#no login
R2(config-line)#exit
R2(config)#interface s0/0
R2(config-if)#ip address 192.168.2.2 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shutdown
R2(config-if)#interface s0/1
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface e0/0
R2(config-if)#ip address 192.168.3.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#exit
R2#
R2#wr
Building configuration...
[OK]
(thc hin lu cu hnh )
Cu hnh cho router R3 :
Press RETURN to get started!
Router>enable
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)#logging synchronous
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.3 255.255.255.0
R3(config-if)#clock rate 64000
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface e0/0
R3(config-if)#ip address 172.16.4.1 255.255.255.0
R3(config-if)#no keepalive
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#int loopback 0
R3(config-if)#ip address 10.3.31.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#exit
R3#write
Building configuration...
[OK]
(thc hin lu cu hnh)
Cu hnh cho router R4 :
Press RETURN to get started!
Router>enable
Router#configure t
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)#logging synchronous
R4(config-line)#line vty 0 4
R4(config-line)#no login
R4(config-line)#exit
R4(config)#interface e0/0
R4(config-if)#ip address 192.168.3.4 255.255.255.0
R4(config-if)#no shutdown
R4(config-if)#exit
*Mar 1 00:04:19.865: %LINK-3-UPDOWN: Interface Ethernet0/0, changed
state to up
R4(config)#interface loopback 0
R4(config-if)#ip address 10.1.1.1 255.255.255.0
R4(config-if)#interface loopback 1
R4(config-if)#ip address 10.1.2.160 255.255.255.0
R4(config-if)#interface loopback 2
R4(config-if)#ip address 172.16.5.1 255.255.255.0
R4(config-if)#exit
R4(config)#exit
R4#wr
Building configuration...
[OK]
(thc hin lu cu hnh)
R2#sh ip route
<omitted>
Gateway of last resort is not set
C
C
C
R3#sh ip route
<omitted>
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C
172.16.4.0 is directly connected, Ethernet0/0
10.0.0.0/24 is subnetted, 1 subnets
C
10.3.1.0 is directly connected, Loopback0
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/24 is subnetted, 1 subnets
172.16.5.0 is directly connected, Loopback2
10.0.0.0/24 is subnetted, 2 subnets
C
10.1.2.0 is directly connected, Loopback1
C
10.1.1.0 is directly connected, Loopback0
C 192.168.3.0/24 is directly connected, Ethernet0/0
C
Cu hnh nh sau :
R1(config)#router ospf 1
R1(config-router)#network 172.16.1.0 0.0.0.15 area 0
R1(config-router)#network 172.16.1.16 0 0.0.0.15 area 0
R1(config-router)#network 192.168.2.0 0.0.0.255 area 0
R1(config-router)#network 192.168.6.0 0.0.0.255 area 0
R2(config)#router ospf 1
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
R2(config-router)#network 192.168.3.0 0.0.0.255 area 0
R2(config-router)#exit
R2(config)#router igrp 1
R2(config-router)#network 192.168.1.0
R2(config-router)#exit
R3(config)#router igrp 1
R3(config-router)#network 172.16.0.0
R3(config-router)#network 10.0.0.0
R3(config-router)#network 192.168.1.0
R4(config)#router ospf 1
R4(config-router)#network 192.168.3.0 0.0.0.255 area 0
R4(config-router)#network 10.1.1.0 0.0.0.255 area 0
R4(config-router)#network 10.1.2.0 0.0.0.255 area 0
R4(config-router)#network 172.16.5.1 0.0.0.0 area 0
Kim tra li bng nh tuyn :
R1#sh ip route
<omitted>
Gateway of last resort is not set
O
C
C
O
O
C
C
O
C
10.3.1.0 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Serial0/0
I 192.168.2.0/24 [100/10476] via 192.168.1.2, 00:00:07, Serial0/0
I 192.168.3.0/24 [100/8576] via 192.168.1.2, 00:00:07, Serial0/0
I 192.168.6.0/24 [100/12100] via 192.168.1.2, 00:00:07, Serial0/0
R3 hc c 3 route t bn ngoi . l route 192.168.2.0/24 c metric l
10476 , route 192.168.3.0/24 c metric l 8576 v route 192.168.6.0/24 c
metric l 12100 .Metric y c tnh theo cng thc m ta nu phn
mt.
Metric trong cu lnh redistribute cc route OSPF vo IGRP ch c ngha i
vi nhng route m R2 hc c t OSPF. i vi cc route kt ni trc tip
vi n th metric c ly mc nh trn interface . Hai route 192.168.3.0/24
v 192.168.2.0/24 l 2 route kt ni trc tip vi R2 do metric ca n l
metric mc nh trn 2 interface ethernet v serial .
i vi mng 192.168.2.0 /24
Bng thng mc nh trn serial interface l 1544Kbit , delay mc nh trn
interface ny l 20000s .Tng delay trn 2 serial interface s l 40000s .
=> BWIGRPmin = 107 / 1544 = 6476
DLYIGRPsum = 40000/10 = 4000
metric = BWIGRPmin + DLYIGRPsum = 6476 + 4000
metric = 10476
i vi mng 192.168.3.0 /24
bng thng mc nh trn ethernet l 10Mbps => bng thng nh nht ca mng
ny n R3 l bng thng trn serial interface 1554kbit .
Delay mc nh trn ethernet interface l 1000 => tng delay = 20000 +1000 =
21000
=> BWIGRPmin = 107 / 1544 = 6476
DLYIGRPsum = 21000/10 = 2100
metric = BWIGRPmin + DLYIGRPsum = 6476 + 2100
metric = 8576
i vi mng 192.168.6.0/24 :
V y khng phi l mng kt ni trc tip vi R2 m c R2 hc c thng
qua OSPF v c redistribute vo IGRP , do metric ca mng 192.168.6.0
c tnh theo metric m ta thit lp trong cu lnh redistribute .
Bng thng gn cho cc route bn ngoi khi c redistribute vo IGRP l
1000Kbit , bng thng trn serial interface gia R2 v R3 l 1544Kbit => bng
thng nh nht l 1000Kbit .
Delay gn cho cc route bn ngoi khi c redistribute vo IGRP l 1000s
=> tng delay = 20000 + 1000 = 21000
=> BWIGRPmin = 107 / 1000 = 10000
DLYIGRPsum = 21000/10 = 2100
metric = BWIGRPmin + DLYIGRPsum = 10000 + 2100
metric = 12100
Thc hin lnh show ip route cho tng route thy r hn :
R3#sh ip route 192.168.2.0
Routing entry for 192.168.2.0/24
Known via "igrp 1", distance 100, metric 10476
Redistributing via igrp 1
Advertised by igrp 1 (self originated)
Last update from 192.168.1.2 on Serial0/1, 00:00:07 ago
Routing Descriptor Blocks:
* 192.168.1.2, from 192.168.1.2, 00:00:07 ago, via Serial0/1
Route metric is 10476, traffic share count is 1
Total delay is 40000 microseconds, minimum bandwidth is 1544 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 0
R3#sh ip route 192.168.3.0
Routing entry for 192.168.3.0/24
Known via "igrp 1", distance 100, metric 8576
Redistributing via igrp 1
Advertised by igrp 1 (self originated)
Last update from 192.168.1.2 on Serial0/1, 00:00:07 ago
Routing Descriptor Blocks:
* 192.168.1.2, from 192.168.1.2, 00:00:07 ago, via Serial0/1
Route metric is 8576, traffic share count is 1
Total delay is 1000 microseconds, minimum bandwidth is 1544 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 0
R3#sh ip route 192.168.6.0
Routing entry for 192.168.6.0/24
Known via "igrp 1", distance 100, metric 12100
Redistributing via igrp 1
Advertised by igrp 1 (self originated)
Last update from 192.168.1.2 on Serial0/1, 00:00:07 ago
Routing Descriptor Blocks:
* 192.168.1.2, from 192.168.1.2, 00:00:07 ago, via Serial0/1
Route metric is 12100, traffic share count is 1
Total delay is 21000 microseconds, minimum bandwidth is 1000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 0
R3#ping 192.168.3.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.2, timeout is 2 seconds:
!!!!!
C , R3 loi b update
Cc route khc c gii thch hon ton tng t.
gii quyt vn discontiguous network v VLSM ta cu hnh static route
ch cho R3 bit ng i n cc mng trn .
R3(config)#ip route 10.1.1.0 255.255.255.0 s0/0
R3(config)#ip route 172.16.5.0 255.255.255.0 192.168.1.2
R3(config)#ip route 10.1.2.0 255.255.255.0 192.168.1.2
Cc route trn R3 c subnet mask l 24 ,do R3 s khng hiu nhng route c
subnet mask l 28 .Do ta thc hin summarize nhng route c mask 28 thnh
mask 24 bng mt static route.
R3(config)#ip route 172.16.1.0 255.255.255.0 192.168.1.2
R3#sh ip route
Gateway of last resort is not set
C
S
S
C
S
S
C
I
I
I
C
192.168.6.0/24 is directly connected, Loopback0
O 192.168.3.0/24 [110/74] via 192.168.2.2, 00:31:42, Serial0/0
Trn bng nh tuyn ta thy ,cost ca cc external route l 84 (64 + 20 ) thay v
20
R4#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks
O
172.16.1.16/28 [110/75] via 192.168.3.2, 00:32:06, Ethernet0/0
C
172.16.5.0/24 is directly connected, Loopback2
O E1 172.16.0.0/16 [110/30] via 192.168.3.2, 00:01:00, Ethernet0/0
O
172.16.1.0/28 [110/75] via 192.168.3.2, 00:32:06, Ethernet0/0
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C
10.1.2.0/24 is directly connected, Loopback1
C
10.1.1.0/24 is directly connected, Loopback0
O E1 10.0.0.0/8 [110/30] via 192.168.3.2, 00:01:00, Ethernet0/0
O E1 192.168.1.0/24 [110/30] via 192.168.3.2, 00:01:00, Ethernet0/0
O 192.168.2.0/24 [110/74] via 192.168.3.2, 00:32:06, Ethernet0/0
O 192.168.6.0/24 [110/74] via 192.168.3.2, 00:32:06, Ethernet0/0
C 192.168.3.0/24 is directly connected, Ethernet0/0
Cost ca cc external route l 30 (10 + 20) thay v 20 nh ban u .
Ta th thay i cc thng s v metric ca cc external route c redistribute
vo OSPF ri kim tra bng lnh show ip route :
R2(config)#router ospf 1
R2(config-router)#no redistribute igrp 1 metric 20 metric-type 1 subnets
R2(config-router)#redistribute igrp 1 metric 30 metric-type 1 subnets
R4#sh ip route
Gateway of last resort is not set
O E1 172.16.0.0/16 [110/40] via 192.168.3.2, 00:01:00, Ethernet0/0
O E1 10.0.0.0/8 [110/40] via 192.168.3.2, 00:01:00, Ethernet0/0
O E1 192.168.1.0/24 [110/40] via 192.168.3.2, 00:01:00, Ethernet0/0
R2(config)#router ospf 1
R2(config-router)#no redistribute igrp 1 metric 30 metric-type 1 subnets
R2(config-router)#redistribute igrp 1 metric 10 metric-type 1 subnets
R4#sh ip route
Gateway of last resort is not set
O E1
R4#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks
O
172.16.1.16/28 [110/75] via 192.168.3.2, 01:19:52, Ethernet0/0
C
172.16.5.0/24 is directly connected, Loopback2
O E2 172.16.0.0/16 [110/20] via 192.168.3.2, 00:00:57, Ethernet0/0
O
172.16.1.0/28 [110/75] via 192.168.3.2, 01:19:52, Ethernet0/0
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C
10.1.2.0/24 is directly connected, Loopback1
C
10.1.1.0/24 is directly connected, Loopback0
O E2 10.0.0.0/8 [110/20] via 192.168.3.2, 00:00:57, Ethernet0/0
O E2 192.168.1.0/24 [110/20] via 192.168.3.2, 00:00:57, Ethernet0/0
O 192.168.2.0/24 [110/74] via 192.168.3.2, 01:19:52, Ethernet0/0
O 192.168.6.0/24 [110/74] via 192.168.3.2, 01:19:52, Ethernet0/0
C 192.168.3.0/24 is directly connected, Ethernet0/0
Khi thc hin redistribute m khng ng k metric cho cc external route th
mc nh metric l 20 cho cc route c redistribute vo OSPF ,external type l
E2 , v 0 cho cc route c redistribute vo cc giao thc khc .
R2(config)#router ospf 1
R2(config-router)#no redistribute igrp 1 subnets
R2(config-router)#redistribute igrp 1 metric-type 1 subnets
R4#sh ip route
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks
O
172.16.1.16/28 [110/75] via 192.168.3.2, 01:28:16, Ethernet0/0
C
172.16.5.0/24 is directly connected, Loopback2
O E1 172.16.0.0/16 [110/30] via 192.168.3.2, 00:00:18, Ethernet0/0
O
172.16.1.0/28 [110/75] via 192.168.3.2, 01:28:16, Ethernet0/0
Bt debug ln quan st :
R3#debug ip igrp transactions
IGRP protocol debugging is on
01:12:37: IGRP: received update from 192.168.1.2 on Serial0/0
01:12:37:
network 192.168.2.0, metric=4294967295 (inaccessible)
01:12:37:
network 192.168.3.0, metric=4294967295 (inaccessible)
01:12:37:
network 192.168.6.0, metric=4294967295 (inaccessible)
R2#show running-config
!
Router ospf 1
Redistribute igrp 1 metric-type 1 subnets
Network 192.168.2.0 0.0.0.255 area 0
Network 192.168.3.0 0.0.0.255 area 0
!
Router igrp 1
Redistribute ospf 1 metric 1000 100 255 255 1500
Network 192.168.1.0
Default-metric 5000 100 255 1 1500
!
01:19:19: IGRP: sending update to 255.255.255.255 via Ethernet0/0
(172.16.4.1)
01:19:19:
network 10.0.0.0, metric=501
01:19:19:
network 192.168.1.0, metric=8476
01:19:19:
network 192.168.2.0, metric=10476
01:19:19:
network 192.168.3.0, metric=8576
01:19:19:
network 192.168.6.0, metric=12100
01:19:19: IGRP: sending update to 255.255.255.255 via Serial0/0 (192.168.1.3)
01:19:19:
network 172.16.0.0, metric=1100
01:19:19:
network 10.0.0.0, metric=501
01:19:19: IGRP: sending update to 255.255.255.255 via Loopback0 (10.3.1.1)
01:19:19:
subnet 10.1.1.0, metric=8476
01:19:19:
network 172.16.0.0, metric=1100
01:19:19:
network 192.168.1.0, metric=8476
01:19:19:
network 192.168.2.0, metric=10476
01:19:19:
network 192.168.3.0, metric=8576
01:19:19:
network 192.168.6.0, metric=12100
01:19:44: IGRP: received update from 192.168.1.2 on Serial0/0
01:19:44:
network 172.16.0.0, metric 10576 (neighbor 8576)
01:19:44:
network 10.0.0.0, metric 10976 (neighbor 8976)
01:19:44:
network 192.168.2.0, metric 10476 (neighbor 8476)
01:19:44:
network 192.168.3.0, metric 8576 (neighbor 1100)
Kim tra li bng nh tuyn ca R3 ,ta thy metric vn khng thay i .
R3#sh ip route
I 192.168.2.0/24 [100/10476] via 192.168.1.2, 00:03:30, Serial0/0
I 192.168.3.0/24 [100/8576] via 192.168.1.2, 00:03:30, Serial0/0
I 192.168.6.0/24 [100/12100] via 192.168.1.2, 00:03:30, Serial0/0
Nu b phn metric trong cu lnh redistribute th default- metric s c s
dng .
R2#show running-config
!
Router igrp 1
Redistribute ospf 1
Network 192.168.1.0
Default-metric 5000 100 255 1 1500
!
R3#sh ip route
I 192.168.2.0/24 [100/10476] via 192.168.1.2, 00:03:30, Serial0/0
I 192.168.3.0/24 [100/8576] via 192.168.1.2, 00:03:30, Serial0/0
I 192.168.6.0/24 [100/8576] via 192.168.1.2, 00:03:30, Serial0/0
R3#sh ip route 192.168.6.0
Routing entry for 192.168.6.0/24
Known via "igrp 1", distance 100, metric 8576
Redistributing via igrp 1
Advertised by igrp 1 (self originated)
Last update from 192.168.1.2 on Serial0/1, 00:02:07 ago
Routing Descriptor Blocks:
* 192.168.1.2, from 192.168.1.2, 00:02:07 ago, via Serial0/1
Route metric is 12100, traffic share count is 1
Total delay is 21000 microseconds, minimum bandwidth is 1544 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 0
Ta bit khi thc hin update, IGRP s broadcast ra ton mng , do tit
kim ti nguyn mng v trnh cho OSPF nhn update c nhng thng tin
khng cn thit th sau
khi hon tt cu hnh, ta nn s
dng thm lnh passive-interface t interface s0/1 ca router R2. Lnh ny c
ngha cho php router nhn nhng khng gi update ra ngoi .Khng nn s
dng lnh ny i vi OSPF v n s chn lun qu trnh trao i gi tin hello
dn n mi quan h lng ging khng c thnh lp.