三层交换机配置实例:D-Link DGS-3627三层交换机与路由器配置案例

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

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:10 interface:if10 VLAN20 虚接口:192.168.2.1 交换机接口:2号口VID:20 interface:if20 VLAN30 虚接口:192.168.3.1 交换机接口:3号口VID:30 interface:if30

VLAN40 虚接口:192.168.0.1 交换机接口:4-24号口VID:40 interface: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

相关文档
最新文档