华为交换机与华为交换机ping通基本方式

华为交换机与华为交换机ping通基本方式
首先设置PC机的IP地址及网关地址
SW1----(左边交换机)

system-view                        /进入系统视图(默认用户视图)
[Huawei]sysname SW1                   /更改设备名字
[SW1]                           /名字更改好
[SW1]interface Vlanif 1                   /进入Vlanif 1接口
[SW1-Vlanif1]ip address 192.168.1.100 24          /设置交换机的IP地址
=================================================================================SW2----(右边交换机)
system-view                        /进入系统视图(默认用户视图)
[Huawei]sysname SW2                   /更改设备名字
[SW2]                           /名字更改好
[SW2]interface Vlanif 1                   /进入Vlanif 1接口
[SW2-Vlanif1]ip address 192.168.2.100 24          /设置交换机的IP地址
=================================================================================AR1----路由器
system-view                        /进入系统视图(默认用户视图)
[Huawei]sysname AR1                   /更改设备名字
[AR1]                            /名字更改好
[AR1]interface GigabitEthernet 0/0/0             /进入0/0/0接口
[AR1-GigabitEthernet0/0/0]ip address 192.168.1.254 24   /设置0/0/0接口的网关地址
[AR1-GigabitEthernet0/0/0]quit               /返回系统试图
[AR1]interface GigabitEthernet 0/0/1             /进入0/0/1接口
[AR1-GigabitEthernet0/0/1]ip address 192.168.2.254 24 /设置0/0/1接口的网关地址
=================================================================================SW1----(左边交换机)
system-view                       /进入系统视图(默认用户视图)
[SW1]ip route-static 0.0.0.0 0 192.168.1.254       /在sw1上配置下一跳去往AR1的网关地址
=================================================================================SW2----(右边交换机)
system-view                      /进入系统视图(默认用户视图)
[SW2]ip route-static 0.0.0.0 0 192.168.2.254       /在sw2上配置下一跳去往AR1的网关地址
=================================================================================SW1----(左边交换机)
[SW1]ping 192.168.2.100                /ping目标地址
PING 192.168.2.100: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Reply from 192.168.2.100: bytes=56 Sequence=3 ttl=254 time=10 ms
Reply from 192.168.2.100: bytes=56 Sequence=4 ttl=254 time=50 ms
Reply from 192.168.2.100: bytes=56 Sequence=5 ttl=254 time=30 ms

— 192.168.2.100 ping statistics —
5 packet(s) transmitted
3 packet(s) received
40.00% packet loss
round-trip min/avg/max = 10/30/50 ms

[SW1] User interface con0 is available
=================================================================================SW2----(右边交换机)
[SW2]ping 192.168.1.100               /ping目标地址
PING 192.168.1.100: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.100: bytes=56 Sequence=1 ttl=254 time=60 ms
Reply from 192.168.1.100: bytes=56 Sequence=2 ttl=254 time=60 ms
Reply from 192.168.1.100: bytes=56 Sequence=3 ttl=254 time=60 ms
Reply from 192.168.1.100: bytes=56 Sequence=4 ttl=254 time=70 ms
Reply from 192.168.1.100: bytes=56 Sequence=5 ttl=254 time=50 ms

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