PC1与PC2之间在不同VLAN,通过设置上层三层交换机SwitchB的VLAN接口10的IP地址为
10.1.1.254/24,路由器设置VLAN接口20的IP地址为20.1.1.254/24可以实现VLAN间的互访。
二、组网图
[SwitchA-GigabitEthernet1/1]port link-type trunk //将端口G1/1配置为Trunk端口
[SwitchA-GigabitEthernet1/1]port trunk permit vlan 10 20 //允许VLAN10和VLAN20通过
SwitchB相关配置:[SwitchB]vlan 10 //创建VLAN10
hin[SwitchA-vlan10]port Ethernet 0/1 //将E0/1加入到VLAN10
[SwitchA]vlan 20 //创建VLAN20
[SwitchA-vlan20]port Ethernet 0/2 //将E0/2加入到VLAN20
[SwitchA]interface GigabitEthernet 1/1
gs[SwitchA]vlan 10 //创建VLAN10
inSwitchA相关配置:
th三、配置步骤
eir being are goo [SwitchB]interface vlan 10
[SwitchB-int-vlan10]ip address 10.1.1.254 255.255.255.0 //设置VLAN10的虚接口地址
[SwitchB]vlan 20 //创建VLAN20[SwitchB]interface vlan 20
[SwitchB-int-vlan20]ip address 20.1.1.254 255.255.255.0 //设置VLAN20的虚接口地址
[SwitchB]interface GigabitEthernet 1/1
[SwitchB-GigabitEthernet1/1]port trunk permit vlan 10 20 //允许VLAN10和VLAN20通过
[SwitchB-GigabitEthernet1/1]port link-type trunk //将端口G1/1配置为Trunk端口
因篇幅问题不能全部显示,请点此查看更多更全内容