做网站是属火的职业吗友情链接交换系统
目录
路由器配置静态或默认路由实现 IP 子网之间的通信
地址聚合与最长前缀匹配路由配置
路由器配置静态或默认路由实现 IP 子网之间的通信
按如下拓扑图配置

其中,路由器加入4GEW-T

PC配置如下


LSW1的配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW1
[LSW1]vlan batch 10
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW1]
Sep 17 2023 19:04:40-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 5, the 
change loop count is 0, and the maximum number of records is 4095.
[LSW1]undo info-center enable
Info: Information center is disabled.
[LSW1]port-group pvlan10
[LSW1-port-group-pvlan10]group-member g0/0/1
[LSW1-port-group-pvlan10]group-member g0/0/11 to g0/0/14
[LSW1-port-group-pvlan10]port link-type access
[LSW1-GigabitEthernet0/0/1]port link-type access
[LSW1-GigabitEthernet0/0/11]port link-type access
[LSW1-GigabitEthernet0/0/12]port link-type access
[LSW1-GigabitEthernet0/0/13]port link-type access
[LSW1-GigabitEthernet0/0/14]port link-type access
[LSW1-port-group-pvlan10]port default vlan 10
[LSW1-GigabitEthernet0/0/1]port default vlan 10
[LSW1-GigabitEthernet0/0/11]port default vlan 10
[LSW1-GigabitEthernet0/0/12]port default vlan 10
[LSW1-GigabitEthernet0/0/13]port default vlan 10
[LSW1-GigabitEthernet0/0/14]port default vlan 10
[LSW1-port-group-pvlan10]quit
[LSW1]display vlan
The total number of vlans is : 2
--------------------------------------------------------------------------------
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/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/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)     GE0/0/24(D)                     10   common  UT:GE0/0/1(U)      GE0/0/11(U)     GE0/0/12(U)     GE0/0/13(U)     GE0/0/14(U)                                                     VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------1    enable  default       enable  disable    VLAN 0001                         
10   enable  default       enable  disable    VLAN 0010                         
[LSW1]display port vlan
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
GigabitEthernet0/0/1    access       10    -                                   
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    hybrid       1     -                                   
GigabitEthernet0/0/10   hybrid       1     -                                   
GigabitEthernet0/0/11   access       10    -                                   
GigabitEthernet0/0/12   access       10    -                                   
GigabitEthernet0/0/13   access       10    -                                   
GigabitEthernet0/0/14   access       10    -                                   
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   hybrid       1     -                                   
[LSW1] 
配置RTA
<Huawei>SYS
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTA
[RTA]int g4/0/0
[RTA-GigabitEthernet4/0/0]ip address 192.168.10.1 24
Sep 17 2023 19:10:17-08:00 RTA %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IPon the interface GigabitEthernet4/0/0 has entered the UP state. 
[RTA-GigabitEthernet4/0/0]qu
[RTA]int g0/0/0
[RTA-GigabitEthernet0/0/0]ip address 172.16.101.1 24
Sep 17 2023 19:10:39-08:00 RTA %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IPon the interface GigabitEthernet0/0/0 has entered the UP state. 
[RTA-GigabitEthernet0/0/0]qu
[RTA]int g0/0/1
[RTA-GigabitEthernet0/0/1]ip address 172.16.103.1 24
[RTA-GigabitEthernet0/0/1]
Sep 17 2023 19:10:59-08:00 RTA %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IPon the interface GigabitEthernet0/0/1 has entered the UP state. 
[RTA-GigabitEthernet0/0/1]qu
[RTA] 
配置RTB
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTB
[RTB]int g4/0/0
[RTB-GigabitEthernet4/0/0]ip address 192.168.30.1 24
Sep 17 2023 19:12:19-08:00 RTB %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IPon the interface GigabitEthernet4/0/0 has entered the UP state. 
[RTB-GigabitEthernet4/0/0]qu
[RTB]int g0/0/0
[RTB-GigabitEthernet0/0/0]ip address 172.16.101.2 24
Sep 17 2023 19:12:43-08:00 RTB %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IPon the interface GigabitEthernet0/0/0 has entered the UP state. 
[RTB-GigabitEthernet0/0/0]qu
[RTB]interface g0/0/1
[RTB-GigabitEthernet0/0/1]ip address 172.16.102.2 24
Sep 17 2023 19:13:02-08:00 RTB %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IPon the interface GigabitEthernet0/0/1 has entered the UP state. 
[RTB-GigabitEthernet0/0/1]qu 
配置RTC
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTC
[RTC]int g4/0/0
[RTC-GigabitEthernet4/0/0]ip address 192.168.80.1 24
Sep 17 2023 19:15:08-08:00 RTC %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IPon the interface GigabitEthernet4/0/0 has entered the UP state. 
[RTC-GigabitEthernet4/0/0]qu
[RTC]int g4/0/1
[RTC-GigabitEthernet4/0/1]ip address 192.168.81.1 24
Sep 17 2023 19:15:28-08:00 RTC %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IPon the interface GigabitEthernet4/0/1 has entered the UP state. 
[RTC-GigabitEthernet4/0/1]qu
[RTC]interface g0/0/0
[RTC-GigabitEthernet0/0/0]ip address 172.16.103.2 24
Sep 17 2023 19:15:50-08:00 RTC %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IPon the interface GigabitEthernet0/0/0 has entered the UP state. 
[RTC-GigabitEthernet0/0/0]qu
[RTC]interface g0/0/1
[RTC-GigabitEthernet0/0/1]ip address 172.16.102.1 24
Sep 17 2023 19:16:08-08:00 RTC %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IPon the interface GigabitEthernet0/0/1 has entered the UP state. 
[RTC-GigabitEthernet0/0/1]qu 
路由规划如下
招生就业部的计算机最多,可以使用默认路由。
同时将路由器RTB到招生就业部网络的路由设置为静态路由,下一跳地址为路由 器RTA的172.16.101.1。
将路由器RTB到学籍管理部和考试中心网络的路由设置为默 认路由,下一跳地址为路由器RTC的172.16.102.1。

配置路由器RTA的路由
<RTA>
<RTA>sys
Enter system view, return user view with Ctrl+Z.
[RTA]ip route-static 0.0.0.0 0.0.0.0 172.16.101.2
[RTA]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 14       Routes : 14       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   172.16.101.2    GigabitEthernet
0/0/0127.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       InLoopBack0172.16.101.0/24  Direct  0    0           D   172.16.101.1    GigabitEthernet
0/0/0172.16.101.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.101.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.103.0/24  Direct  0    0           D   172.16.103.1    GigabitEthernet
0/0/1172.16.103.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.103.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1192.168.10.0/24  Direct  0    0           D   192.168.10.1    GigabitEthernet
4/0/0192.168.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0 
配置路由器RTB的路由
[RTB]ip route-static 192.168.10.0 24 172.16.101.1
[RTB]ip route-static 0.0.0.0 0.0.0.0 172.16.102.1
[RTB]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 15       Routes : 15       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   172.16.102.1    GigabitEthernet
0/0/1127.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       InLoopBack0172.16.101.0/24  Direct  0    0           D   172.16.101.2    GigabitEthernet
0/0/0172.16.101.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.101.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.102.0/24  Direct  0    0           D   172.16.102.2    GigabitEthernet
0/0/1172.16.102.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.102.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1192.168.10.0/24  Static  60   0          RD   172.16.101.1    GigabitEthernet
0/0/0192.168.30.0/24  Direct  0    0           D   192.168.30.1    GigabitEthernet
4/0/0192.168.30.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0 
配置路由器RTC的路由
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname RTC
[RTC]int g4/0/0
[RTC-GigabitEthernet4/0/0]ip address 192.168.80.1 24
Sep 17 2023 19:15:08-08:00 RTC %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IPon the interface GigabitEthernet4/0/0 has entered the UP state. 
[RTC-GigabitEthernet4/0/0]qu
[RTC]int g4/0/1
[RTC-GigabitEthernet4/0/1]ip address 192.168.81.1 24
Sep 17 2023 19:15:28-08:00 RTC %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IPon the interface GigabitEthernet4/0/1 has entered the UP state. 
[RTC-GigabitEthernet4/0/1]qu
[RTC]interface g0/0/0
[RTC-GigabitEthernet0/0/0]ip address 172.16.103.2 24
Sep 17 2023 19:15:50-08:00 RTC %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IPon the interface GigabitEthernet0/0/0 has entered the UP state. 
[RTC-GigabitEthernet0/0/0]qu
[RTC]interface g0/0/1
[RTC-GigabitEthernet0/0/1]ip address 172.16.102.1 24
Sep 17 2023 19:16:08-08:00 RTC %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IPon the interface GigabitEthernet0/0/1 has entered the UP state. 
[RTC-GigabitEthernet0/0/1]qu
[RTC]Please check whether system data has been changed, and save data in timeConfiguration console time out, please press any key to log on<RTC>sys
Enter system view, return user view with Ctrl+Z.
[RTC]ip route-static 0.0.0.0 0.0.0.0 172.16.103.1
[RTC]display IP routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 17       Routes : 17       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   172.16.103.1    GigabitEthernet
0/0/0127.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       InLoopBack0172.16.102.0/24  Direct  0    0           D   172.16.102.1    GigabitEthernet
0/0/1172.16.102.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.102.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.103.0/24  Direct  0    0           D   172.16.103.2    GigabitEthernet
0/0/0172.16.103.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.103.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0192.168.80.0/24  Direct  0    0           D   192.168.80.1    GigabitEthernet
4/0/0192.168.80.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.80.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.81.0/24  Direct  0    0           D   192.168.81.1    GigabitEthernet
4/0/1192.168.81.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/1192.168.81.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0 
在PC-10-1测试是否能与PC-30-1、PC-80-1和PC-81-1通信:
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=126 time=47 ms
From 192.168.30.11: bytes=32 seq=2 ttl=126 time=47 ms
From 192.168.30.11: bytes=32 seq=3 ttl=126 time=31 ms
From 192.168.30.11: bytes=32 seq=4 ttl=126 time=32 ms
From 192.168.30.11: bytes=32 seq=5 ttl=126 time=31 ms--- 192.168.30.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
From 192.168.80.11: bytes=32 seq=1 ttl=126 time=47 ms
From 192.168.80.11: bytes=32 seq=2 ttl=126 time=16 ms
From 192.168.80.11: bytes=32 seq=3 ttl=126 time=47 ms
From 192.168.80.11: bytes=32 seq=4 ttl=126 time=47 ms
From 192.168.80.11: bytes=32 seq=5 ttl=126 time=62 ms--- 192.168.80.11 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 16/43/62 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=126 time=47 ms
From 192.168.81.11: bytes=32 seq=2 ttl=126 time=47 ms
From 192.168.81.11: bytes=32 seq=3 ttl=126 time=31 ms
From 192.168.81.11: bytes=32 seq=4 ttl=126 time=47 ms
From 192.168.81.11: bytes=32 seq=5 ttl=126 time=47 ms--- 192.168.81.11 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 31/43/47 ms 
在PC-30-1测试是否能与PC-10-1、PC-80-1和PC-81-1通信:
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=126 time=63 ms
From 192.168.10.11: bytes=32 seq=3 ttl=126 time=47 ms
From 192.168.10.11: bytes=32 seq=4 ttl=126 time=47 ms
From 192.168.10.11: bytes=32 seq=5 ttl=126 time=47 ms--- 192.168.10.11 ping statistics ---5 packet(s) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/51/63 msPC>ping 192.168.80.11Ping 192.168.80.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.80.11: bytes=32 seq=2 ttl=125 time=15 ms
From 192.168.80.11: bytes=32 seq=3 ttl=125 time=32 ms
From 192.168.80.11: bytes=32 seq=4 ttl=125 time=15 ms
From 192.168.80.11: bytes=32 seq=5 ttl=125 time=16 ms--- 192.168.80.11 ping statistics ---5 packet(s) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/19/32 msPC>ping 192.168.81.11Ping 192.168.81.11: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.81.11: bytes=32 seq=2 ttl=125 time=16 ms
From 192.168.81.11: bytes=32 seq=3 ttl=125 time=16 ms
From 192.168.81.11: bytes=32 seq=4 ttl=125 time=31 ms
From 192.168.81.11: bytes=32 seq=5 ttl=125 time=16 ms--- 192.168.81.11 ping statistics ---5 packet(s) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/19/31 ms 
在PC-80-1测试是否能与PC-10-1、PC-30-1和PC-81-1通信:
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=46 ms
From 192.168.10.11: bytes=32 seq=3 ttl=125 time=47 ms
From 192.168.10.11: bytes=32 seq=4 ttl=125 time=63 ms
From 192.168.10.11: bytes=32 seq=5 ttl=125 time=47 ms--- 192.168.10.11 ping statistics ---5 packet(s) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/50/63 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=126 time=15 ms
From 192.168.30.11: bytes=32 seq=3 ttl=126 time=32 ms
From 192.168.30.11: bytes=32 seq=4 ttl=126 time=15 ms
From 192.168.30.11: bytes=32 seq=5 ttl=126 time=16 ms--- 192.168.30.11 ping statistics ---5 packet(s) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/19/32 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=127 time=16 ms
From 192.168.81.11: bytes=32 seq=2 ttl=127 time=16 ms
From 192.168.81.11: bytes=32 seq=3 ttl=127 time=15 ms
From 192.168.81.11: bytes=32 seq=4 ttl=127 time=16 ms
From 192.168.81.11: bytes=32 seq=5 ttl=127 time=15 ms--- 192.168.81.11 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 15/15/16 ms 
在PC-81-1测试是否能与PC-10-1、PC-30-1和PC-80-1通信:
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=125 time=47 ms
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=47 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=63 ms--- 192.168.10.11 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 47/53/63 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=126 time=31 ms
From 192.168.30.11: bytes=32 seq=2 ttl=126 time=16 ms
From 192.168.30.11: bytes=32 seq=3 ttl=126 time=15 ms
From 192.168.30.11: bytes=32 seq=4 ttl=126 time=31 ms
From 192.168.30.11: bytes=32 seq=5 ttl=126 time=32 ms--- 192.168.30.11 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 15/25/32 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=15 ms
From 192.168.80.11: bytes=32 seq=2 ttl=127 time=16 ms
From 192.168.80.11: bytes=32 seq=3 ttl=127 time=16 ms
From 192.168.80.11: bytes=32 seq=4 ttl=127 time=15 ms
From 192.168.80.11: bytes=32 seq=5 ttl=127 time=16 ms--- 192.168.80.11 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 15/15/16 ms 
至此,我们可以看到,不同vlan间也可以进行相互通信
我们也可以通过tracert,跟踪分析数据包从源主机到目标主机的路径,例如
在PC-10-1中
PC>tracert 192.168.81.11traceroute to 192.168.81.11, 8 hops max
(ICMP), press Ctrl+C to stop1  192.168.10.1   32 ms  46 ms  47 ms  //第一跳为网关2  172.16.101.2   32 ms  62 ms  78 ms  //经过RTA的0/0/0端口3  172.16.102.1   31 ms  47 ms  63 ms  //经过RTC的0/0/1端口4  192.168.81.11   47 ms  47 ms  46 ms //最后到达目标主机
 
 
地址聚合与最长前缀匹配路由配置

路由规划
将路由器 RTA 到所有其他用户网络的路由设置为默认路由,下一跳地址为路由器 RTB的172.16.101.2。
将路由器RTB到招生就业部网络 的路由设置为默认路由,下一跳地址为路由器RTA的172.16.101.1;由于学籍管理部和考试中心网络的IP地址是连续的,为减少路由条目,可以将它们聚合为一个地址 192.168.80.0/23,将到学籍管理部和考试中心网络的路由设置为静态路由,目的地址为聚合地址 192.168.80.0, 子网掩码 为 255.255.254.0 , 下一跳地址为路由器RTC 的 172.16.102.1。
在路由器RTC的路由表中,配置一条到所有其他用户网络的默认路由,下一跳地址为路由器RTA的172.16.103.1。再增加一条经过路由器RTC到招生就业部计算机PC-10-4的静态路由,下一跳地址为路由器RTB的172.16.102.2。按最长前缀匹配规则,将其子网掩码设置为255.255.255.255(目标IP地址与指定的地址完全相同)。

对RTA路由器的配置
[RTA]ip route-static 0.0.0.0 0.0.0.0 172.16.101.2
[RTA]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 14       Routes : 14       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   172.16.101.2    GigabitEthernet
0/0/0127.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       InLoopBack0172.16.101.0/24  Direct  0    0           D   172.16.101.1    GigabitEthernet
0/0/0172.16.101.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.101.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.103.0/24  Direct  0    0           D   172.16.103.1    GigabitEthernet
0/0/1172.16.103.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.103.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1192.168.10.0/24  Direct  0    0           D   192.168.10.1    GigabitEthernet
4/0/0192.168.10.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0[RTA] 
对RTB路由的配置
<RTB>sys
Enter system view, return user view with Ctrl+Z.
[RTB]ip route-static 192.168.80.0 23 172.16.102.1
[RTB]ip route-static 0.0.0.0 0.0.0.0 172.16.101.1
[RTB]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 15       Routes : 15       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   172.16.101.1    GigabitEthernet
0/0/0127.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       InLoopBack0172.16.101.0/24  Direct  0    0           D   172.16.101.2    GigabitEthernet
0/0/0172.16.101.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.101.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.102.0/24  Direct  0    0           D   172.16.102.2    GigabitEthernet
0/0/1172.16.102.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.102.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1192.168.30.0/24  Direct  0    0           D   192.168.30.1    GigabitEthernet
4/0/0192.168.30.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.80.0/23  Static  60   0          RD   172.16.102.1    GigabitEthernet
0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0 
对RTC路由器进行配置
<RTC>sys
Enter system view, return user view with Ctrl+Z.
[RTC]ip route-static 192.168.10.14 32 172.16.102.2
[RTC]ip route-static 0.0.0.0 0.0.0.0 172.16.103.1
[RTC]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 18       Routes : 18       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   172.16.103.1    GigabitEthernet
0/0/0127.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       InLoopBack0172.16.102.0/24  Direct  0    0           D   172.16.102.1    GigabitEthernet
0/0/1172.16.102.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.102.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.103.0/24  Direct  0    0           D   172.16.103.2    GigabitEthernet
0/0/0172.16.103.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.103.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0192.168.10.14/32  Static  60   0          RD   172.16.102.2    GigabitEthernet
0/0/1192.168.80.0/24  Direct  0    0           D   192.168.80.1    GigabitEthernet
4/0/0192.168.80.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.80.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.81.0/24  Direct  0    0           D   192.168.81.1    GigabitEthernet
4/0/1192.168.81.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/1192.168.81.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0 
配置完成后,结果和第一个相同,不同IP子网间能完成通信
在PC-80-1做以下tracert操作
PC>tracert 192.168.10.11traceroute to 192.168.10.11, 8 hops max
(ICMP), press Ctrl+C to stop1  192.168.80.1   16 ms  16 ms  <1 ms2  172.16.103.1   15 ms  32 ms  15 ms3  192.168.10.11   31 ms  47 ms  47 msPC>tracert 192.168.10.14traceroute to 192.168.10.14, 8 hops max
(ICMP), press Ctrl+C to stop1  192.168.80.1   16 ms  16 ms  15 ms2  172.16.102.2   16 ms  31 ms  16 ms3  172.16.101.1   15 ms  32 ms  31 ms4  192.168.10.14   62 ms  79 ms  46 msPC>tracert 192.168.30.11traceroute to 192.168.30.11, 8 hops max
(ICMP), press Ctrl+C to stop1  192.168.80.1   16 ms  <1 ms  15 ms2  172.16.103.1   31 ms  16 ms  16 ms3  172.16.101.2   15 ms  32 ms  31 ms4  192.168.30.11   15 ms  32 ms  31 ms
 
将路由器RTB路由表中路由的目的地址 为 聚 合 地 址 192.168.80.0的子网掩码改为255.255.0.0,下一跳地址不变,仍为路由器RTC的172.16.102.1:
<RTB>sys
Enter system view, return user view with Ctrl+Z.
[RTB]undo ip route-static 192.168.80.0 23 172.16.102.1
[RTB]ip route-static 192.168.80.0 16 172.16.102.1
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.0.0/16 was generated.
[RTB]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 15       Routes : 15       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   172.16.101.1    GigabitEthernet
0/0/0127.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       InLoopBack0172.16.101.0/24  Direct  0    0           D   172.16.101.2    GigabitEthernet
0/0/0172.16.101.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.101.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.102.0/24  Direct  0    0           D   172.16.102.2    GigabitEthernet
0/0/1172.16.102.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.102.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1192.168.0.0/16  Static  60   0          RD   172.16.102.1    GigabitEthernet
0/0/1192.168.30.0/24  Direct  0    0           D   192.168.30.1    GigabitEthernet
4/0/0192.168.30.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0#与之前的路由表进行对比
[RTB]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: PublicDestinations : 15       Routes : 15       Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface0.0.0.0/0   Static  60   0          RD   172.16.101.1    GigabitEthernet
0/0/0127.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       InLoopBack0172.16.101.0/24  Direct  0    0           D   172.16.101.2    GigabitEthernet
0/0/0172.16.101.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.101.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0172.16.102.0/24  Direct  0    0           D   172.16.102.2    GigabitEthernet
0/0/1172.16.102.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1172.16.102.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1192.168.30.0/24  Direct  0    0           D   192.168.30.1    GigabitEthernet
4/0/0192.168.30.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.30.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
4/0/0192.168.80.0/23  Static  60   0          RD   172.16.102.1    GigabitEthernet
0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0 
可以看到,目的地址变为了192.168.0.0/16,将较小的子网聚合为一个更大的子网后,减少了IP地址的使用,整个路由表的条目数量减少。
以下为拓扑图的链接
链接:https://pan.baidu.com/s/16xQ6-5hikMziAcKYjCFX0g 
 提取码:ki07
但是还是提倡多写,多理解,多抓包,佬们一起努力!!💖💖💖💖
