路由引入,路由过滤,路由策略实验

1,配置IP地址

R1:
[R1]dis ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.1.1.1/24         up         up             
LoopBack0                         192.168.0.1/32       up         up(s)     
LoopBack1                         192.168.1.1/32       up         up(s)     

R2:
[R2]dis ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.1.1.2/24         up         up        
GigabitEthernet0/0/1              100.2.2.2/24         up         up        

R3:
[R3]dis ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.2.2.3/24         up         up        
GigabitEthernet0/0/1              100.3.3.3/24         up         up           
LoopBack0                         192.168.2.1/32       up         up(s)     
LoopBack1                         192.168.3.1/32       up         up(s)

R4:
[R4]dis ip interface brief 

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              100.3.3.4/24         up         up            
LoopBack0                         192.168.4.1/32       up         up(s)     
LoopBack1                         192.168.5.1/32       up         up(s)     

2,R1和R2运行RIPV2,R2,R3和R4运行OSPF,各自协议内部互通

RIP:
R1:
[R1]rip 1
[R1-rip-1]v 2
[R1-rip-1]undo summary 
[R1-rip-1]network 100.0.0.0
[R1-rip-1]network 192.168.0.0
[R1-rip-1]network 192.168.1.0

R2:
[R2]rip 1
[R2-rip-1]v 2
[R2-rip-1]net	
[R2-rip-1]network 100.0.0.0

OSPF:
R2:
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 0
[R2-ospf-1-area-0.0.0.0]network 100.2.2.0 0.0.0.255

R3:
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]network 100.2.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 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]network 100.3.3.0 0.0.0.255

R4:
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]a 1
[R4-ospf-1-area-0.0.0.1]network 100.3.3.0 0.0.0.255

3,在RIP和OSPF间配置双向路由引入,要求除R4上的业务网段以外,其他业务网段路由都引入到对方协议内部

[R2]acl 2000
[R2-acl-basic-2000]rule deny source 192.168.4.0 0.0.1.255
//在R2上创建ACL来拒绝R4业务网段	

[R2-acl-basic-2000]rule permit source 0.0.0.0 255.255.255.255
//把其他网段路由放行

[R2-acl-basic-2000]q
[R2]route-policy o2r permit node 10	
[R2-route-policy]if-match acl 2000
//在R2上创建路由策略,关联ACL

[R2]rip 1
[R2-rip-1]import-route ospf route-policy o2r
//在RIP中引入OSPF路由,调用路由策略

[R2-ospf-1]import-route rip
//在OSPF中引入RIP路由

4,使用路由过滤,使R4无法学习到R1的业务网段路由,要求使用prefix-list进行匹配

[R4]ip ip-prefix g1 index 10 deny 192.168.0.0 23 less-equal 32
//将两条业务网段的路由合成一条
                    	
[R4]ip ip-prefix g1 index 20 permit 0.0.0.0 0 less-equal 32
//允许其他路由经过

[R4]ospf 1
[R4-ospf-1]filter-policy ip-prefix gl import 
//配置路由过滤调用上一步创建的prefix-list

5,OSPF区域中不能出现RIP协议报文

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

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值