双点双向重发布实验

文章详细描述了路由器R1、R2、R3和R4的IP地址配置,包括OSPF和RIP路由协议的设置,以及如何通过路由策略控制不同网络间的流量选择。重点涉及了环回地址重发布、不同路由协议间的信息交互和度量值调整。
摘要由CSDN通过智能技术生成

步骤一:IP地址的配置

R1

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.12.1 24
[r1-GigabitEthernet0/0/0]q
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.13.1 24 
[r1-GigabitEthernet0/0/1]q
[r1]int l0
[r1-LoopBack0]ip add 1.1.1.1 24	
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0	
[r1-ospf-1-area-0.0.0.0]network 192.168.12.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.13.1 0.0.0.0

R2

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.12.2 24
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.24.2 24
[r2]int l0
[r2-LoopBack0]ip add 2.2.2.2 24
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.12.2 0.0.0.0
[r2-ospf-1]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.24.0
[r2-rip-1]network 2.0.0.0

R3

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.13.3 24 
[r3-GigabitEthernet0/0/0]q
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.34.3 24
[r3]int l0
[r3-LoopBack0]ip add 3.3.3.3 24
[r3-LoopBack0]q
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.13.3 0.0.0.0
[r3-ospf-1]q
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 3.0.0.0	
[r3-rip-1]network 192.168.34.0

R4

[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.24.4 24
[r4-GigabitEthernet0/0/0]q
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.34.4 24
[r4]int l0
[r4-LoopBack0]ip add 4.4.4.4 24
[r4-LoopBack0]q
[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]network 192.168.24.0	
[r4-rip-1]network 192.168.34.0 
[r4-rip-1]network 4.0.0.0

1.R1环回地址重发布到ospf中:

[r1]route-policy huawei permit node 10
Info: New Sequence of this List.	
[r1-route-policy]if-match int l0
[r1-route-policy]ospf 1
[r1-ospf-1]import-route direct route-policy huawei

2.ospf学不到rip区域的路由信息,进行双点双向重发布;

R2

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

R3

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

 

控制选路:

在R2上将192.168.13.0和3.3.3.0这两条路的度量值加大,在R3上将192.168.12.0这条路的度量值加大即可

R2

[r2]ip ip-prefix aa permit 192.168.13.0 24
[r2]ip ip-prefix aa permit 3.3.3.0 24
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]rip metricin ip-prefix aa 3

R3 

[r3]ip ip-prefix aa permit 192.168.12.0 24
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]rip metricin ip-prefix aa 3

 R2上抓192.168.12.0和2.2.2.0的流量,类型改为1(默认为类型2,类型1优于类型2)  

R2
[r2]ip ip-prefix jm permit 2.2.2.0 24
[r2]ip ip-prefix jm permit 192.168.12.0 24
[r2]route-policy jm permit node 10
Info: New Sequence of this List.	
[r2-route-policy]if-match ip-prefix jm
[r2-route-policy]apply cost-type type-1
[r2-route-policy]q
[r2]ospf 1	
[r2-ospf-1]import-route rip 1 route-policy jm

R3
[r3]ip ip-prefix jm permit 192.168.34.0 24
[r3]route-policy jm permit node 10
Info: New Sequence of this List.
[r3-route-policy]if-match ip-prefix jm
[r3-route-policy]apply cost-type type-1	
[r3-ospf-1]import-route rip 1 route-policy jm

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值