三层交换组网实验

三层交换组网实验
三层交换组网实验. 组网拓扑关键实验思路VLAN划分在L3-switch和L2-switch3上创建VLAN比如VLAN 10和VLAN 20并把连接PC的端口分配到对应VLAN中。Trunk链路L3-switch和L2-switch3之间的链路Gi0/2 - e0/0需要配置为Trunk模式让它能承载多个VLAN的流量。三层网关在L3-switch上为每个VLAN创建虚拟接口SVI即Switch Virtual Interface并配置IP地址作为PC的默认网关。启用路由在L3-switch上开启IP路由功能它就能在VLAN之间转发数据包了。L3的配置conf t(进入全局配置模式)ip routing(启用路由功能)vlan 10(创建vlan)vlan 20exitint g0/2switchport trunk encapsulation dot1qswitchport mode trunkno shutdownexitinterface vlan 10(为vlan创建虚拟端口并配置vlan)ip address 192.168.10.1 255.255.255.0no shutdownexitinterface vlan 20ip address 192.168.20.1 255.255.255.0no shutdownexitL2的配置conf tvlan 10vlan 20exitint e0/0switchport trunk encapsulation dot1qswitchport mode trunkno shutdownexitint e0/1switchport mode accessswitchport access vlan 10no shutdownexitint e0/2switchport mode accessswitchport access vlan 20no shutdownexit配置两台 Zhynet-VPCPC1 (接在e0/1口): IP设置为192.168.10.2/24默认网关为192.168.10.1PC2 (接在e0/2口): IP设置为192.168.20.2/24默认网关为192.168.20.1路由器模拟服务器开启 Web 服务充当网站服务器开启 DHCP 服务充当地址分配服务器开启 Telnet/SSH充当远程管理服务器conf tint f0/0ip address 192.168.10.100 255.255.255.0 # 配一个VLAN 10内的IPno shutdownexitip route 0.0.0.0 0.0.0.0 192.168.10.1line vty 0 4password ciscologinexitip http server配置完成后在PC1上用ping 192.168.20.2测试如果能通就说明三层交换组网成功了。