设为首页收藏本站language→→ 语言切换

鸿鹄论坛

 找回密码
 论坛注册

QQ登录

先注册再绑定QQ

查看: 1033|回复: 3
收起左侧

[求助] 关于用route-map修改metric重分布不成功

[复制链接]
发表于 2019-8-21 07:54:55 | 显示全部楼层 |阅读模式
3鸿鹄币
用route-map修改重分发路由的值不成功,重分发也不成功,不知道为什么,望高手指点

                               
登录/注册后可看大图


配置如下
R1
Router#show runn
Building configuration...

Current configuration : 985 bytes
!
! Last configuration change at 17:23:48 EET Tue Aug 20 2019
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
!
no aaa new-model
clock timezone EET 2 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!         
!
!
!
!
!


!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!         
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
ip address 12.1.1.1 255.255.255.0
!
interface Ethernet0/1
no ip address
shutdown
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
router rip
version 2
network 12.0.0.0
no auto-summary
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!         
control-plane
!
!
!
!
!
!
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input none
!
!
end

R2
Router#show runn
Building configuration...

Current configuration : 1336 bytes
!
! Last configuration change at 01:20:07 EET Wed Aug 21 2019
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
!
no aaa new-model
clock timezone EET 2 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!


!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!         
!
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
ip address 12.1.1.2 255.255.255.0
!
interface Ethernet0/1
ip address 23.1.1.2 255.255.255.0
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
router ospf 110
no auto-cost
network 12.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
!
router rip
version 2
redistribute ospf 110 route-map test
network 12.0.0.0
network 23.0.0.0
no auto-summary
!
ip forward-protocol nd
!         
!
no ip http server
no ip http secure-server
!
!
route-map test permit 10
match ip address 1
set metric 2
!
route-map test permit 20
match ip address 2
set metric 3
!
!
access-list 1 permit 3.3.3.0
access-list 2 permit 33.33.33.0
!
control-plane
!
!
!
!
!         
!
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input none
!
!
end


R3

Router#show runn
Building configuration...

Current configuration : 1181 bytes
!
! Last configuration change at 17:25:53 EET Tue Aug 20 2019
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone EET 2 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!         
!
!
!
!
!


!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!         
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Loopback1
ip address 33.33.33.33 255.255.255.0
!         
interface Ethernet0/0
no ip address
shutdown
!
interface Ethernet0/1
ip address 23.1.1.3 255.255.255.0
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
router ospf 110
redistribute connected subnets
network 3.3.3.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
network 33.33.33.0 0.0.0.255 area 0
!
ip forward-protocol nd
!         
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input none
!         
!
end

路由表如下
R1

Gateway of last resort is not set

      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.1.1.0/24 is directly connected, Ethernet0/0
L        12.1.1.1/32 is directly connected, Ethernet0/0
      23.0.0.0/24 is subnetted, 1 subnets
R        23.1.1.0 [120/1] via 12.1.1.2, 00:00:02, Ethernet0/0

R2
Gateway of last resort is not set

      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/11] via 23.1.1.3, 08:40:16, Ethernet0/1
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.1.1.0/24 is directly connected, Ethernet0/0
L        12.1.1.2/32 is directly connected, Ethernet0/0
      23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        23.1.1.0/24 is directly connected, Ethernet0/1
L        23.1.1.2/32 is directly connected, Ethernet0/1
      33.0.0.0/32 is subnetted, 1 subnets
O        33.33.33.33 [110/11] via 23.1.1.3, 08:40:16, Ethernet0/1

R3

Gateway of last resort is not set

      3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        3.3.3.0/24 is directly connected, Loopback0
L        3.3.3.3/32 is directly connected, Loopback0
      12.0.0.0/24 is subnetted, 1 subnets
O        12.1.1.0 [110/20] via 23.1.1.2, 08:41:13, Ethernet0/1
      23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        23.1.1.0/24 is directly connected, Ethernet0/1
L        23.1.1.3/32 is directly connected, Ethernet0/1
      33.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        33.33.33.0/24 is directly connected, Loopback1
L        33.33.33.33/32 is directly connected, Loopback1

不知道哪里配的不对,造成用route-map重分发不成功,望高手指点,谢谢




最佳答案

查看完整内容

R2 学到的OSPF路由是3.3.3.3/32,33.33.33.33/32这两个IP地址 access-list 1 permit 3.3.3.0 只是匹配3.3.3.0/32这一个地址,并没有匹配3.3.3.3/32 改成access-list 1 permit 3.3.3.3 就匹配了 3.3.3.3/32 这条从OSPF学到的路由 access-list 1 permit 3.3.3.0 0.0.0.255 匹配3.3.3.0-3.3.3.255即3.3.3.0/24 3.3.3.0/24里包含3.3.3.3/32 所以被匹配了 r2#show access-lists Standard IP access list 1 20 ...
发表于 2019-8-21 07:54:56 | 显示全部楼层
R2 学到的OSPF路由是3.3.3.3/32,33.33.33.33/32这两个IP地址

access-list 1 permit 3.3.3.0 只是匹配3.3.3.0/32这一个地址,并没有匹配3.3.3.3/32

改成access-list 1 permit 3.3.3.3  就匹配了 3.3.3.3/32  这条从OSPF学到的路由

access-list 1 permit 3.3.3.0 0.0.0.255 匹配3.3.3.0-3.3.3.255即3.3.3.0/24
3.3.3.0/24里包含3.3.3.3/32 所以被匹配了


r2#show access-lists
Standard IP access list 1
    20 permit 3.3.3.3 (2 matches) 有匹配IP或路由
    10 permit 3.0.0.0             未匹配IP或路由

通配符是来进行范围的选择
0代表严格固定,不允许变化,1代表可以任何改变(0,1二进制)
沙发 2019-8-21 07:54:56 回复 收起回复
回复

使用道具 举报

发表于 2019-8-21 10:46:53 | 显示全部楼层

R2 上面的ACL没匹配3.3.3.3 和33.33.33.33这两个路由

access-list 1 permit 3.3.3.0
access-list 2 permit 33.33.33.0
改成
access-list 1 permit 3.3.3.0 0.0.0.255
access-list 2 permit 33.33.33.0 0.0.0.255
板凳 2019-8-21 10:46:53 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2019-8-22 08:15:59 | 显示全部楼层
astray0 发表于 2019-8-21 10:46
R2 上面的ACL没匹配3.3.3.3 和33.33.33.33这两个路由

access-list 1 permit 3.3.3.0

谢谢,可以了,但是我有个问题,为什么教程上是像我这么写的,没有反掩码,也是可以的。
access-list 1 permit 3.3.3.0 0.0.0.255 这样写是不是表示通配符掩码,表示用来匹配范围的是吗?
能不能祥细解释一下
地板 2019-8-22 08:15:59 回复 收起回复
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2024-4-19 02:36 , Processed in 0.055858 second(s), 9 queries , Redis On.  

  Powered by Discuz!

  © 2001-2024 HH010.COM

快速回复 返回顶部 返回列表