IP相关问题6 --- 重发布实验

实验要求:

1.双点双向重发布

2.所有选路最佳

3.存在备份路径

1.配置ip

1.R1上配置ip

[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 14.1.1.1 24
Aug 10 2023 21:18:55-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

[r1-GigabitEthernet0/0/1]int lo0
[r1-LoopBack0]ip add 1.1.1.1 24

[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 12.1.1.1 24

2.R2上配置ip

[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
Aug 10 2023 21:23:16-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 23.1.1.1 24
Aug 10 2023 21:23:57-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]int lo0
[r2-LoopBack0]ip add 2.2.2.2 24

3.R3上配置ip

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 23.1.1.2 24
Aug 10 2023 21:27:22-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 34.1.1.1 24
Aug 10 2023 21:27:43-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]int lo0
[r3-LoopBack0]ip add 3.3.3.3 24

4.R4上配置ip

[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 14.1.1.2 24
Aug 10 2023 21:28:30-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

[r4-GigabitEthernet0/0/1]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 34.1.1.2 24
Aug 10 2023 21:28:57-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 

[r4-GigabitEthernet0/0/0]int lo0
[r4-LoopBack0]ip add 4.4.4.4 24

2.配置rip

1.R1上配置rip

[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 1.0.0.0
[r1-rip-1]network 12.0.0.0
[r1-rip-1]network 14.0.0.0

2.R2上配置rip

[r2]rip 1
[r2-rip-1]versi	
[r2-rip-1]version 2
[r2-rip-1]net	
[r2-rip-1]network 12.0.0.0
[r2-rip-1]net	
[r2-rip-1]network 2.0.0.0

3.R4上配置rip

[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]network 14.0.0.0

3.配置ospf

1.R2上配置ospf

[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0

2.R3上配置ospf

[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 23.1.1.2 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 34.1.1.1 0.0.0.0

3.R4上配置ospf

[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 0.0.0.0	
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 34.1.1.2 0.0.0.0

4.修改r4上环回网络模式

[r4]int lo0
[r4-LoopBack0]ospf net	
[r4-LoopBack0]ospf network-type broadcast 

5.配置多点双向重发布

1.在R2上配置重发布

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

2.在R4上配置重发布

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

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

1.入接口调用

r1]int g0/0/0
[r1-GigabitEthernet0/0/0]rip metricin ip-prefix 4 2	
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]rip metricin ip-prefix 3 2

2.定义要抓取的流量

[r1]ip ip-prefix 4 index 10 permit 4.4.4.0 24	
[r1]ip ip-prefix 4 index 20 permit 34.1.1.0 24
[r1]ip ip-prefix 3 index 10 permit 23.1.1.0 24

7.ospf区域干涉选路,配置最优路径

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

1.修改aa表中node 10节点流量的属性,类型改为1

[r2-ospf-1]route-policy aa permit node 10            
Info: New Sequence of this List.
[r2-route-policy] if-match ip-prefix aa                    
[r2-route-policy] apply cost-type type-1

[r2-route-policy]route-policy aa permit node 20            
Info: New Sequence of this List.
[r2-route-policy] if-match ip-prefix aa                    
[r2-route-policy] apply cost-type type-1

2.定义空列表,允许其他流量访问

[r2-route-policy]route-policy aa permit node 50
Info: New Sequence of this List.

3.在R2上定义要抓取的流量

[r2]ip ip-prefix aa index 10 permit 2.2.2.0 24
[r2]ip ip-prefix aa index 20 permit 12.1.1.0 24

4.在R4上定义要抓取的流量

[r4]ip ip-prefix aa permit 14.1.1.0 24

5.对抓取的流量修改属性

[r4]route-policy aa permit node 10
Info: New Sequence of this List.
[r4-route-policy]if-match ip-prefix aa
[r4-route-policy]apply cost-type type-1

6.定义空列表,允许让其他流量

[r4]route-policy aa permit node 50
Info: New Sequence of this List.

7.重发布的时候调用

  [r4-ospf-1]import-route rip route-policy aa

8.测试

r3访问12网段,最优路径是走23网段,关闭r3的g0/0/0口,走34网段

[r3]int g0/0/0  
[r3-GigabitEthernet0/0/0]shutdown 

 

 

 

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值