路由过滤引入实验

一.实验拓扑及要求

二.配置步骤:

1.IP配置:

R1:

[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 100.1.1.1 24
Apr 23 2024 19:48:47-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R1-GigabitEthernet0/0/0]	
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip add 192.168.0.1 32
[R1-LoopBack0]int l1
[R1-LoopBack1]ip add 192.168.1.1 32
[R1-LoopBack1]

R2:

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 100.1.1.2 24
Apr 23 2024 19:50:06-08:00 R2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 100.2.2.2 24
Apr 23 2024 19:50:42-08:00 R2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R2-GigabitEthernet0/0/1]

R3:

[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 100.2.2.3 24
Apr 23 2024 19:51:19-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 100.3.3.3 24
Apr 23 2024 19:51:37-08:00 R3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[R3-GigabitEthernet0/0/1]int l0
[R3-LoopBack0]ip add 192.168.2.1 32
[R3-LoopBack0]int l1
[R3-LoopBack1]ip add 192.168.3.1 32
[R3-LoopBack1]

R4:

[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 100.3.3.4 24
Apr 23 2024 19:52:54-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R4-GigabitEthernet0/0/0]int l0
[R4-LoopBack0]ip add 192.168.4.1 32
[R4-LoopBack0]int l1
[R4-LoopBack1]ip add 192.168.5.1 32
[R4-LoopBack1]

2.配置路由协议,并且在R2上配置双向路由引入

配置路由协议

R1:

[R1]rip 1
[R1-rip-1]v 2
[R1-rip-1]u	
[R1-rip-1]undo su	
[R1-rip-1]undo summary 
[R1-rip-1]net 192.168.0.0
[R1-rip-1]net 192.168.1.0
[R1-rip-1]net 100.0.0.0

R2:

[R2]rip 1
[R2-rip-1]v 2
[R2-rip-1]u	
[R2-rip-1]undo summary
[R2-rip-1]net 100.0.0.0
[R2-rip-1]q
[R2]ospf 1 ro	
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 0
[R2-ospf-1-area-0.0.0.0]net 100.2.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]

R3:

[R3]ospf 1 ro	
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]net 100.2.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]net 192.168.2.0 0.0.1.255
[R3-ospf-1-area-0.0.0.0]a 1
[R3-ospf-1-area-0.0.0.1]net 100.3.3.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]

R4:

[R4]ospf 1 ro	
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]a 1
[R4-ospf-1-area-0.0.0.1]net 100.3.3.0 0.0.0.255
[R4-ospf-1-area-0.0.0.1]net 192.168.4.0 0.0.1.255

在R2上双向引入

[R2]rip 1
[R2-rip-1]im	
[R2-rip-1]import-route ospf
[R2-rip-1]q
[R2]ospf 1
[R2-ospf-1]im	
[R2-ospf-1]import-route rip
[R2-ospf-1]

3.配置路由策略或者路由过滤

路由策略

[R2]ospf 1
[R2-ospf-1]acl 2000
[R2-acl-basic-2000]ru	
[R2-acl-basic-2000]rule d	
[R2-acl-basic-2000]rule deny so	
[R2-acl-basic-2000]rule deny source 192.168.4.0 0.0.1.255
[R2-acl-basic-2000]ru	
[R2-acl-basic-2000]rule p	
[R2-acl-basic-2000]rule permit s	
[R2-acl-basic-2000]rule permit source 0.0.0.0 255.255.255.255


[R2]ro	
[R2]route-p	
[R2]route-policy oinr p	
[R2]route-policy oinr permit node 10
[R2-route-policy]if	
[R2-route-policy]if-match acl 2000


[R2-rip-1]im	
[R2-rip-1]import-route osp	
[R2-rip-1]import-route ospf ro	
[R2-rip-1]import-route ospf route-policy oinr 

路由过滤:

[R4]ip ip-prefix rino index 10 deny 192.168.0.0 23 less-equal 32

[R4]ip ip-prefix rino index 20 permit 0.0.0.0 0 less-equal 32

[R4-ospf-1]filter-policy ip-prefix rino import 

4.沉默接口:

[R2-rip-1]silent-interface GigabitEthernet 0/0/1

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值