实例讲解三层交换机配置中关于VLAN划分以及设置问题

DGS-3627三层交换机配置的24口接到路由器的LAN口上面,路由器的LAN口地址是192.168
首页 新闻资讯 行业资讯 实例讲解三层交换机配置中关于VLAN划分以及设置问题

实例讲解三层交换机配置中关于VLAN划分以及设置问题,三层交换机配置中不能避免的就是关于vlan的划分和配置问题,一般情况下划分为4种,如何找回就成了我们关注的问题,本文从划分情况原理,配置思路以及测试过程上深入讲解了vlan的设置步骤。

DGS-3627交换机的IP地址是192.168.0.1,它同时也是VLAN40的虚接口地址,Vlan40与路由器连接。DGS-3627交换机的24口接到路由器的LAN口上面,路由器的LAN口地址是192.168.0.99,跟VLAN40是在同一个IP段里面,那么,客户机、三层交换机配置和路由器里面怎么设置才能让电脑上网呢?

三层交换机配置VLAN划分情况如下:
◆VLAN10虚接口:192.168.1.1  交换机接口:1号口  VID:10interface:if10
◆VLAN20虚接口:192.168.2.1  交换机接口:2号口  VID:20interface:if20
◆VLAN30虚接口:192.168.3.1  交换机接口:3号口  VID:30interface:if30
◆VLAN40虚接口:192.168.0.1  交换机接口:4-24号口  VID:40interface:system

创建一条默认路由
在交换机加条命令 create iproute default 192.168.0.99

在路由器上设几条静态路由:
192.168.1.0/255.255.255.0 192.168.0.1
192.168.2.0/255.255.255.0 192.168.0.1
192.168.3.0/255.255.255.0 192.168.0.1

三层交换机配置客户端设置,2网段为例
ip:192.168.2.X
mask:255.255.255.0
gw:192.168.2.1

三层交换机配置了虚接口后,各个Vlan之间是可以互访的,如果需要对用户的访问进行控制可以使用访问控制列表进行管理。访问控制方面,设置一下acl就可以了:允许所有用户上网:
create access_profile ip source_ip_mask 255.255.0.0 destination_ip_mask 255.255.255.255 profile_id 1 permit
config access_profile profile_id 1 add access_id 1 ip source_ip 192.168.0.0 destination_ip 192.168.0.99

三层交换机配置所有网段允许访问服务器所在公共网段vlan10:
create access_profile ip source_ip_mask 255.255.0.0 destination_ip_mask 255.255.255.0 profile_id 5 permit
config access_profile profile_id 5 add access_id 1 ip source_ip 192.168.0.0 destination_ip 192.168.1.0

三层交换机配置禁止Vlan之间互访:
create access_profile ip source_ip_mask 255.255.255.0 destination_ip_mask 255.255.255.0 profile_id 10 deny
config access_profile profile_id 10 add access_id 1 ip source_ip 192.168.2.0 destination_ip 192.168.0.0 deny
config access_profile profile_id 10 add access_id 2 ip source_ip 192.168.2.0 destination_ip 192.168.3.0 deny
config access_profile profile_id 10 add access_id 3 ip source_ip 192.168.0.0 destination_ip 192.168.2.0 deny
config access_profile profile_id 10 add access_id 4 ip source_ip 192.168.0.0 destination_ip 192.168.3.0 deny
config access_profile profile_id 10 add access_id 5 ip source_ip 192.168.3.0 destination_ip 192.168.2.0 deny
config access_profile profile_id 10 add access_id 6 ip source_ip 192.168.3.0 destination_ip 192.168.0.0 deny

13    2010-01-11 10:30:25    三层交换机配置