路由器配置静态和默认路由实现VLAN之间的通信

news2024/11/18 3:29:21

目录

华为路由器静态路由和默认路由的写法

静态路由和默认路由的区别

案例


华为路由器静态路由和默认路由的写法

配置静态路由:

[Huawei] ip route-static <目标网络> <子网掩码> <下一跳地址>

实例:将目标网络192.168.10.0/24的流量发送到下一跳地址10.0.0.1

[Huawei] ip route-static 192.168.10.0 255.255.255.0 10.0.0.1

配置默认路由:

[Huawei] ip route-static 0.0.0.0 0.0.0.0 <下一跳地址>


实例:将未知目标网络的流量发送到默认下一跳地址203.0.113.1
[Huawei] ip route-static 0.0.0.0 0.0.0.0 203.0.113.1

静态路由和默认路由的区别

  1. 静态路由需要手动为每个目标网络配置路由表项。当网络规模变大时,需要手动配置大量的路由表项,而且路由表需要经常更新以适应网络拓扑的变化。而默认路由只需要配置一条路由表项,将所有未知目标网络的流量都发送到下一跳地址,这样可以简化路由表的配置和维护。

  2. 静态路由通常需要手动配置和更新,因此对于复杂的网络拓扑或动态变化的网络环境,静态路由可能不够灵活。而默认路由则更加简单和灵活,适用于较简单的网络环境或者那些需要快速配置的场景。

  3. 静态路由的路由选择是基于管理员手动配置的路由策略来决定下一跳地址。管理员可以根据具体的需求配置不同的路由策略,例如基于最短路径、最优成本等。而默认路由会将所有未知目标网络的流量发送到预设的下一跳地址,没有复杂的路由选择过程。

  4. 静态路由没有自动学习的能力,需要手动配置每个目标网络的路由表项。而一些路由协议(如OSPF或BGP)可以自动学习和更新路由表,根据网络的动态变化自动调整路由路径。虽然默认路由本身不具备自动学习的能力,但是当与动态路由协议结合使用时,可以从邻居路由器处自动学习到默认路由。

案例

下面来看案例,这次案例比较简单,主要看现象

 设备配置如下

为LSW1配置默认路由 

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW1
[LSW1]vlan batch 
Sep 17 2023 16:47:30-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 4, the 
[LSW1]undo info-center enable
Info: Information center is disabled.
[LSW1]vlan batch 10 30 101
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW1]interface g0/0/9
[LSW1-GigabitEthernet0/0/9]port link-type access
[LSW1-GigabitEthernet0/0/9]port default vlan 10
[LSW1-GigabitEthernet0/0/9]qu
[LSW1]interface g0/0/13
[LSW1-GigabitEthernet0/0/13]port link-type access
[LSW1-GigabitEthernet0/0/13]port default vlan 30
[LSW1-GigabitEthernet0/0/13]qu
[LSW1]interface g0/0/24
[LSW1-GigabitEthernet0/0/24]port link-type access
[LSW1-GigabitEthernet0/0/24]port default vlan 101
[LSW1-GigabitEthernet0/0/24]qu
[LSW1]display vlan
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:GE0/0/1(D)      GE0/0/2(D)      GE0/0/3(D)      GE0/0/4(D)      
                GE0/0/5(D)      GE0/0/6(D)      GE0/0/7(D)      GE0/0/8(D)      
                GE0/0/10(D)     GE0/0/11(D)     GE0/0/12(D)     GE0/0/14(D)     
                GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     
                GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     
                GE0/0/23(D)                                                     

10   common  UT:GE0/0/9(U)                                                      

30   common  UT:GE0/0/13(U)                                                     

101  common  UT:GE0/0/24(U)                                                     


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001                         
10   enable  default       enable  disable    VLAN 0010                         
30   enable  default       enable  disable    VLAN 0030                         
101  enable  default       enable  disable    VLAN 0101                         

[LSW1]display port vlan
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1    hybrid       1     -                                   
GigabitEthernet0/0/2    hybrid       1     -                                   
GigabitEthernet0/0/3    hybrid       1     -                                   
GigabitEthernet0/0/4    hybrid       1     -                                   
GigabitEthernet0/0/5    hybrid       1     -                                   
GigabitEthernet0/0/6    hybrid       1     -                                   
GigabitEthernet0/0/7    hybrid       1     -                                   
GigabitEthernet0/0/8    hybrid       1     -                                   
GigabitEthernet0/0/9    access       10    -                                   
GigabitEthernet0/0/10   hybrid       1     -                                   
GigabitEthernet0/0/11   hybrid       1     -                                   
GigabitEthernet0/0/12   hybrid       1     -                                   
GigabitEthernet0/0/13   access       30    -                                   
GigabitEthernet0/0/14   hybrid       1     -                                   
GigabitEthernet0/0/15   hybrid       1     -                                   
GigabitEthernet0/0/16   hybrid       1     -                                   
GigabitEthernet0/0/17   hybrid       1     -                                   
GigabitEthernet0/0/18   hybrid       1     -                                   
GigabitEthernet0/0/19   hybrid       1     -                                   
GigabitEthernet0/0/20   hybrid       1     -                                   
GigabitEthernet0/0/21   hybrid       1     -                                   
GigabitEthernet0/0/22   hybrid       1     -                                   
GigabitEthernet0/0/23   hybrid       1     -                                   
GigabitEthernet0/0/24   access       101   -                                   

[LSW1]interface vlanif 10
[LSW1-Vlanif10]ip address 192.168.10.1 24
[LSW1-Vlanif10]qu
[LSW1]interface vlanif 30
[LSW1-Vlanif30]ip address 192.168.30.1 24
[LSW1-Vlanif30]qu
[LSW1]interface vlanif 101
[LSW1-Vlanif101]ip address 192.168.101.1 24
[LSW1-Vlanif101]qu

[LSW1]display interface brief
PHY: Physical
*down: administratively down
(l): loopback
(s): spoofing
(b): BFD down
(e): ETHOAM down
(dl): DLDP down
(d): Dampening Suppressed
InUti/OutUti: input utility/output utility
Interface                   PHY   Protocol InUti OutUti   inErrors  outErrors
GigabitEthernet0/0/1        down  down        0%     0%          0          0
GigabitEthernet0/0/2        down  down        0%     0%          0          0
GigabitEthernet0/0/3        down  down        0%     0%          0          0
GigabitEthernet0/0/4        down  down        0%     0%          0          0
GigabitEthernet0/0/5        down  down        0%     0%          0          0
GigabitEthernet0/0/6        down  down        0%     0%          0          0
GigabitEthernet0/0/7        down  down        0%     0%          0          0
GigabitEthernet0/0/8        down  down        0%     0%          0          0
GigabitEthernet0/0/9        up    up          0%     0%          0          0
GigabitEthernet0/0/10       down  down        0%     0%          0          0
GigabitEthernet0/0/11       down  down        0%     0%          0          0
GigabitEthernet0/0/12       down  down        0%     0%          0          0
GigabitEthernet0/0/13       up    up          0%     0%          0          0
GigabitEthernet0/0/14       down  down        0%     0%          0          0
GigabitEthernet0/0/15       down  down        0%     0%          0          0
GigabitEthernet0/0/16       down  down        0%     0%          0          0
GigabitEthernet0/0/17       down  down        0%     0%          0          0
GigabitEthernet0/0/18       down  down        0%     0%          0          0
GigabitEthernet0/0/19       down  down        0%     0%          0          0
GigabitEthernet0/0/20       down  down        0%     0%          0          0
GigabitEthernet0/0/21       down  down        0%     0%          0          0
GigabitEthernet0/0/22       down  down        0%     0%          0          0
GigabitEthernet0/0/23       down  down        0%     0%          0          0
GigabitEthernet0/0/24       up    up          0%     0%          0          0

[LSW1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
MEth0/0/1                         unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Vlanif1                           unassigned           down       down      
Vlanif10                          192.168.10.1/24      up         up        
Vlanif30                          192.168.30.1/24      up         up        
Vlanif101                         192.168.101.1/24     up         up        

[LSW1]display IP interface vlanif 10
Vlanif10 current state : UP 
Line protocol current state : UP
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
 received packets:            0, sent packets:            0 
 forwarded packets:           0, dropped packets:           0 
Internet Address is 192.168.10.1/24 
Broadcast address : 192.168.10.255
TTL being 1 packet number:         0
TTL invalid packet number:         0
ICMP packet input number:          0
  Echo reply:                      0
  Unreachable:                     0
  Source quench:                   0
  Routing redirect:                0
  Echo request:                    0
  Router advert:                   0
  Router solicit:                  0
  Time exceed:                     0
  IP header bad:                   0
  Timestamp request:            

[LSW1]display IP interface vlanif 30
Vlanif30 current state : UP 
Line protocol current state : UP
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
 received packets:            0, sent packets:            0 
 forwarded packets:           0, dropped packets:           0 
Internet Address is 192.168.30.1/24 
Broadcast address : 192.168.30.255
TTL being 1 packet number:         0
TTL invalid packet number:         0
ICMP packet input number:          0
  Echo reply:                      0
  Unreachable:                     0
  Source quench:                   0
  Routing redirect:                0
  Echo request:                    0
  Router advert:                   0
  Router solicit:                  0
  Time exceed:                     0
  IP header bad:                   0
  Timestamp request:            

[LSW1]display IP interface vlanif 101
Vlanif101 current state : UP 
Line protocol current state : UP
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
 received packets:            0, sent packets:            0 
 forwarded packets:           0, dropped packets:           0 
Internet Address is 192.168.101.1/24 
Broadcast address : 192.168.101.255
TTL being 1 packet number:         0
TTL invalid packet number:         0
ICMP packet input number:          0
  Echo reply:                      0
  Unreachable:                     0
  Source quench:                   0
  Routing redirect:                0
  Echo request:                    0
  Router advert:                   0
  Router solicit:                  0
  Time exceed:                     0
  IP header bad:                   0
  Timestamp request:               0
  Timestamp reply:                 0

[LSW1]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

      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
   192.168.10.0/24  Direct  0    0           D   192.168.10.1    Vlanif10
   192.168.10.1/32  Direct  0    0           D   127.0.0.1       Vlanif10
   192.168.30.0/24  Direct  0    0           D   192.168.30.1    Vlanif30
   192.168.30.1/32  Direct  0    0           D   127.0.0.1       Vlanif30
  192.168.101.0/24  Direct  0    0           D   192.168.101.1   Vlanif101
  192.168.101.1/32  Direct  0    0           D   127.0.0.1       Vlanif101

同理,为LSW2配置默认路由 

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW2
[LSW2]vlan batch 
Sep 17 2023 16:55:00-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 4, the 
change loop count is 0, and the maximum number of records is 4095.
                 ^
Error:Incomplete command found at '^' position.
[LSW2]undo info-center enable
Info: Information center is disabled.
[LSW2]vlan batch 80 81 102
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2]interface g0/0/9
[LSW2-GigabitEthernet0/0/9]port link-type access
[LSW2-GigabitEthernet0/0/9]qu
[LSW2]interface g0/0/15
[LSW2-GigabitEthernet0/0/15]port link-type access
[LSW2-GigabitEthernet0/0/15]port default vlan 80
[LSW2-GigabitEthernet0/0/15]qu
[LSW2]interface g0/0/17
[LSW2-GigabitEthernet0/0/17]port link-type access
[LSW2-GigabitEthernet0/0/17]port default vlan 81
[LSW2-GigabitEthernet0/0/17]qu
[LSW2]interface g0/0/24
[LSW2-GigabitEthernet0/0/24]port link-type access
[LSW2-GigabitEthernet0/0/24]port default vlan 102
[LSW2-GigabitEthernet0/0/24]qu
[LSW2]display vlan 
The total number of vlans is : 4
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:GE0/0/1(D)      GE0/0/2(D)      GE0/0/3(D)      GE0/0/4(D)      
                GE0/0/5(D)      GE0/0/6(D)      GE0/0/7(D)      GE0/0/8(D)      
                GE0/0/9(D)      GE0/0/10(D)     GE0/0/11(D)     GE0/0/12(D)     
                GE0/0/13(D)     GE0/0/14(D)     GE0/0/16(D)     GE0/0/18(D)     
                GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     
                GE0/0/23(D)                                                     

80   common  UT:GE0/0/15(U)                                                     

81   common  UT:GE0/0/17(U)                                                     

102  common  UT:GE0/0/24(U)                                                     


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001                         
80   enable  default       enable  disable    VLAN 0080                         
81   enable  default       enable  disable    VLAN 0081                         
102  enable  default       enable  disable    VLAN 0102                         
[LSW2]display port vlan
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1    hybrid       1     -                                   
GigabitEthernet0/0/2    hybrid       1     -                                   
GigabitEthernet0/0/3    hybrid       1     -                                   
GigabitEthernet0/0/4    hybrid       1     -                                   
GigabitEthernet0/0/5    hybrid       1     -                                   
GigabitEthernet0/0/6    hybrid       1     -                                   
GigabitEthernet0/0/7    hybrid       1     -                                   
GigabitEthernet0/0/8    hybrid       1     -                                   
GigabitEthernet0/0/9    access       1     -                                   
GigabitEthernet0/0/10   hybrid       1     -                                   
GigabitEthernet0/0/11   hybrid       1     -                                   
GigabitEthernet0/0/12   hybrid       1     -                                   
GigabitEthernet0/0/13   hybrid       1     -                                   
GigabitEthernet0/0/14   hybrid       1     -                                   
GigabitEthernet0/0/15   access       80    -                                   
GigabitEthernet0/0/16   hybrid       1     -                                   
GigabitEthernet0/0/17   access       81    -                                   
GigabitEthernet0/0/18   hybrid       1     -                                   
GigabitEthernet0/0/19   hybrid       1     -                                   
GigabitEthernet0/0/20   hybrid       1     -                                   
GigabitEthernet0/0/21   hybrid       1     -                                   
GigabitEthernet0/0/22   hybrid       1     -                                   
GigabitEthernet0/0/23   hybrid       1     -                                   
GigabitEthernet0/0/24   access       102   -   
                                
[LSW2]display port vlan
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1    hybrid       1     -                                   
GigabitEthernet0/0/2    hybrid       1     -                                   
GigabitEthernet0/0/3    hybrid       1     -                                   
GigabitEthernet0/0/4    hybrid       1     -                                   
GigabitEthernet0/0/5    hybrid       1     -                                   
GigabitEthernet0/0/6    hybrid       1     -                                   
GigabitEthernet0/0/7    hybrid       1     -                                   
GigabitEthernet0/0/8    hybrid       1     -                                   
GigabitEthernet0/0/9    access       1     -                                   
GigabitEthernet0/0/10   hybrid       1     -                                   
GigabitEthernet0/0/11   hybrid       1     -                                   
GigabitEthernet0/0/12   hybrid       1     -                                   
GigabitEthernet0/0/13   hybrid       1     -                                   
GigabitEthernet0/0/14   hybrid       1     -                                   
GigabitEthernet0/0/15   access       80    -                                   
GigabitEthernet0/0/16   hybrid       1     -                                   
GigabitEthernet0/0/17   access       81    -                                   
GigabitEthernet0/0/18   hybrid       1     -                                   
GigabitEthernet0/0/19   hybrid       1     -                                   
GigabitEthernet0/0/20   hybrid       1     -                                   
GigabitEthernet0/0/21   hybrid       1     -                                   
GigabitEthernet0/0/22   hybrid       1     -                                   
GigabitEthernet0/0/23   hybrid       1     -                                   
GigabitEthernet0/0/24   access       102   -                                   

[LSW2]interface vlanif 80
[LSW2-Vlanif80]ip address 192.168.80.1 24
[LSW2-Vlanif80]qu
[LSW2]interface vlanif 81
[LSW2-Vlanif81]ip address 192.168.81.1 24
[LSW2-Vlanif81]qu
[LSW2]interface vlanif 102
[LSW2-Vlanif102]ip address 192.168.102.1 24
[LSW2-Vlanif102]qu

[LSW2]display interface brief
PHY: Physical
*down: administratively down
(l): loopback
(s): spoofing
(b): BFD down
(e): ETHOAM down
(dl): DLDP down
(d): Dampening Suppressed
InUti/OutUti: input utility/output utility
Interface                   PHY   Protocol InUti OutUti   inErrors  outErrors
GigabitEthernet0/0/1        down  down        0%     0%          0          0
GigabitEthernet0/0/2        down  down        0%     0%          0          0
GigabitEthernet0/0/3        down  down        0%     0%          0          0
GigabitEthernet0/0/4        down  down        0%     0%          0          0
GigabitEthernet0/0/5        down  down        0%     0%          0          0
GigabitEthernet0/0/6        down  down        0%     0%          0          0
GigabitEthernet0/0/7        down  down        0%     0%          0          0
GigabitEthernet0/0/8        down  down        0%     0%          0          0
GigabitEthernet0/0/9        down  down        0%     0%          0          0
GigabitEthernet0/0/10       down  down        0%     0%          0          0
GigabitEthernet0/0/11       down  down        0%     0%          0          0
GigabitEthernet0/0/12       down  down        0%     0%          0          0
GigabitEthernet0/0/13       down  down        0%     0%          0          0
GigabitEthernet0/0/14       down  down        0%     0%          0          0
GigabitEthernet0/0/15       up    up          0%     0%          0          0
GigabitEthernet0/0/16       down  down        0%     0%          0          0
GigabitEthernet0/0/17       up    up          0%     0%          0          0
GigabitEthernet0/0/18       down  down        0%     0%          0          0
GigabitEthernet0/0/19       down  down        0%     0%          0          0
GigabitEthernet0/0/20       down  down        0%     0%          0          0
GigabitEthernet0/0/21       down  down        0%     0%          0          0
GigabitEthernet0/0/22       down  down        0%     0%          0          0
GigabitEthernet0/0/23       down  down        0%     0%          0          0
GigabitEthernet0/0/24       up    up          0%     0%          0          0

[LSW2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
MEth0/0/1                         unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Vlanif1                           unassigned           down       down      
Vlanif80                          192.168.80.1/24      up         up        
Vlanif81                          192.168.81.1/24      up         up        
Vlanif102                         192.168.102.1/24     up         up        

[LSW2]display IP interface vlanif 80
Vlanif80 current state : UP 
Line protocol current state : UP
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
 received packets:            0, sent packets:            0 
 forwarded packets:           0, dropped packets:           0 
Internet Address is 192.168.80.1/24 
Broadcast address : 192.168.80.255
TTL being 1 packet number:         0
TTL invalid packet number:         0
ICMP packet input number:          0
  Echo reply:                      0
  Unreachable:                     0
  Source quench:                   0
  Routing redirect:                0
  Echo request:                    0
  Router advert:                   0
  Router solicit:                  0
  Time exceed:                     0
  IP header bad:                   0
  Timestamp request:            

[LSW2]display IP interface vlanif 81
Vlanif81 current state : UP 
Line protocol current state : UP
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
 received packets:            0, sent packets:            0 
 forwarded packets:           0, dropped packets:           0 
Internet Address is 192.168.81.1/24 
Broadcast address : 192.168.81.255
TTL being 1 packet number:         0
TTL invalid packet number:         0
ICMP packet input number:          0
  Echo reply:                      0
  Unreachable:                     0
  Source quench:                   0
  Routing redirect:                0
  Echo request:                    0
  Router advert:                   0
  Router solicit:                  0
  Time exceed:                     0
  IP header bad:                   0
  Timestamp request:               0
  Timestamp reply:                 0

[LSW2]display IP interface vlanif 102
Vlanif102 current state : UP 
Line protocol current state : UP
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
 received packets:            0, sent packets:            0 
 forwarded packets:           0, dropped packets:           0 
Internet Address is 192.168.102.1/24 
Broadcast address : 192.168.102.255
TTL being 1 packet number:         0
TTL invalid packet number:         0
ICMP packet input number:          0
  Echo reply:                      0
  Unreachable:                     0
  Source quench:                   0
  Routing redirect:                0
  Echo request:                    0
  Router advert:                   0
  Router solicit:                  0
  Time exceed:                     0
  IP header bad:                   0
  Timestamp request:               0
  Timestamp reply:                 0

[LSW2]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

      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
   192.168.80.0/24  Direct  0    0           D   192.168.80.1    Vlanif80
   192.168.80.1/32  Direct  0    0           D   127.0.0.1       Vlanif80
   192.168.81.0/24  Direct  0    0           D   192.168.81.1    Vlanif81
   192.168.81.1/32  Direct  0    0           D   127.0.0.1       Vlanif81
  192.168.102.0/24  Direct  0    0           D   192.168.102.1   Vlanif102
  192.168.102.1/32  Direct  0    0           D   127.0.0.1       Vlanif102

配置路由器RTA端口

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTA
#配置连接交换机LSW1的端口g0/0/1及对应的ip地址
[RTA]interface g0/0/1
[RTA-GigabitEthernet0/0/1]ip address 192.168.101.2 24
[RTA-GigabitEthernet0/0/1]
Sep 17 2023 17:06:09-08:00 RTA %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/1 has entered the UP state. 
[RTA-GigabitEthernet0/0/1]qu
[RTA]interface g0/0/2
[RTA-GigabitEthernet0/0/2]ip address 192.168.102.2 24
Sep 17 2023 17:06:56-08:00 RTA %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
 on the interface GigabitEthernet0/0/2 has entered the UP state. 
[RTA-GigabitEthernet0/0/2]qu
#配置环回接口 IP 地址,模拟校园网上的一台主机。
# 环回接口 Loopback 用于模拟在路由器后的一个IP 网段。Loopback 接口作为一个逻辑接口并不真实存在,并且该接口永远不会 DOWN,正是由于这个特性,使得 Loopback 接口常用于: 网络测试、协议的 RouerID、建立基于Loopback 的邻接关系、作为SNMP traps 消息的源地址等
[RTA]interface loopback 0
[RTA-LoopBack0]ip address 10.1.1.10 23
[RTA-LoopBack0]qu
[RTA]display interface brief
PHY: Physical
*down: administratively down
(l): loopback
(s): spoofing
(b): BFD down
^down: standby
(e): ETHOAM down
(d): Dampening Suppressed
InUti/OutUti: input utility/output utility
Interface                   PHY   Protocol InUti OutUti   inErrors  outErrors
GigabitEthernet0/0/0        down  down        0%     0%          0          0
GigabitEthernet0/0/1        up    up          0%     0%          0          0
GigabitEthernet0/0/2        up    up          0%     0%          0          0
LoopBack0                   up    up(s)       0%     0%          0          0
NULL0                       up    up(s)       0%     0%          0          0
[RTA]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           down       down      
GigabitEthernet0/0/1              192.168.101.2/24     up         up        
GigabitEthernet0/0/2              192.168.102.2/24     up         up        
LoopBack0                         10.1.1.10/23         up         up(s)     
NULL0                             unassigned           up         up(s)     


[RTA]display IP interface g0/0/1
GigabitEthernet0/0/1 current state : UP 
Line protocol current state : UP
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
 received packets:            0, sent packets:            0 
 forwarded packets:           0, dropped packets:           0 
ARP packet input number:           0
  Request packet:                  0
  Reply packet:                    0
  Unknown packet:                  0
Internet Address is 192.168.101.2/24 
Broadcast address : 192.168.101.255
TTL being 1 packet number:         0
TTL invalid packet number:         0
ICMP packet input number:          0
  Echo reply:                      0
  Unreachable:                     0
  Source quench:                   0
  Routing redirect:                0
  Echo request:                    0
  Router advert:                

[RTA]display IP interface g0/0/2
GigabitEthernet0/0/2 current state : UP 
Line protocol current state : UP
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
 received packets:            0, sent packets:            0 
 forwarded packets:           0, dropped packets:           0 
ARP packet input number:           0
  Request packet:                  0
  Reply packet:                    0
  Unknown packet:                  0
Internet Address is 192.168.102.2/24 
Broadcast address : 192.168.102.255
TTL being 1 packet number:         0
TTL invalid packet number:         0
ICMP packet input number:          0
  Echo reply:                      0
  Unreachable:                     0
  Source quench:                   0
  Routing redirect:                0
  Echo request:                    0
  Router advert:                   0
  Router solicit:                  0

[RTA]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 13       Routes : 13       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       10.1.0.0/23  Direct  0    0           D   10.1.1.10       LoopBack0
      10.1.1.10/32  Direct  0    0           D   127.0.0.1       LoopBack0
     10.1.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
      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
  192.168.101.0/24  Direct  0    0           D   192.168.101.2   GigabitEthernet
0/0/1
  192.168.101.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
192.168.101.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
  192.168.102.0/24  Direct  0    0           D   192.168.102.2   GigabitEthernet
0/0/2
  192.168.102.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
192.168.102.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

 在PC-10-1 ping其他主机

PC>ping 192.168.30.11

Ping 192.168.30.11: 32 data bytes, Press Ctrl_C to break
From 192.168.30.11: bytes=32 seq=1 ttl=127 time=62 ms
From 192.168.30.11: bytes=32 seq=2 ttl=127 time=31 ms
From 192.168.30.11: bytes=32 seq=3 ttl=127 time=32 ms
From 192.168.30.11: bytes=32 seq=4 ttl=127 time=31 ms
From 192.168.30.11: bytes=32 seq=5 ttl=127 time=47 ms

--- 192.168.30.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/40/62 ms

PC>ping 192.168.80.11

Ping 192.168.80.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 192.168.80.11 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>ping 192.168.81.11

Ping 192.168.81.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 192.168.81.11 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>ping 10.1.1.10

Ping 10.1.1.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 10.1.1.10 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

 在PC-30-1上ping其他主机

PC>ping 192.168.10.11

Ping 192.168.10.11: 32 data bytes, Press Ctrl_C to break
From 192.168.10.11: bytes=32 seq=1 ttl=127 time=31 ms
From 192.168.10.11: bytes=32 seq=2 ttl=127 time=47 ms
From 192.168.10.11: bytes=32 seq=3 ttl=127 time=47 ms
From 192.168.10.11: bytes=32 seq=4 ttl=127 time=31 ms
From 192.168.10.11: bytes=32 seq=5 ttl=127 time=31 ms

--- 192.168.10.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/37/47 ms

PC>ping 192.168.80.11

Ping 192.168.80.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 192.168.80.11 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>ping 192.168.81.11

Ping 192.168.81.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 192.168.81.11 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>ping 10.1.1.10

Ping 10.1.1.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 10.1.1.10 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

在PC-80-1上ping其他主机

PC>ping 192.168.81.11

Ping 192.168.81.11: 32 data bytes, Press Ctrl_C to break
From 192.168.81.11: bytes=32 seq=1 ttl=127 time=62 ms
From 192.168.81.11: bytes=32 seq=2 ttl=127 time=47 ms
From 192.168.81.11: bytes=32 seq=3 ttl=127 time=47 ms
From 192.168.81.11: bytes=32 seq=4 ttl=127 time=47 ms
From 192.168.81.11: bytes=32 seq=5 ttl=127 time=31 ms

--- 192.168.81.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/46/62 ms

PC>ping 192.168.10.11

Ping 192.168.10.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 192.168.10.11 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>ping 192.168.30.11

Ping 192.168.30.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 192.168.30.11 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss


PC>ping 10.1.1.10

Ping 10.1.1.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 10.1.1.10 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

 在PC-81-1上ping其他主机

PC>ping 192.168.80.11

Ping 192.168.80.11: 32 data bytes, Press Ctrl_C to break
From 192.168.80.11: bytes=32 seq=1 ttl=127 time=47 ms
From 192.168.80.11: bytes=32 seq=2 ttl=127 time=47 ms
From 192.168.80.11: bytes=32 seq=3 ttl=127 time=31 ms
From 192.168.80.11: bytes=32 seq=4 ttl=127 time=31 ms
From 192.168.80.11: bytes=32 seq=5 ttl=127 time=47 ms

--- 192.168.80.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/40/47 ms

PC>ping 192.168.10.11

Ping 192.168.10.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 192.168.10.11 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>ping 192.168.30.11

Ping 192.168.30.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 192.168.30.11 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>ping 10.1.1.10

Ping 10.1.1.10: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!

--- 10.1.1.10 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

至此,我们可以看到不同交换机还不能实现vlan的相互通信

现在在交换机和路由器上都配置默认路由

<LSW1>sys
Enter system view, return user view with Ctrl+Z.
# 配置默认路由,简化路由配置
# 默认路由的目的网络为0.0.0.0,子网掩码为0.0.0.0,下一跳地址为 192.168.102.2。
#也可以配置到每个网络的静态路由
[LSW1]ip route-static 0.0.0.0 0.0.0.0 192.168.101.2
[LSW1]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 9        Routes : 9        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   192.168.101.2   Vlanif101
      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
   192.168.10.0/24  Direct  0    0           D   192.168.10.1    Vlanif10
   192.168.10.1/32  Direct  0    0           D   127.0.0.1       Vlanif10
   192.168.30.0/24  Direct  0    0           D   192.168.30.1    Vlanif30
   192.168.30.1/32  Direct  0    0           D   127.0.0.1       Vlanif30
  192.168.101.0/24  Direct  0    0           D   192.168.101.1   Vlanif101
  192.168.101.1/32  Direct  0    0           D   127.0.0.1       Vlanif101

在LSW2上配置默认路由

<LSW2>sys
Enter system view, return user view with Ctrl+Z.
[LSW2]ip route-static 0.0.0.0 0.0.0.0 192.168.102.2
[LSW2]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 9        Routes : 9        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   192.168.102.2   Vlanif102
      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
   192.168.80.0/24  Direct  0    0           D   192.168.80.1    Vlanif80
   192.168.80.1/32  Direct  0    0           D   127.0.0.1       Vlanif80
   192.168.81.0/24  Direct  0    0           D   192.168.81.1    Vlanif81
   192.168.81.1/32  Direct  0    0           D   127.0.0.1       Vlanif81
  192.168.102.0/24  Direct  0    0           D   192.168.102.1   Vlanif102
  192.168.102.1/32  Direct  0    0           D   127.0.0.1       Vlanif102

 在路由器RTA上配置静态和默认路由

<RTA>sys
Enter system view, return user view with Ctrl+Z.
[RTA]ip route-static 192.168.10.0 24 192.168.101.1
[RTA]ip route-static 192.168.30.0 24 192.168.101.1
[RTA]ip route-static 0.0.0.0 0.0.0.0 192.168.102.1
#也可以配置静态路由
#[RTA]ip route-static 192.168.80.0 24 192.168.102.1
#[RTA]ip route-static 192.168.81.0 24 192.168.102.1

[RTA]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 16       Routes : 16       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   192.168.102.1   GigabitEthernet
0/0/2
       10.1.0.0/23  Direct  0    0           D   10.1.1.10       LoopBack0
      10.1.1.10/32  Direct  0    0           D   127.0.0.1       LoopBack0
     10.1.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0
      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
   192.168.10.0/24  Static  60   0          RD   192.168.101.1   GigabitEthernet
0/0/1
   192.168.30.0/24  Static  60   0          RD   192.168.101.1   GigabitEthernet
0/0/1
  192.168.101.0/24  Direct  0    0           D   192.168.101.2   GigabitEthernet
0/0/1
  192.168.101.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
192.168.101.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
  192.168.102.0/24  Direct  0    0           D   192.168.102.2   GigabitEthernet
0/0/2
  192.168.102.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
192.168.102.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/2
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

 现在PC-10-1可以ping通其他主机

PC>ping 192.168.80.11

Ping 192.168.80.11: 32 data bytes, Press Ctrl_C to break
From 192.168.80.11: bytes=32 seq=1 ttl=125 time=78 ms
From 192.168.80.11: bytes=32 seq=2 ttl=125 time=94 ms
From 192.168.80.11: bytes=32 seq=3 ttl=125 time=62 ms
From 192.168.80.11: bytes=32 seq=4 ttl=125 time=47 ms
From 192.168.80.11: bytes=32 seq=5 ttl=125 time=78 ms

--- 192.168.80.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/71/94 ms

PC>ping 192.168.81.11

Ping 192.168.81.11: 32 data bytes, Press Ctrl_C to break
From 192.168.81.11: bytes=32 seq=1 ttl=125 time=78 ms
From 192.168.81.11: bytes=32 seq=2 ttl=125 time=94 ms
From 192.168.81.11: bytes=32 seq=3 ttl=125 time=78 ms
From 192.168.81.11: bytes=32 seq=4 ttl=125 time=78 ms
From 192.168.81.11: bytes=32 seq=5 ttl=125 time=93 ms

--- 192.168.81.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 78/84/94 ms

PC>ping 10.1.1.10

Ping 10.1.1.10: 32 data bytes, Press Ctrl_C to break
From 10.1.1.10: bytes=32 seq=1 ttl=254 time=78 ms
From 10.1.1.10: bytes=32 seq=2 ttl=254 time=47 ms
From 10.1.1.10: bytes=32 seq=3 ttl=254 time=31 ms
From 10.1.1.10: bytes=32 seq=4 ttl=254 time=31 ms
From 10.1.1.10: bytes=32 seq=5 ttl=254 time=47 ms

--- 10.1.1.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/46/78 ms

 PC-80-1也可以ping通其他主机

PC>ping 192.168.10.11

Ping 192.168.10.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.10.11: bytes=32 seq=2 ttl=125 time=47 ms
From 192.168.10.11: bytes=32 seq=3 ttl=125 time=63 ms
From 192.168.10.11: bytes=32 seq=4 ttl=125 time=78 ms
From 192.168.10.11: bytes=32 seq=5 ttl=125 time=78 ms

--- 192.168.10.11 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/66/78 ms

PC>ping 192.168.30.11

Ping 192.168.30.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.30.11: bytes=32 seq=2 ttl=125 time=94 ms
From 192.168.30.11: bytes=32 seq=3 ttl=125 time=63 ms
From 192.168.30.11: bytes=32 seq=4 ttl=125 time=93 ms
From 192.168.30.11: bytes=32 seq=5 ttl=125 time=94 ms

--- 192.168.30.11 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/86/94 ms

PC>ping 10.1.1.10

Ping 10.1.1.10: 32 data bytes, Press Ctrl_C to break
From 10.1.1.10: bytes=32 seq=1 ttl=254 time=47 ms
From 10.1.1.10: bytes=32 seq=2 ttl=254 time=31 ms
From 10.1.1.10: bytes=32 seq=3 ttl=254 time=47 ms
From 10.1.1.10: bytes=32 seq=4 ttl=254 time=31 ms
From 10.1.1.10: bytes=32 seq=5 ttl=254 time=47 ms

--- 10.1.1.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/40/47 ms

 PC-30-1也可以ping通其他主机


PC>ping 192.168.10.11

Ping 192.168.10.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.10.11: bytes=32 seq=2 ttl=127 time=32 ms
From 192.168.10.11: bytes=32 seq=3 ttl=127 time=47 ms
From 192.168.10.11: bytes=32 seq=4 ttl=127 time=46 ms
From 192.168.10.11: bytes=32 seq=5 ttl=127 time=47 ms

--- 192.168.10.11 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/43/47 ms

PC>ping 192.168.80.11

Ping 192.168.80.11: 32 data bytes, Press Ctrl_C to break
From 192.168.80.11: bytes=32 seq=1 ttl=125 time=47 ms
From 192.168.80.11: bytes=32 seq=2 ttl=125 time=63 ms
From 192.168.80.11: bytes=32 seq=3 ttl=125 time=78 ms
From 192.168.80.11: bytes=32 seq=4 ttl=125 time=62 ms
From 192.168.80.11: bytes=32 seq=5 ttl=125 time=94 ms

--- 192.168.80.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/68/94 ms

PC>ping 192.168.81.11

Ping 192.168.81.11: 32 data bytes, Press Ctrl_C to break
From 192.168.81.11: bytes=32 seq=1 ttl=125 time=110 ms
From 192.168.81.11: bytes=32 seq=2 ttl=125 time=78 ms
From 192.168.81.11: bytes=32 seq=3 ttl=125 time=62 ms
From 192.168.81.11: bytes=32 seq=4 ttl=125 time=79 ms
From 192.168.81.11: bytes=32 seq=5 ttl=125 time=78 ms

--- 192.168.81.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 62/81/110 ms

 PC-81-1能ping通其他主机

PC>ping 192.168.10.11

Ping 192.168.10.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.10.11: bytes=32 seq=2 ttl=125 time=47 ms
From 192.168.10.11: bytes=32 seq=3 ttl=125 time=94 ms
From 192.168.10.11: bytes=32 seq=4 ttl=125 time=62 ms
From 192.168.10.11: bytes=32 seq=5 ttl=125 time=78 ms

--- 192.168.10.11 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/70/94 ms

PC>ping 192.168.30.11

Ping 192.168.30.11: 32 data bytes, Press Ctrl_C to break
From 192.168.30.11: bytes=32 seq=1 ttl=125 time=94 ms
From 192.168.30.11: bytes=32 seq=2 ttl=125 time=62 ms
From 192.168.30.11: bytes=32 seq=3 ttl=125 time=63 ms
From 192.168.30.11: bytes=32 seq=4 ttl=125 time=78 ms
From 192.168.30.11: bytes=32 seq=5 ttl=125 time=63 ms

--- 192.168.30.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 62/72/94 ms

PC>ping 192.168.80.11

Ping 192.168.80.11: 32 data bytes, Press Ctrl_C to break
From 192.168.80.11: bytes=32 seq=1 ttl=127 time=31 ms
From 192.168.80.11: bytes=32 seq=2 ttl=127 time=47 ms
From 192.168.80.11: bytes=32 seq=3 ttl=127 time=31 ms
From 192.168.80.11: bytes=32 seq=4 ttl=127 time=47 ms
From 192.168.80.11: bytes=32 seq=5 ttl=127 time=47 ms

--- 192.168.80.11 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/40/47 ms

PC>ping 10.1.1.10

Ping 10.1.1.10: 32 data bytes, Press Ctrl_C to break
From 10.1.1.10: bytes=32 seq=1 ttl=254 time=31 ms
From 10.1.1.10: bytes=32 seq=2 ttl=254 time=31 ms
From 10.1.1.10: bytes=32 seq=3 ttl=254 time=47 ms
From 10.1.1.10: bytes=32 seq=4 ttl=254 time=47 ms
From 10.1.1.10: bytes=32 seq=5 ttl=254 time=31 ms

--- 10.1.1.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 31/37/47 ms

 以下是案例的拓扑图链接:

链接:https://pan.baidu.com/s/1CXDetuC34Hi_E88TUgVx4g 
提取码:o3b5

不过还是建议自己多写 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1047160.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

UOS QTextEdit设置换行和滚动条(bug自动换行时右侧个别字符被遮盖)

一、环境 UOS_x86 / QT5 / C 二、qtextEdit 换行设置 下图在ui界面lineWrapMode这个参数可以设置换行相关&#xff1a;NoWrap是不换行、WidgetWidth是自动换行&#xff08;按textEdit的宽度换行&#xff09;、下面两个是可以自定义每行的宽度&#xff0c;如果选了这两个&…

Java8实战-总结37

Java8实战-总结37 默认方法不断演进的 API初始版本的 API第二版 API 默认方法 传统上&#xff0c;Java程序的接口是将相关方法按照约定组合到一起的方式。实现接口的类必须为接口中定义的每个方法提供一个实现&#xff0c;或者从父类中继承它的实现。但是&#xff0c;一旦类库…

【OSCAR开源产业大会分论坛】开源大模型走向何方?

再过俩月&#xff0c;ChatGPT 即将迎来推出一周年纪念日。作为开历史先河的 AI 大模型&#xff0c;ChatGPT 像一针猛戳进千行百业中枢神经的兴奋剂&#xff0c;在全球掀起空前绝后的 AI 军备竞赛热潮。 近一年来&#xff0c;我们看到 GPT-3.5 完成向多模态的 GPT-4 进化&#x…

为什么我的remix没有injected web3

原因 Remix近期做了升级&#xff0c;去除了Web3的选项&#xff0c;您在进行部署的时候&#xff0c;可以选择injected provider metamask&#xff0c;同样能连接到Web3钱包哦。具体如下图所示&#xff1a;

基于微信小程序的公交信息在线查询系统小程序设计与实现(源码+lw+部署文档+讲解等)

文章目录 前言系统主要功能&#xff1a;具体实现截图论文参考详细视频演示为什么选择我自己的网站自己的小程序&#xff08;小蔡coding&#xff09;有保障的售后福利 代码参考源码获取 前言 &#x1f497;博主介绍&#xff1a;✌全网粉丝10W,CSDN特邀作者、博客专家、CSDN新星计…

zemax西德莫尔目镜

高性能的军用光学仪器 在两个双胶合透镜之间&#xff0c;增加了一块平凸透镜 半视场角增大到35度 入瞳直径4mm波长0.51、0.56、0.61半视场35焦距27.9mm 镜头参数&#xff1a; 成像效果&#xff1a;

codesys【网桥】

作用&#xff1a;在串联的路由器上&#xff0c;实现PC2访问PC1 实现无线编程 和PLC【web】 1硬件连接&#xff1a; 2软件设置&#xff1a; 1网卡设置自动ip 2厂家软件连接到模块 串口服务器参数设置&#xff1a; (1)设置串口服务器软件版本为Z-Ver ATFVERz (2)使能以太网接口…

【AI视野·今日Robot 机器人论文速览 第四十期】Mon, 25 Sep 2023

AI视野今日CS.Robotics 机器人学论文速览 Mon, 25 Sep 2023 Totally 36 papers &#x1f449;上期速览✈更多精彩请移步主页 Interesting: &#x1f4da;CloudGripper, 一套云化的机器抓取人数据采集系统&#xff0c;包含了32个机械臂的集群。(from KTH Royal Institute of Te…

【Vue简介+搭建Vue开发环境+Hello小案例】

Vue简介搭建Vue开发环境Hello小案例 1 Vue简介2 搭建Vue开发环境3 Hello小案例 1 Vue简介 Vue是一套用于构建用户界面的渐进式JavaScript框架。&#xff08;渐进式&#xff1a;Vue可以自底向上逐层的应用<简单应用&#xff1a;只需要一个轻量小巧的核心库><复杂应用&…

2023年海南省职业院校技能大赛(高职组)信息安全管理与评估赛项规程

2023年海南省职业院校技能大赛&#xff08;高职组&#xff09; 信息安全管理与评估赛项规程 一、赛项名称 赛项名称&#xff1a;信息安全管理与评估 英文名称&#xff1a;Information Security Management and Evaluation 赛项组别&#xff1a;高等职业教育 赛项归属产业&…

解决java.io.FileNotFoundException: HADOOP_HOME and hadoop.home.dir are unset.的错误

文章目录 1. 复现错误2. 分析错误3. 解决问题3.1 下载Hadoop3.2 配置Hadoop3.3 下载winutils3.4 配置winutils 1. 复现错误 今天在运行同事给我的项目&#xff0c;但在项目启动时&#xff0c;报出如下错误&#xff1a; java.io.FileNotFoundException: java.io.FileNotFoundEx…

15.TIM输入捕获

目录 一、输入捕获 1.1 输入捕获简介 1.2输入捕获的各部分电路 ​编辑 1.3 输入捕获的主模式、从模式、触发源选择&#xff08;简称&#xff1a;主从触发模式&#xff09; ​编辑​编辑 ​编辑1.4 输入捕获和PWMI基本结构 二、频率的测量方法 2.1 测频法 2.2 …

新移科技发布基于联发科MT8390(Genio 700)平台的物联网 AI 核心板

新移科技研发的XY8390物联网 AI 核心板是一款高度集成、功能强大的平台&#xff0c;该核心板专为各种人工智能 (AI) 和物联网 (IoT) 用例而设计。 处理器采用了 Arm DynamIQ™ 技术&#xff0c;结合了高性能 Cortex-A78 内核和高能效 Cortex-A55 内核&#xff0c;并配备了 Arm …

【每日一题】528. 按权重随机选择

528. 按权重随机选择 - 力扣&#xff08;LeetCode&#xff09; 给你一个 下标从 0 开始 的正整数数组 w &#xff0c;其中 w[i] 代表第 i 个下标的权重。 请你实现一个函数 pickIndex &#xff0c;它可以 随机地 从范围 [0, w.length - 1] 内&#xff08;含 0 和 w.length - 1&…

康耐视visionpro脚本CogRectangleAffine ,CogPolygon图形限定框,边界显示(划痕缺陷案例分享)

目录 1.划痕缺陷整体方案设计:2.测试一效果图:3.测试一脚本编写​:4.测试二效果图:5.测试二脚本编写:6.测试三效果图:7.​测试三脚本编写:测试版本:康耐视visionpro9.0 1.划痕缺陷整体方案设计: 2.测试一效果图: 3.测试一脚本编写​: CogRectangleAffine Rectangle…

Kakfa高效读写数据

1.概述 无论 kafka 作为 MQ 也好&#xff0c;作为存储层也罢&#xff0c;无非就是两个功能&#xff1a;一是 Producer 生产的数据存到 broker&#xff0c;二是 Consumer 从 broker 读取数据。那 Kafka 的快也就体现在读写两个方面了&#xff0c;本文也是从这两个方面去剖析Kafk…

【lesson12】理解进程地址空间

文章目录 什么是进程地址空间&#xff1f;进程地址空间的作用扩展内容初步理解深入理解 什么是进程地址空间&#xff1f; 故事&#xff1a; 背景&#xff1a;有一个大富豪&#xff0c;家里的存款有10亿美元&#xff0c;他有三个私生子三个人之间彼此互不相识&#xff0c;只有富…

外贸人员如何选择适合的邮箱服务

随着互联网和数字技术的快速发展&#xff0c;电子邮件已经成为商务沟通的主要方式之一。对于外贸人员来说&#xff0c;选择一个合适且高效的邮箱服务至关重要。本文将探讨外贸人员在选择外贸邮箱时应考虑的因素&#xff0c;以便找到最适合自己的解决方案。 “外贸人员如何选择合…

DE0开发板交通灯十字路口红绿灯VHDL

名称&#xff1a;基于DE0开发板的交通灯十字路口红绿灯 软件&#xff1a;Quartus 语言&#xff1a;VHDL 要求&#xff1a; 设计一个十字路口交通信号灯的控制电路。分为两种情况&#xff0c;正常状态和报警状态。 1.正常状态&#xff1a;要求红、绿灯按一定的规律亮和灭&a…

嵌入式Linux应用开发-基础知识-第三章 LED原理图-GPIO及操作

嵌入式Linux应用开发-基础知识-第三章 LED原理图-GPIO及操作 第三章 硬件知识_LED 原理图3.1 先来讲讲怎么看原理图 第四章 普适的 GPIO 引脚操作方法4.1 GPIO 模块一般结构4.2 GPIO 寄存器操作4.3 GPIO 的其他功能&#xff1a;防抖动、中断、唤醒 第五章 具体单板的 GPIO 操作…