创建VLAN
conf t
vlan 100
exit
vlan 200
exit
vlan 300
exit
开启SVI接口
int vlan 100
ip add 192.168.0.1 255.255.255.0
no shut
int vlan 200
ip add 192.168.1.1 255.255.255.0
no shut
int vlan 300
ip add 192.168.2.1 255.255.255.0
no shut
划分端口
int fa0/0
switch mode access
switch access vlan 100
int fa0/1
switch mode access
switch access vlan 200
int fa0/2
switch mode access
switch access vlan 300
配置连接路由器端口(假设路由器LAN口为192.168.100.1)
int fa0/24 (连接路由器接口)
ip add 192.168.100.254 255.255.255.0
no shut
exit
开启三层路由
ip routing
默认路由指向路由器
ip route 0.0.0.0 0.0.0.0 192.168.100.1
路由器上还需配置三条路由,不知道你的TL路由器怎么配置
就是把192.168.0.0/24 192.168.1.0/24 192.168.2.0/24三个网段的路由回指路由器
如有需要开得开启DHCP服务,免得手工配置IP
ip dhcp pool 01
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
dns-server 8.8.8.8 9.9.9.9 #DNS要根据你的实际DNS配置,可在路由器WAN口上查看
exit
ip dhcp excluded-address 192.168.0.1 #排除网关地址
ip dhcp pool 02
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 8.8.8.8 9.9.9.9 #DNS要根据你的实际DNS配置,可在路由器WAN口上查看
exit
ip dhcp excluded-address 192.168.1.1 #排除网关地址
ip dhcp pool 02
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
dns-server 8.8.8.8 9.9.9.9 #DNS要根据你的实际DNS配置,可在路由器WAN口上查看
exit
ip dhcp excluded-address 192.168.2.1 #排除网关地址