连接几个路由器

 

先配一下三个路由的地址

第一个的IP 

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.

[Huawei]sysname 1

[1]interface g0/0/0

[1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
Nov 14 2022 19:13:45-08:00 1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP o
n the interface GigabitEthernet0/0/0 has entered the UP state. 
[1-GigabitEthernet0/0/0]

 第二个的IP

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.

[Huawei]sysname 2

[2]interface g0/0/0

[2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
Nov 14 2022 19:15:06-08:00 2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP o
n the interface GigabitEthernet0/0/0 has entered the UP state. 

[2-GigabitEthernet0/0/0]quit 

[2]interface g0/0/1

[2-GigabitEthernet0/0/1]ip address 23.1.1.1 24
Nov 14 2022 19:16:19-08:00 2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP o
n the interface GigabitEthernet0/0/1 has entered the UP state. 
[2-GigabitEthernet0/0/1]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

第三个的IP

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.

[Huawei]sysname 3

[3]interface g0/0/0

[3-GigabitEthernet0/0/0]ip address 23.1.1.2 24
Nov 14 2022 19:17:37-08:00 3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP o
n the interface GigabitEthernet0/0/0 has entered the UP state. 
[3-GigabitEthernet0/0/0]

1和2,可以ping通

<1>system-view 
Enter system view, return user view with Ctrl+Z.
[1]ping 12.1.1.2
  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=150 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=40 ms
    Reply from 12.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 12.1.1.2: bytes=56 Sequence=5 ttl=255 time=10 ms

  --- 12.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/48/150 ms

[1]

2和3,可以ping通

<2>system-view 
Enter system view, return user view with Ctrl+Z.
[2]ping 23.1.1.2
  PING 23.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 23.1.1.2: bytes=56 Sequence=1 ttl=255 time=90 ms
    Reply from 23.1.1.2: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 23.1.1.2: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 23.1.1.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 23.1.1.2: bytes=56 Sequence=5 ttl=255 time=20 ms

  --- 23.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/34/90 ms

[2]

查找1的路由表


[1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        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
     12.1.1.255/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
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

[1]

查找2的路由表

<2>system-view 
Enter system view, return user view with Ctrl+Z.

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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

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

[2]

1的静态路由


<1>system-view 
Enter system view, return user view with Ctrl+Z.

[1]ip route-static  23.1.1.0 24 12.1.1.2

再次查看路由

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

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
     12.1.1.255/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
      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

[1]

3给1,2回包


<3>system-view 
Enter system view, return user view with Ctrl+Z.

[3]ip route-static 12.1.1.0 24 23.1.1.1

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

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       12.1.1.0/24  Static  60   0          RD   23.1.1.1        GigabitEthernet
0/0/0
       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
     23.1.1.255/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
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

[3]

此时1再去ping,3,可以ping通

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

  --- 23.1.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/34/50 ms

[1]

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值