这个实验,采用并不复杂的组网形式,来验证思科路由器在同时匹配目标地址和源的情况下,进行策略路由配置的功能。具体命令如下。 1.测试拓扑: R5: interface Loopback0 ip address 5.5.5.5 255.255.255.0 ! interface FastEthernet0/0 ip address 50.1.1.5 255.255.255.0 no shutdown 3.静态路由配置: R1: ip route 0.0.0.0 0.0.0.0 12.1.1.2 R2: ip route 0.0.0.0 0.0.0.0 23.1.1.3 ip route 1.1.1.0 255.255.255.0 12.1.1.1 R3: ip route 5.5.5.0 255.255.255.0 50.1.1.5 ip route 12.1.1.0 255.255.255.0 23.1.1.2 R4: ip route 1.1.1.0 255.255.255.0 24.1.1.2 ip route 5.5.5.0 255.255.255.0 50.1.1.5 R5: ip route 0.0.0.0 0.0.0.0 50.1.1.3 ip route 1.1.1.0 255.255.255.0 50.1.1.4 4.R2策略路由配置: A.配置访问控制列表,匹配流量: access-list 110 permit ip 1.1.1.0 0.0.0.255 5.5.5.0 0.0.0.255 B.配置route-map,匹配流量后,设置下一跳 route-map net5 permit 10 match ip address 110 set ip next-hop 24.1.1.4 ! route-map net5 permit 20 C.在访问控制列表对应流量的进入接口应用route-map interface Ethernet0/0 ip policy route-map net5 5.效果测试: A.R1直接traceroute 5.5.5.5 ,这时的源地址为12.1.1.1 R1#traceroute 5.5.5.5 Type escape sequence to abort. 1 12.1.1.2 36 msec 80 msec 44 msec Type escape sequence to abort. 1 12.1.1.2 44 msec 100 msec 56 msec |
不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流
GMT+8, 2024-5-15 17:32 , Processed in 0.064589 second(s), 15 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.