1. 网络拓扑:
2. SW1配置:
2.1 关闭设备调试信息:
<Huawei>undo terminal monitor
<Huawei>undo terminal debugging
2.2 进入系统模式:
<Huawei>system-view
2.3 重命名:
[Huawei]sysname SW1
2.4 创建两个vlan:
[SW1]vlan batch 10 20
2.5 GE0/0/1 口配置access口:
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10
2.6 GE0/0/2 口配置access口:
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20
查看配置:
[SW1-GigabitEthernet0/0/2]display this
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
return
2.7 GE0/0/24Trunk口配置:
[SW1-GigabitEthernet0/0/24]port link-type trunk
[SW1-GigabitEthernet0/0/24]port trunk allow-pass vlan 10 20
2.8 查看端口vlan配置
2.9 SW1保存配置
<SW1>save
3. SW2配置:
与SW1做相同配置
4. 验证配置:
PC1:
PC2: