实验目的:实现不同网段,不同vlan的通信
步骤:1创建vlan 1 2 3
2把交换机与pc机间的端口,链路类型改为access,配上相应的vlan
3进入vlan1 2 3 的需接口,配上对应的网关,
4二层交换与三层交换的端口链路类型更改为trunk
5配置三层交换机,创建vlan1 2 3
三层交换与二层交换机的端口链路类型改为trunk
分别进入vlan 1 2 3的需接口配上网关
6验证是否能ping通
[sw1]Vlan batch 1 2 3
[Sw1]Int e0/0/1
[sw1-Ethernet0/0/1]Port link-type access
[sw1-Ethernet0/0/1]Port default 1
[sw1]Int vlan 10
[sw1-Vlanif1]Ip address 192.168.1 254 24
[sw1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 2
[sw1]int vlan 2
[sw1-Vlanif2]ip adderss 192.168.2.254 24
[sw]int e0/0/3
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/3]port default vlan 3
[sw]int vlan 3
[sw1-Vlanif2]ip address 192.168.3.254 24
[sw]int e0/0/4
[sw1-Ethernet0/0/4]port link-type trunk
[sw1-Ethernet0/0/4]port trunk allow-pass vlan all
下面配置三层交换
[huawei]sysname sw2
[Sw2]vlan batch 1 to 3
[sw]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 1 2 3
[sw2]int vlan 1
[sw2-Vlanif1]ip address 192.168.1.254 24
[sw]int vlan 2
[sw2-Vlanif2]ip address 192.168.2.254 24
[sw2]int vlan 3
[sw1-Vlanif3]ip add 192.168.3.254 24
下面用pc机192.168.1.1 ping pc2 和pc3验证是否能ping通
原文地址:http://blog.51cto.com/13935936/2299000