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

目录

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

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

案例


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

配置静态路由:

[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 2Interface                         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:          0Echo reply:                      0Unreachable:                     0Source quench:                   0Routing redirect:                0Echo request:                    0Router advert:                   0Router solicit:                  0Time exceed:                     0IP header bad:                   0Timestamp 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:          0Echo reply:                      0Unreachable:                     0Source quench:                   0Routing redirect:                0Echo request:                    0Router advert:                   0Router solicit:                  0Time exceed:                     0IP header bad:                   0Timestamp 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:          0Echo reply:                      0Unreachable:                     0Source quench:                   0Routing redirect:                0Echo request:                    0Router advert:                   0Router solicit:                  0Time exceed:                     0IP header bad:                   0Timestamp request:               0Timestamp reply:                 0[LSW1]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 8        Routes : 8        Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0192.168.10.0/24  Direct  0    0           D   192.168.10.1    Vlanif10192.168.10.1/32  Direct  0    0           D   127.0.0.1       Vlanif10192.168.30.0/24  Direct  0    0           D   192.168.30.1    Vlanif30192.168.30.1/32  Direct  0    0           D   127.0.0.1       Vlanif30192.168.101.0/24  Direct  0    0           D   192.168.101.1   Vlanif101192.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 2Interface                         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:          0Echo reply:                      0Unreachable:                     0Source quench:                   0Routing redirect:                0Echo request:                    0Router advert:                   0Router solicit:                  0Time exceed:                     0IP header bad:                   0Timestamp 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:          0Echo reply:                      0Unreachable:                     0Source quench:                   0Routing redirect:                0Echo request:                    0Router advert:                   0Router solicit:                  0Time exceed:                     0IP header bad:                   0Timestamp request:               0Timestamp 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:          0Echo reply:                      0Unreachable:                     0Source quench:                   0Routing redirect:                0Echo request:                    0Router advert:                   0Router solicit:                  0Time exceed:                     0IP header bad:                   0Timestamp request:               0Timestamp reply:                 0[LSW2]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 8        Routes : 8        Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0192.168.80.0/24  Direct  0    0           D   192.168.80.1    Vlanif80192.168.80.1/32  Direct  0    0           D   127.0.0.1       Vlanif80192.168.81.0/24  Direct  0    0           D   192.168.81.1    Vlanif81192.168.81.1/32  Direct  0    0           D   127.0.0.1       Vlanif81192.168.102.0/24  Direct  0    0           D   192.168.102.1   Vlanif102192.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 IPon 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 IPon 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 1Interface                         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:           0Request packet:                  0Reply packet:                    0Unknown 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:          0Echo reply:                      0Unreachable:                     0Source quench:                   0Routing redirect:                0Echo request:                    0Router 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:           0Request packet:                  0Reply packet:                    0Unknown 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:          0Echo reply:                      0Unreachable:                     0Source quench:                   0Routing redirect:                0Echo request:                    0Router advert:                   0Router solicit:                  0[RTA]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 13       Routes : 13       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface10.1.0.0/23  Direct  0    0           D   10.1.1.10       LoopBack010.1.1.10/32  Direct  0    0           D   127.0.0.1       LoopBack010.1.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.101.0/24  Direct  0    0           D   192.168.101.2   GigabitEthernet
0/0/1192.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/1192.168.102.0/24  Direct  0    0           D   192.168.102.2   GigabitEthernet
0/0/2192.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.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/40/62 msPC>ping 192.168.80.11Ping 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) transmitted0 packet(s) received100.00% packet lossPC>ping 192.168.81.11Ping 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) transmitted0 packet(s) received100.00% packet lossPC>ping 10.1.1.10Ping 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) transmitted0 packet(s) received100.00% packet loss

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

PC>ping 192.168.10.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/37/47 msPC>ping 192.168.80.11Ping 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) transmitted0 packet(s) received100.00% packet lossPC>ping 192.168.81.11Ping 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) transmitted0 packet(s) received100.00% packet lossPC>ping 10.1.1.10Ping 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) transmitted0 packet(s) received100.00% packet loss

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

PC>ping 192.168.81.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/46/62 msPC>ping 192.168.10.11Ping 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) transmitted0 packet(s) received100.00% packet lossPC>ping 192.168.30.11Ping 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) transmitted0 packet(s) received100.00% packet lossPC>ping 10.1.1.10Ping 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) transmitted0 packet(s) received100.00% packet loss

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

PC>ping 192.168.80.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/40/47 msPC>ping 192.168.10.11Ping 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) transmitted0 packet(s) received100.00% packet lossPC>ping 192.168.30.11Ping 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) transmitted0 packet(s) received100.00% packet lossPC>ping 10.1.1.10Ping 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) transmitted0 packet(s) received100.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: PublicDestinations : 9        Routes : 9        Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   192.168.101.2   Vlanif101127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0192.168.10.0/24  Direct  0    0           D   192.168.10.1    Vlanif10192.168.10.1/32  Direct  0    0           D   127.0.0.1       Vlanif10192.168.30.0/24  Direct  0    0           D   192.168.30.1    Vlanif30192.168.30.1/32  Direct  0    0           D   127.0.0.1       Vlanif30192.168.101.0/24  Direct  0    0           D   192.168.101.1   Vlanif101192.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: PublicDestinations : 9        Routes : 9        Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   192.168.102.2   Vlanif102127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0192.168.80.0/24  Direct  0    0           D   192.168.80.1    Vlanif80192.168.80.1/32  Direct  0    0           D   127.0.0.1       Vlanif80192.168.81.0/24  Direct  0    0           D   192.168.81.1    Vlanif81192.168.81.1/32  Direct  0    0           D   127.0.0.1       Vlanif81192.168.102.0/24  Direct  0    0           D   192.168.102.1   Vlanif102192.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: PublicDestinations : 16       Routes : 16       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   192.168.102.1   GigabitEthernet
0/0/210.1.0.0/23  Direct  0    0           D   10.1.1.10       LoopBack010.1.1.10/32  Direct  0    0           D   127.0.0.1       LoopBack010.1.1.255/32  Direct  0    0           D   127.0.0.1       LoopBack0127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0127.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       InLoopBack0192.168.10.0/24  Static  60   0          RD   192.168.101.1   GigabitEthernet
0/0/1192.168.30.0/24  Static  60   0          RD   192.168.101.1   GigabitEthernet
0/0/1192.168.101.0/24  Direct  0    0           D   192.168.101.2   GigabitEthernet
0/0/1192.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/1192.168.102.0/24  Direct  0    0           D   192.168.102.2   GigabitEthernet
0/0/2192.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.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 47/71/94 msPC>ping 192.168.81.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 78/84/94 msPC>ping 10.1.1.10Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/46/78 ms

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

PC>ping 192.168.10.11Ping 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) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/66/78 msPC>ping 192.168.30.11Ping 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) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/86/94 msPC>ping 10.1.1.10Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/40/47 ms

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


PC>ping 192.168.10.11Ping 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) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/43/47 msPC>ping 192.168.80.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 47/68/94 msPC>ping 192.168.81.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 62/81/110 ms

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

PC>ping 192.168.10.11Ping 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) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/70/94 msPC>ping 192.168.30.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 62/72/94 msPC>ping 192.168.80.11Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/40/47 msPC>ping 10.1.1.10Ping 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) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/37/47 ms

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

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

不过还是建议自己多写 

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

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

相关文章

一站式吃鸡利器,提升游戏战斗力,助您稳坐鸡王宝座!

各位吃鸡玩家们&#xff0c;听说过绝地求生作图工具吗&#xff1f;想知道如何提高游戏战斗力、分享顶级作战干货、查询装备皮肤库存&#xff1f;还在为游戏账号安全而担心吗&#xff1f;别急&#xff0c;今天就为您介绍一款一站式吃鸡利器&#xff0c;满足您的所有需求&#xf…

如何快速搭建一个react项目?如何使用react脚手架快速搭建项目?

如何使用react脚手架快速搭建项目&#xff1f; 一、前提 电脑已经安装了node和npm环境。 react文档中要求Node > 8.10 和 npm > 5.6&#xff0c;查看版本&#xff1a;node -v&#xff1b;npm -v&#xff1b; 二、步骤 1、在合适的文件夹中打开命令行窗口cmd 2、全局安…

SkyWalking搭配springboot应用(三)

title: “SkyWalking搭配springboot应用(三)” createTime: 2021-07-13T16:27:5708:00 updateTime: 2021-07-13T16:27:5708:00 slug: “SkyWalking搭配springboot应用(三)” draft: false author: “ggball” tags: [“skywalking”] categories: [“java”] description: “sk…

[论文笔记]Prefix Tuning

引言 今天带来微调LLM的第二篇论文笔记Prefix-Tuning。 作者提出了用于自然语言生成任务的prefix-tuning(前缀微调)的方法,固定语言模型的参数而优化一些连续的任务相关的向量,称为prefix。受到了语言模型提示词的启发,允许后续的token序列注意到这些prefix,当成虚拟toke…

美篇作文网教学资源源码-自带作文数据

非常漂亮的UI设计和页面排版&#xff01; 自适应手机pc端 页面内容均支持自定义 可以用来做网站矩阵&#xff0c;或者增强你其他网站板块&#xff0c;或者单独运营都可以。 可以通过广告方式变现&#xff0c;或者引流等等 友好的seo&#xff0c;更容易被浏览器收录 关注青狐…

Android导航抽屉

本文所有代码均位于https://github.com/MADMAX110/CatChat 之前使用过标签页布局可以让用户在应用中轻松地导航。 当只有为数不多地几个类别屏幕&#xff0c;而且它们都在应用层次结构地同一级上&#xff0c;标签页布局就很适用。 而抽屉导航可以实现更多选择&#xff0c;这是一…

MySQL基础-多表查询

目录 简单概述 1.多表之间的关系 1.1 一对多/多对一 1.2 多对多 1.3 一对一 2. 多表查询-内连接 2.1 隐式内连接 2.2 显式内连接 2.3 内连接小结 3.多表查询-外连接 3.1 左外连接 3.2 右外连接 4.多表查询-自连接 4.1 应用 5.多表查询-联合查询 6.子查询 6.1 标量子…

leetcode 10. 正则表达式匹配

2023.9.20 感觉是目前做过dp题里最难的一题了... 本题首要的就是需要理解题意&#xff0c;翻了评论区我才发现之前一直理解的题意是错的。 我原来理解的 “ *匹配0次” 是指&#xff1a;*直接消失&#xff0c;不会影响到前面的字符。 但是*和前一个字符其实是连体的&#xff0…

现代 GPU 容易受到新 GPU.zip 侧通道攻击

来自四所美国大学的研究人员开发了一种新的 GPU 侧通道攻击&#xff0c;该攻击利用数据压缩在访问网页时泄露现代显卡中的敏感视觉数据。 研究人员通过 Chrome 浏览器执行跨源 SVG 过滤器像素窃取攻击&#xff0c;证明了这种“ GPU.zip ”攻击的有效性。 研究人员于 2023 年 …

mysql面试题2:说一说MySQL的架构设计?一条 MySQL 语句执行的步骤?

该文章专注于面试,面试只要回答关键点即可,不需要对框架有非常深入的回答,如果你想应付面试,是足够了,抓住关键点 面试官:说一说MySQL的架构设计? MySQL的架构设计主要包括以下几个组件: 连接器(Connector):负责与客户端建立连接,并进行身份验证和授权。 查询缓存…

黑马JVM总结(二十五)

&#xff08;1&#xff09;字节码指令-cinit 构造方法可以分为两类&#xff0c;一类是cinit 一类init cinit是整个类的构造方法 putstatic&#xff1a;进行static变量的赋值&#xff0c;是到常量池里找到名字一个叫做i的变量 &#xff08;2&#xff09;字节码指令-init in…

自适应阈值分割-OTSU

OTSU 在前面固定阈值中选取了一个阈值为127进行阈值分割&#xff0c;那如何知道选的这个阈值效果好不好呢&#xff1f;答案是&#xff1a;不断尝试&#xff0c;所以这种方法在很多文献中都被称为经验阈值。 Otsu阈值法就提供了一种自动高效的二值化方法。Otsu算法也称最大类间…

python+vue电子资源管理系统

能实现不出家门就可以通过网络进行系统管理&#xff0c;交易等&#xff0c;而且过程简单、快捷。同样的&#xff0c;在人们的工作生活中&#xff0c;也就需要互联网技术来方便人们的日常工作生活&#xff0c;实现工作办公的自动化处理&#xff0c;实现信息化&#xff0c;无纸化…

社区团购新零售搭伙拼团小程序源码(前后端)

社区团购新零售搭伙拼团小程序源码是一款非常实用的电商小程序&#xff0c;它包含了前后端文件&#xff0c; 可以快速地进行部署和使用。该小程序是基于微信小程序开发的&#xff0c;支持社区团购、新零售、搭伙拼团等多种功能。 该小程序具有良好的用户体验&#xff0c;包括…

数据湖在爱奇艺数据中台的应用

01 我们眼中的数据湖 作为爱奇艺的数据中台团队&#xff0c;我们的核心任务是管理和服务公司内的大量数据资产。在实施数据治理的过程中&#xff0c;我们不断吸收新的理念&#xff0c;引入尖端的工具&#xff0c;以精细化我们的数据体系管理。“数据湖”作为近年来数据领域广泛…

链表入门(单链表讲)

链表 1.链表1.1 链表概念及其结构1.2 链表的分类 2.单链表代码实现2.1 单链表的定义2.2 单链表的初始化2.3 单链表的新增结点2.4 单链表的打印2.4 单链表的插入2.4.1 头插2.4.2 尾插2.4.3 任意位置插入 2.5 单链表的删除2.5.1 头删2.5.2 尾删2.5.3 任意位置删除 2.6 单链表的查…

【PickerView案例10-国旗选择界面02 Objective-C预言】

一、好了,我们继续来实现这个国旗选择界面: 1.它的界面里面,是不是很简单,就一个UIPickerView,就完事儿了 然后,显示的每一行内容呢, 1)一个文字Label 2)一个图片 那大家应该有意识,它返回的应该是一个View,对吧, 代理方法里面,有一个返回View的,viewForRow…

Django:五、登录界面实现动态图片验证码

一、下载包 pip install pillow 二、代码 这是一个函数&#xff0c;无输入&#xff0c;返回两个值。一个值是图片&#xff0c;一个值是图片中的数字及字母。 需要注意&#xff1a;font_fileMonaco.ttf 是一个验证码字体文件&#xff0c;如有需要&#xff0c;可三连私信。 …

【逆向】在程序空白区添加Shellcode

目录 硬编码 内存对齐和文件对齐 节表 实战 滴水逆向03-17 #include <windows.h>LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) …

Pycharm 搭建 Django 项目,看完这一篇就够了

1. 安装需求 在使用 python 框架 Django 需要注意下面事项 Pycharm 版本是专业版而不是社区版本Pycharm 配置好了 python 解释器 &#xff08;一般我们现在用的都是python3&#xff09;我自己使用的是 Pycharm 版本是2020.1.2 2. 准备工作 2.1 新建项目 首先我们打开 Pycharm …