VLAN(VirtualLocalAreaNetwork)的中文名为"虚拟局域网"。VLAN是一种将局域网设备从逻辑上划分成一个个网段,从而实现虚拟工作组的新兴数据交换技术。本文是小编带来如何实现同一路由器不同vlan之间的通信,大家可以参考了解下!
第一步,看拓扑图。
先把pc上的ip都配好。开始设置
switch0:
>en
>conft
>vlan2
>exit
>intfa0/1
>switchportaccessvlan2
>exit
>intfa0/2
>switchportaccessvlan2
>exit
>intfa0/3
>switchportmodetrunk
>end
switch1:
>en
>conft
>vlan3
>exit
>intfa0/1
>switchportaccessvlan3
>exit
>intfa0/2
>switchportaccessvlan3
>exit
>intfa0/3
>switchportmodetrunk
>end
Router0:
>enable
>configureterminal
>interfacefastEthernet0/0
>noipadderss//清除ip
>noshutsown
>exit
>interfacefastEthernet0/0.1//子接口设置
>encapsulationdot1Q2//封装协议连到vlan2
>ipaddress192.168.0.1255.255.255.0
>exit
>interfacefastEthernet0/1
>noipadderss//清除ip
>noshutsown
>exit
>interfacefastEthernet0/1.1//子接口设置
>encapsulationdot1Q3//封装协议连到vlan3
>ipaddress192.168.1.1255.255.255.0
>end
pc0CMD:
pingPC1
pingPC3