重发布路由策略实验

实验要求

1.搭建拓扑

路由策略分析:

拓扑左边是rip协议,右边是ospf协议,想要实现全网可达可以采用多点双向重发布的方式。

对于rip协议使用偏移列表来干涉选路,对于ospf协议采用路由策略来干涉选路

2.配置ip

r1

[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ip address 12.0.0.1 24
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ip address 13.0.0.1 24
[AR1]interface l0
[AR1-LoopBack0]ip address 192.168.1.1 24

r2

[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ip address 12.0.0.2 24
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ip address 24.0.0.0 24 
[AR2]interface l0
[AR2-LoopBack0]ip address 192.168.2.1 24

r3

[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]ip address 13.0.0.2 24
[AR3]interface GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]ip address 34.0.0.1 24
[AR3]interface l0
[AR3-LoopBack0]ip address 3.3.3.3 24

r4

[AR4]interface GigabitEthernet 0/0/0
[AR4-GigabitEthernet0/0/0]ip address 24.0.0.2 24   
[AR4]interface GigabitEthernet 0/0/1
[AR4-GigabitEthernet0/0/1]ip address 34.0.0.2 24
[AR4]interface l0
[AR4-LoopBack0]ip address 4.4.4.4 24

3.配置rip协议

r1

[AR1]rip 1
[AR1-rip-1]version 2
[AR1-rip-1]network 12.0.0.0
[AR1-rip-1]network 13.0.0.0
[AR1-rip-1]network 1.1.1.1

r2

[AR2]rip
[AR2-rip-1]version 2
[AR2-rip-1]network 12.0.0.0
[AR2-rip-1]network 192.168.2.0

r3

[AR3]rip 
[AR3-rip-1]version 2
[AR3-rip-1]network 13.0.0.0

4.ospf协议配置

r2

[AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]network 24.0.0.1 0.0.0.0

r3

 [AR3]ospf 1 router-id 3.3.3.3
 [AR3-ospf-1]area 0
 [AR3-ospf-1-area-0.0.0.0]network 34.0.0.1 0.0.0.0
 [AR3-ospf-1-area-0.0.0.0]network 192.168.3.1 0.0.0.0

r4

 [AR4]ospf 1 router-id 4.4.4.4
 [AR4-ospf-1]area 0
 [AR4-ospf-1-area-0.0.0.0]network 24.0.0.2 0.0.0.0
 [AR4-ospf-1-area-0.0.0.0]network 34.0.0.2 0.0.0.0
 [AR4-ospf-1-area-0.0.0.0]network 192.168.4.1 0.0.0.0

5.双向重发布

r2

 [AR2]rip 1
 [AR2-rip-1]import-route ospf 1
 [AR2]ospf 1
 [AR2-ospf-1]import-route rip
 [AR2]ospf 1
 [AR2-ospf-1]import-route rip 1 route-policy A

r3

 [AR3]rip 1
 [AR3-rip-1]import-route ospf 1
 [AR3]ospf 1
 [AR3-ospf-1]import-route rip

6.路由策略

r2

[AR2]route-policy A permit node 10
[AR2-route-policy]if-match ip-prefix A
[AR2-route-policy]apply cost-type type-1   #修改A表中node节点流量的属性
[AR2]route-policy A permit node 20
[AR2-route-policy]if-match ip-prefix A
[AR2-route-policy]apply cost-type type-1   #修改A表中node节点流量的属性
[AR2]route-policy A permit node 30         #定义空列表,允许其他流量访问
[AR2]ip ip-prefix A index 10 permit 192.168.2.0 24   # 定义要抓取的流量
[AR2]ip ip-prefix A index 20 permit 12.0.0.0 24

r3

[AR3]ip ip-prefix A permit 13.0.0.0 24   #定义要抓取的流量
[AR3]route-policy A permit node 10
[AR3-route-policy]if-match ip-prefix A
[AR3-route-policy]apply cost-type type-1   #对抓取的流量修改属性
[AR3]route-policy A permit node 50   #定义空列表,允许让其他流量通过

7.全网可达测试

r1 ping r4

<AR1>ping -a 192.168.1.1 192.168.4.1
 PING 4.4.4.4: 56data bytes, press CTRL_C to break
    Reply from 192.168.4.1: bytes=56 Sequence=1 ttl=254 time=30 ms
    Reply from 192.168.4.1: bytes=56 Sequence=2 tt1=254 time=10 ms
    Reply from 192.168.4.1: bytes=56 Sequence=3 ttl=254 time=20 ms
    Reply from 192.168.4.1: bytes=56 Sequence-4 ttl=254 time=30 ms
    Reply from 192.168.4.1: bytes=56 Sequence=5 ttl=254 time=20 ms

--- 192.168.4.1ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max=10/22/30ms
相关推荐
云飞云共享云桌面27 分钟前
8位机械工程师如何共享一台图形工作站算力?
linux·服务器·网络
音徽编程3 小时前
Rust异步运行时框架tokio保姆级教程
开发语言·网络·rust
幺零九零零4 小时前
【C++】socket套接字编程
linux·服务器·网络·c++
23zhgjx-NanKon4 小时前
华为eNSP:QinQ
网络·安全·华为
23zhgjx-NanKon4 小时前
华为eNSP:mux-vlan
网络·安全·华为
点点滴滴的记录4 小时前
RPC核心实现原理
网络·网络协议·rpc
Lionhacker5 小时前
网络工程师这个行业可以一直干到退休吗?
网络·数据库·网络安全·黑客·黑客技术
程思扬6 小时前
为什么Uptime+Kuma本地部署与远程使用是网站监控新选择?
linux·服务器·网络·经验分享·后端·网络协议·1024程序员节
ZachOn1y6 小时前
计算机网络:运输层 —— 运输层概述
网络·tcp/ip·计算机网络·运输层
佚明zj6 小时前
【点云网络】voxelnet 和 pointpillar
网络