CCIELAB之路由重分佈之單點雙向重分佈的彙總路由反饋

 

一。實驗配置

R1:

R1#sh run
Building configuration...

Current configuration : 738 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!

!
interface Loopback0
ip address 1.1.1.1 255.255.255.255

!
interface FastEthernet0/0
ip address 12.1.1.1 255.255.255.0

duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
shutdown
duplex auto
speed auto
!
router eigrp 100
network 0.0.0.0
no auto-summary

!
no ip http server
no ip http secure-server
!
!
!
!
!
control-plane
!
!
!

!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end

R3:

Building configuration...

Current configuration : 899 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!

!
!

interface Loopback0
ip address 3.3.3.1 255.255.255.255
!
interface Loopback1
ip address 3.3.3.2 255.255.255.255
!
interface Loopback3
ip address 3.3.3.3 255.255.255.255

!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 23.1.1.3 255.255.255.0
duplex auto
speed auto
!
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0

!
no ip http server
no ip http secure-server
!
!
!
!
!
control-plane
!
!

!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end


R2:

Building configuration...

Current configuration : 985 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!

!
interface Loopback2
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
ip summary-address eigrp 100 3.3.3.0 255.255.255.252 5  !對ospf的網段的路由進行手工彙總
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 23.1.1.2 255.255.255.0
duplex auto
speed auto
!
router eigrp 100
redistribute ospf 1 metric 10000 100 255 1 1500
network 12.1.1.2 0.0.0.0
no auto-summary

!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
redistribute eigrp 100 subnets
network 23.1.1.2 0.0.0.0 area 0

!
no ip http server
no ip http secure-server
!
!
!
!
!
control-plane
!

!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end


二 各路由表

R1:
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     3.0.0.0/30 is subnetted, 1 subnets
D       3.3.3.0 [90/284160] via 12.1.1.2, 00:08:14, FastEthernet0/0
     23.0.0.0/24 is subnetted, 1 subnets
D EX    23.1.1.0 [170/284160] via 12.1.1.2, 00:08:34, FastEthernet0/0
     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, FastEthernet0/0


R2:


Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
D       1.1.1.1 [90/156160] via 12.1.1.1, 00:09:51, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback2
     3.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O       3.3.3.3/32 [110/2] via 23.1.1.3, 00:06:22, FastEthernet1/0
O       3.3.3.2/32 [110/2] via 23.1.1.3, 00:06:22, FastEthernet1/0
O       3.3.3.1/32 [110/2] via 23.1.1.3, 00:06:22, FastEthernet1/0
D       3.3.3.0/30 is a summary, 00:08:43, Null0
     23.0.0.0/24 is subnetted, 1 subnets
C       23.1.1.0 is directly connected, FastEthernet1/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, FastEthernet0/0



R3:
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
O E2    1.1.1.1 [110/20] via 23.1.1.2, 00:06:48, FastEthernet1/0
     3.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C       3.3.3.3/32 is directly connected, Loopback3
C       3.3.3.2/32 is directly connected, Loopback1
C       3.3.3.1/32 is directly connected, Loopback0
O E2    3.3.3.0/30 [110/20] via 23.1.1.2, 00:06:48, FastEthernet1/0
     23.0.0.0/24 is subnetted, 1 subnets

C       23.1.1.0 is directly connected, FastEthernet1/0
     12.0.0.0/24 is subnetted, 1 subnets
O E2    12.1.1.0 [110/20] via 23.1.1.2, 00:06:49, FastEthernet1/0
 
 
三。實驗分析
 
 
     從R3路由表可以發現,在R2對ospf域引入的路由進行手動彙總之後,該彙總後的路由條目又被重分佈進ospf域.
     我們設想一下,如果此時R3上的3.3.3.3/32網段失效,那麼R3前往3.3.3.3的報文將根據路由表發往R2,保文到達R2後,R2匹配指向null0的彙總路由條目,將報文丟棄,以避免環路的產生。發現並沒有多大的問題。可是,當ospf域的直徑很大時,那麼目的地址爲3.3.3.3的這條報文本來可以不從R3發出,卻要將歷經好幾個節點才能被丟棄,大大浪費了帶寬和設備的資源。
 
四,解決
 
 
解決的思路很簡單,只要在R2上將eigrp重分佈進ospf時,將這條彙總路由過濾即可
 
 
配置:
R2:
 
ip prefix-list 1 seq 5 permit 3.3.3.0/30
!
route-map filter deny 10
match ip address prefix-list 1
!
route-map filter permit 20
!
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
redistribute eigrp 100 subnets route-map filter
network 23.1.1.2 0.0.0.0 area 0

再次查看R3的路由表:

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
O E2    1.1.1.1 [110/20] via 23.1.1.2, 00:00:02, FastEthernet1/0
     3.0.0.0/32 is subnetted, 3 subnets
C       3.3.3.3 is directly connected, Loopback3
C       3.3.3.2 is directly connected, Loopback1
C       3.3.3.1 is directly connected, Loopback0
     23.0.0.0/24 is subnetted, 1 subnets
C       23.1.1.0 is directly connected, FastEthernet1/0
     12.0.0.0/24 is subnetted, 1 subnets
O E2    12.1.1.0 [110/20] via 23.1.1.2, 00:00:02, FastEthernet1/0

可以發現彙總的路由條目已消失。
 
 
 
PS:爲什麼R3會學到那條彙總的路由條目?其實最本質的原因還是路由重發布的原則問題,因爲R2在本地彙總之後,在本地自動產生一條指向null0的彙總路由以避免路由環路,但也恰恰因爲出現了這條路由條目,所以使其被引入進了ospf域
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章