三层交换机单臂路由

Step1:必打命令

<Huawei>undo terminal monitor
<Huawei>system-view
[Huawei]sysname SW1
[SW1]user-interface console 0
[SW1-ui-console0]idle-timeout 0 0
[SW1-ui-console0]quit

Step2:设置交换机中的vlan种类

[SW1]vlan batch 10 20

Step3:设置两个端口的vlan同行模式

[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access 
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access 
[SW1-GigabitEthernet0/0/2]port default vlan 20
[SW1-GigabitEthernet0/0/2]quit

Step4:设置连接PC机的网关

[SW1]int Vlanif 10
[SW1-Vlanif10]ip address 192.168.1.1 24
[SW1-Vlanif10]undo shutdown
[SW1-Vlanif10]int vlanif 20
[SW1-Vlanif20]ip address 192.168.2.1 24
[SW1-Vlanif20]undo shutdown
[SW1-Vlanif20]quit

Step5:在PC机上ping两个网关和另一个PC机地址,ping通则代表成功。