理论知识
1、三层交换本身提供路由功能,不需要借助路由转发到不同VLAN之间的流量
2、配置三层接口连接终端还是远远不够的,这些交换机端口工作在Access模式下的二层接口
三层交换机VLAN间路由的配置
SW1上配置:
[SW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]interface Vlanif 10 #为vlan10、20分别创建一个三层接口,注意接口编号要和VLAN ID一一对应
[SW1-Vlanif10]ip address 192.168.0.254 24
[SW1-Vlanif10]undo shutdown
Info: Interface Vlanif10 is not shutdown.
[SW1-Vlanif10]quit
[SW1]interface Vlanif 20
[SW1-Vlanif20]ip address 172.16.0.254 24
[SW1-Vlanif20]undo shutdown
Info: Interface Vlanif20 is not shutdown.
[SW1-Vlanif20]quit
[SW1]interface Ethernet 0/0/1
[SW1-Ethernet0/0/1]port link-type access
[SW1-Ethernet0/0/1]port default vlan 10
[SW1-Ethernet0/0/1]quit
[SW1]interface Ethernet 0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 20
[SW1-Ethernet0/0/2]quit
查看 SW1 上的VLAN信息
SW1有两个接口分别加入VLAN10、20,也就是连接PC1、PC2的接口,三层接口不会出现。
小结
三层交换具有路由功能,可以配置三层VLANIF接口。