重发布路由策略实验

实验拓扑图(要求:所有路由器进行最佳选路)

实验分析

首先,该拓扑可以看出左边是跑rip协议,r2的环回在rip;右边跑ospf,r4的环回在ospf;想要两边全网可达,这里采用多点双向重发布的方法,在r2、r4路由上配置,配置完成后可以测试两边都能互相访问,但是会出现r1到r4之间存在选路不佳的问题

配置步骤(过程简化)

【r1】
int g0/0/1: 14.1.1.1 24
int g0/0/0: 12.1.1.1 24
int l0: 1.1.1.1 24
 
【r2】
int g0/0/1: 23.1.1.1 24
int g0/0/0: 12.1.1.2 24
int l0: 2.2.2.2 24
 
【r3】
int g0/0/1: 34.1.1.1 24
int g0/0/0: 23.1.1.2 24
int l0: 3.3.3.3 24
 
【r4】
int g0/0/1: 14.1.1.2 24
int g0/0/0: 34.1.1.2 24
int l0: 4.4.4.4 24

配置rip

【r1】

【r2】

【r4】

配置ospf

【r2】

ospf 1 router-id 2.2.2.2                  
area 0.0.0.0                             
network 23.1.1.1 0.0.0.0  

【r3】

ospf 1 router-id 3.3.3.3                  
area 0.0.0.0                             
network 3.3.3.3 0.0.0.0                 
network 23.1.1.2 0.0.0.0                
network 34.1.1.1 0.0.0.0 

【r4】

ospf 1 router-id 4.4.4.4                                        
area 0.0.0.0                             
network 4.4.4.4 0.0.0.0                 
network 34.1.1.2 0.0.0.0 

配置多点双向重发布 r2  r4

rip区域干涉选路,配置最优路径

# 入接口调用                                       
interface GigabitEthernet0/0/0                
 rip metricin ip-prefix 4 2               
                                         
interface GigabitEthernet0/0/1                
 rip metricin ip-prefix 3 2               
                         
# 定义要抓取的流量
ip ip-prefix 4 index 10 permit 4.4.4.0 24 
ip ip-prefix 4 index 20 permit 34.1.1.0 24
ip ip-prefix 3 index 10 permit 23.1.1.0 24

OSPF区域干涉选路,配置最优路径

# 重发布的时候要调用路由策略                                        
ospf 1                  
 import-route rip 1 route-policy gg       
                               
        
# 修改gg表中node 10节点流量的属性,类型改为了1                                        
route-policy gg permit node 10            
 if-match ip-prefix gg                    
 apply cost-type type-1                   

                                        
route-policy gg permit node 20            
 if-match ip-prefix gg                    
 apply cost-type type-1                   
 
                 
# 定义空列表,允许其他流量访问                                       
route-policy gg permit node 50   
         
# 定义要抓取的流量                                        
ip ip-prefix gg index 10 permit 2.2.2.0 24
ip ip-prefix gg index 20 permit 12.1.1.0 24

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值