拓扑图
配置思路
1. pc 配置 IP 地址、子网掩码、网关
2. 交换机创建 VLAN ,给各接口配置接口类型、 VLAN
3. 使用 VLANIF 配置虚拟网关
1. pc配置
pc1
pc2
pc3
pc4
2.交换机命令
sys
un in en
sys SW1
vlan batch 10 20
int e0/0/1
port link-type access
port default vlan 10
q
int e0/0/2
port link-type access
port default vlan 10
q
int e0/0/3
port link-type access
port default vlan 20
q
int e0/0/4
port link-type access
port default vlan 20
q
int vlanif 10
ip address 192.168.1.254 255.255.255.0
q
int vlanif 20
ip address 192.168.2.254 255.255.255.0
q
验证 ping 192.168.1.2、2.1、2.2