静态路由的配置,具体步骤如下:

[Huawei]undo info-center enable   //关闭路由器输出信息
[R1]interface g0/0/0   //进入接口G0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24  //配置IP地址
[R1-GigabitEthernet0/0/0]undo shutdown  //打开接口
[R1-GigabitEthernet0/0/0]quit 退出
[R1]ping 12.1.1.2  使用ping命令测试R1访问R2的网络连通性
  PING 12.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 12.1.1.2: bytes=56 Sequence=1 ttl=255 time=130 ms
    Reply from 12.1.1.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 12.1.1.2: bytes=56 Sequence=3 ttl=255 time=70 ms
    Reply from 12.1.1.2: bytes=56 Sequence=4 ttl=255 time=60 ms
    Reply from 12.1.1.2: bytes=56 Sequence=5 ttl=255 time=60 ms

  --- 12.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/68/130 ms

[R1]ip route-static 23.1.1.0 255.255.255.0 12.1.1.2
[R1]ip route-static 23.1.1.0 255.255.255.0 g0/0/0
[R1]ip route-static 23.1.1.0 255.255.255.0 g0/0/0 12.1.1.2
[R1]ip route-static 23.1.1.0 255.255.255.0 12.1.1.2
Error: The route already exists.

[R1]display ip routing-table   查看路由表

Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 5        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       12.1.1.0/24  Direct  0    0           D   12.1.1.1        GigabitEthernet
0/0/0
       12.1.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
       23.1.1.0/24  Static  60   0          RD   12.1.1.2        GigabitEthernet
0/0/0
                    Static  60   0           D   12.1.1.1        GigabitEthernet
0/0/0
                    Static  60   0           D   12.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

<R1>ping 23.1.1.3  使用ping命令测试R1访问R3的网络连通性

  PING 23.1.1.3: 56  data bytes, press CTRL_C to break
    Reply from 23.1.1.3: bytes=56 Sequence=1 ttl=254 time=80 ms
    Reply from 23.1.1.3: bytes=56 Sequence=2 ttl=254 time=60 ms
    Reply from 23.1.1.3: bytes=56 Sequence=3 ttl=254 time=50 ms
    Reply from 23.1.1.3: bytes=56 Sequence=4 ttl=254 time=70 ms
    Reply from 23.1.1.3: bytes=56 Sequence=5 ttl=254 time=90 ms

  --- 23.1.1.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 50/70/90 ms

<Huawei>system-view  进入系统视图
[Huawei]undo info-center enable   关闭路由器输出信息
[Huawei]sysname R2
[R2]interface g0/0/1  进入接口G0/0/1
[R2-GigabitEthernet0/0/1]ip address 12.1.1.2 24 配置IP地址
[R2-GigabitEthernet0/0/1]undo shutdown 打开接口
[R2-GigabitEthernet0/0/1]quit
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 23.1.1.2 24
[R2-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R2-GigabitEthernet0/0/0]quit
[R2]ping 23.1.1.3使用ping命令测试R2访问R3的网络连通性

  PING 23.1.1.3: 56  data bytes, press CTRL_C to break
    Reply from 23.1.1.3: bytes=56 Sequence=1 ttl=255 time=130 ms
    Reply from 23.1.1.3: bytes=56 Sequence=2 ttl=255 time=60 ms
    Reply from 23.1.1.3: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 23.1.1.3: bytes=56 Sequence=4 ttl=255 time=30 ms
    Reply from 23.1.1.3: bytes=56 Sequence=5 ttl=255 time=30 ms

  --- 23.1.1.3 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/56/130 ms

<R2>display ip routing-table  查看路由表

Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public           Destinations : 6        Routes : 6        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       12.1.1.0/24  Direct  0    0           D   12.1.1.2        GigabitEthernet
0/0/1
       12.1.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
       23.1.1.0/24  Direct  0    0           D   23.1.1.2        GigabitEthernet
0/0/0
       23.1.1.2/32  Direct  0    0           D   127.0.0.1       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

<Huawei>system-view
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname R3
[R3]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 23.1.1.3 24
[R3-GigabitEthernet0/0/1]undo shutdown
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R3-GigabitEthernet0/0/1]quit
[R3]ip route-static 12.1.1.0 24 23.1.1.2
<R3>display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 5        Routes : 5        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       12.1.1.0/24  Static  60   0          RD   23.1.1.2        GigabitEthernet
0/0/1
       23.1.1.0/24  Direct  0    0           D   23.1.1.3        GigabitEthernet
0/0/1
       23.1.1.3/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
      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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值