重发布实验

实验

在这里插入图片描述
拓扑图:

R1配置

[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 14.1.1.1 24
Sep 25 2022 22:28:26-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]
[R1-GigabitEthernet0/0/0]q
[R1]rip 1
[R1-rip-1]ver 2
[R1-rip-1]ne	
[R1-rip-1]network 14.0.0.0
[R1-rip-1]q
[R1]int l0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]q	
[R1]rip 1
[R1-rip-1]ver 2
[R1-rip-1]network 1.0.0.0

R2的配置

[Huawei]sys R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 24.1.1.1 24
Sep 25 2022 22:39:07-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 l0
[R2-LoopBack0]ip add 2.2.2.2 24
[R2-LoopBack0]q
[R2]ospf 1 router-id 1.1.1.1
[R2-ospf-1]area 0	
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 24.1.1.1 0.0.0.0

R3的配置:

<Huawei>sys 
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 34.1.1.1 24
[R3-GigabitEthernet0/0/0]
Sep 25 2022 22:43:26-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 l0
[R3-LoopBack0]ip add 3.3.3.3 24
[R3-LoopBack0]q
[R3]ospf 2 router-id 3.3.3.3
[R3-ospf-2]area 0	
[R3-ospf-2-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-2-area-0.0.0.0]network 34.1.1.1 0.0.0.0

R4的配置:

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]int l0
[R4-LoopBack0]ip add 4.4.4.4 24
[R4-LoopBack0]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 14.1.1.2 24
Sep 25 2022 22:47:33-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]q
[R4]rip 1
[R4-rip-1]ver 2
[R4-rip-1]network 14.0.0.0
[R4-rip-1]q
[R4]int g 0/0/2
[R4-GigabitEthernet0/0/2]ip add 34.1.1.2 24
Sep 25 2022 22:48:33-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/2 has entered the UP state. 
[R4-GigabitEthernet0/0/2]q
[R4]ospf 2
[R4-ospf-2]area 0
[R4-ospf-2-area-0.0.0.0]network 34.1.1.2 0.0.0.0
[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]net	
[R4-ospf-1-area-0.0.0.0]network 24.1.1.2 0.0.0.0

[R4]display ospf peer brief 

	 OSPF Process 1 with Router ID 4.4.4.4
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/1             1.1.1.1          Full        
 ----------------------------------------------------------------------------

	 OSPF Process 2 with Router ID 4.4.4.4
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/2             3.3.3.3          Full        
 ----------------------------------------------------------------------------

测试连通性:

[R4]ping 14.1.1.1 
  PING 14.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 14.1.1.1: bytes=56 Sequence=1 ttl=255 time=60 ms
    Reply from 14.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 14.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 14.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 14.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 14.1.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/28/60 ms

[R4]ping 24.1.1.1
  PING 24.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 24.1.1.1: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 24.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 24.1.1.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 24.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 24.1.1.1: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 24.1.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/24/30 ms

[R4]ping 34.1.1.1
  PING 34.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 34.1.1.1: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 34.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 34.1.1.1: bytes=56 Sequence=5 ttl=255 time=30 ms

查看R4的路由表

[R4]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 19       Routes : 19       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  RIP     100  1           D   14.1.1.1        GigabitEthernet
0/0/0
        2.2.2.2/32  OSPF    10   1           D   24.1.1.1        GigabitEthernet
0/0/1
        3.3.3.3/32  OSPF    10   1           D   34.1.1.1        GigabitEthernet

ospf 重发布到rip中

[R4]rip 1		R
[R4-rip-1]import-route ospf 1

查看R1的路由表:

R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 12       Routes : 12       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  Direct  0    0           D   1.1.1.1         LoopBack0
        1.1.1.1/32  Direct  0    0           D   127.0.0.1       LoopBack0
      1.1.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
        2.2.2.2/32  RIP     100  1           D   14.1.1.2        GigabitEthernet
0/0/0
       14.1.1.0/24  Direct  0    0           D   14.1.1.1        GigabitEthernet
0/0/0
       14.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
     14.1.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
       24.1.1.0/24  RIP     100  1           D   14.1.1.2        GigabitEthernet
0/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[R4-rip-1]import-route ospf 1 cost 2 可修改默认种子度量 默认为0
两张图看懂重发布
在这里插入图片描述
五号设备可以学到一的路由,凸显重发布的全部。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值