实例讲解三层交换机配置中关于VLAN划分以及设置问题
创始人
2024-06-20 04:21:46
0

实例讲解三层交换机配置中关于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

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
Windows恶意软件20年“... 在Windows的早期年代,病毒游走于系统之间,偶尔删除文件(但被删除的文件几乎都是可恢复的),并弹...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...
德国电信门户网站可实时显示全球... 德国电信周三推出一个门户网站,直观地实时提供其安装在全球各地的传感器网络检测到的网络攻击状况。该网站...
着眼MAC地址,解救无法享受D... 在安装了DHCP服务器的局域网环境中,每一台工作站在上网之前,都要先从DHCP服务器那里享受到地址动...
为啥国人偏爱 Mybatis,... 关于 SQL 和 ORM 的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行...