路由过滤与引入

配置IP

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 100.1.1.1 24
Apr 23 2024 19:36:25-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[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]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 100.1.1.2 24
Apr 23 2024 19:38:57-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]: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:39:16-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r2-GigabitEthernet0/0/1]
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]
[r3-GigabitEthernet0/0/0]ip add 100.2.2.3 24
Apr 23 2024 19:40:50-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]: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:41:11-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r3-GigabitEthernet0/0/1]
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 100.3.3.4 24
Apr 23 2024 19:41:59-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]

配置RIP和OSPF

rip

[r1]rip 1
[r1-rip-1]v 2
[r1-rip-1]undo su	
[r1-rip-1]undo summary 
[r1-rip-1]net 100.0.0.0
[r1-rip-1]net 192.168.0.0
[r1-rip-1]net 192.168.1.0
[r1-rip-1]
[r2]rip 1
[r2-rip-1]v 2
[r2-rip-1]undo su	
[r2-rip-1]undo summary 
[r2-rip-1]net 100.0.0.0
[r2-rip-1]

ospf 

[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]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.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]net 192.168.3.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]net 100.3.3.0 0.0.0.255
[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.1 0.0.0.0
[r4-ospf-1-area-0.0.0.1]net 192.168.5.1 0.0.0.0
[r4-ospf-1-area-0.0.0.1]

路由引入

[r2]rip 1
[r2-rip-1]im	
[r2-rip-1]import-route os	
[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]

除r4外,其他业务网段引入到对方协议内部

[r2]acl 2000
[r2-acl-basic-2000]rule deny sou 192.168.4.0 0.0.1.255
[r2-acl-basic-2000]rule permit sou 0.0.0.0 255.255.255.255
[r2-acl-basic-2000]q
[r2]rou	
[r2]route
[r2]route-policy gxc2r pe	
[r2]route-policy gxc2r permit node 10
Info: New Sequence of this List.
[r2-route-policy]if	
[r2-route-policy]if-match acl 2000
[r2-route-policy]q
[r2]rip 1
[r2-rip-1]imp	
[r2-rip-1]import-route ospf 1 rou	
[r2-rip-1]import-route ospf 1 route-policy gx	
[r2-rip-1]import-route ospf 1 route-policy gxc2r 
[r2-rip-1]

路由过滤

[r4]ip ip-p	
[r4]ip ip-prefix aa index 10 deny 192.168.0.0 23 le	
[r4]ip ip-prefix aa index 10 deny 192.168.0.0 23 less-equal 32
[r4]ip ip-prefix aa index 10 permit 0.0.0.0 0 less-equal 32
[r4]ospf 1
[r4-ospf-1]fi	
[r4-ospf-1]filter-lsa-out
[r4-ospf-1]filter-policy ip	
[r4-ospf-1]filter-policy ip-prefix aa im	
[r4-ospf-1]filter-policy ip-prefix aa import 
[r4-ospf-1]

静默接口

[r2]rip 1
[r2-rip-1]sil	
[r2-rip-1]silent-interface g0/0/1
[r2-rip-1]

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值