一、实验目的
使用神州数码三层交换机DCRS-5526S通过防火墙DCFW-1800S-L,使三层交换机下的pc都能够访问因特网.
二、实验设备
交换机DCRS-5526S一台 防火墙DCFW-1800S-L一台 Pc机三台
Console线两根 网线若干
简单实验拓扑
外网ip:192.168.6.0/24 网关:192.168.6.254 Wan口 防火墙DCFW-1800S-L Lan口 Lan口ip要和vlan1的接口ip在同一网段 Wan口ip:192.168.6.100/24 Lan口ip:192.168.5.1/24 三层交换机DCRS-5526S VLAN1 IP:192.168.5.254/24 VLAN10 IP:192.168.10.254/24 VLAN20 IP:192.168.20.254/24 PC1 IP:192.168.5.2/24 网关:192.168.5.254 PC10 IP:192.168.10.2/24 网关:192.168.10.254 PC2 IP:192.168.20.2/24 网关:192.168.20.254 Pc1兼防火墙的web管理端
三、实验要求
本实验中
1.外网ip:192.168.6.0/24;网关:192.168.6.254
2.三台pc的ip配置
Pc号 Pc1 Pc10 Pc20 Ip 192.168.5.2/24 192.168.10.2/24 192.168.20.2/24 网关 192.168.5.254 192.168.10.254 192.168.20.254
3.三层交换机DCRS-5526S
在交换机上划分三个基于端口的VLAN:VLAN1,VLAN10,VLAN20.
vlan 1 10 20 端口成员 0/0/1-8 0/0/9-16 0/0/17-24 IP 192.168.5.254/24 192.168.10.254/24 192.168.20.254/24
设置交换机缺省路由为0.0.0.0 0.0.0.0 192.168.5.1
4.防火墙DCFW-1800S-L
接口 If0 If1 管理端ip 接口ip 192.168.6.100/24 192.168.5.1/24 192.168.5.2/24
5.验证:
如果交换机上vlan1,vlan10,vlan20下的pc都能够上网,则实验成功
四、实验具体步骤:
1. 三层交换机DCRS-5526S的console配置
1)建立连接,打开超级终端,根据提示操作。
第一步
第二步
第三步
2)命令的配置 switch>
switch>enable switch#config switch(Config)#interface vlan 1 switch(Config-If-Vlan1)#ip address 192.168.5.254 255.255.255.0 switch(Config-If-Vlan1)#exit switch(Config)#vlan 10 switch(Config-Vlan10)#switchport interface ethernet 0/0/9-16 Set the port Ethernet0/0/9 access vlan 10 successfully Set the port Ethernet0/0/10 access vlan 10 successfully Set the port Ethernet0/0/11 access vlan 10 successfully Set the port Ethernet0/0/12 access vlan 10 successfully Set the port Ethernet0/0/13 access vlan 10 successfully Set the port Ethernet0/0/14 access vlan 10 successfully Set the port Ethernet0/0/15 access vlan 10 successfully Set the port Ethernet0/0/16 access vlan 10 successfully switch(Config-Vlan10)#exit switch(Config)#interface vlan 10
进入特权模式 进入全局模式
配置vlan1的接口ip
建立vlan10
将Ethernet0/0/9-16端口加入vlan10
01:31:35: %LINK-5-CHANGED: Interface Vlan10, changed state to UP switch(Config-If-Vlan10)#ip address 192.168.10.254 255.255.255.0 switch(Config-If-Vlan10)#exit switch(Config)#vlan 20
switch(Config-Vlan20)#switchport interface ethernet 0/0/17-24 Set the port Ethernet0/0/17 access vlan 20 successfully Set the port Ethernet0/0/18 access vlan 20 successfully Set the port Ethernet0/0/19 access vlan 20 successfully Set the port Ethernet0/0/20 access vlan 20 successfully Set the port Ethernet0/0/21 access vlan 20 successfully Set the port Ethernet0/0/22 access vlan 20 successfully Set the port Ethernet0/0/23 access vlan 20 successfully Set the port Ethernet0/0/24 access vlan 20 successfully switch(Config-Vlan20)#exit switch(Config)#interface vlan 20
01:32:23: %LINK-5-CHANGED: Interface Vlan20, changed state to UP switch(Config-If-Vlan20)#ip address 192.168.20.254 255.255.255.0 switch(Config-If-Vlan20)#exit
switch(Config)#ip route 0.0.0.0 0.0.0.0 192.168.5.1 配置指向防火墙的静态
路由(缺省路由)
2.防火墙DCFW-1800S-L的配置
1)建立连接,打开超级终端,根据提示操作。
第一步
第二步第三步
账号密码均为:admin
2)命令配置
a.恢复出厂设置命令 # ruleconfig load default #apply #save b. 接口配置命令 # ifconfig list
# ifconfig if0 192.168.6.100/24 # ifconfig if1 192.168.5.1/24 # adminhost add 192.168.5.2 #apply
# save
恢复出厂设置 应用刚才的操作 保存当前配置
配置wan口IP, If0是广域网 配置lan口IP, If1是局域网 添加管理主机地址
修改配置后,要用apply 命令才能使新配置生效
save 将配置写入flash 中,修改配置后,如果不用save 命令写到非易失存储器中,下次重启防火墙后,当前运行的配置将丢失。
至此在console配置模式下的配置就结束了,下面进入web管理配置.
3)web管理配置
通过管理主机pc1(管理主机的ip为adminhost add命令添加的ip)在地址栏中输入:https://192.168.5.1:1211(注意是https)
帐号密码均为:admin
a.为了使三层交换机5526的各个vlan能够上网,先进入配置接口选项:
b.选中vlan选项卡
c.点击新增
Ip/maskbits: vlan10的网段 Vlan接口: 可以随意选一个 物理接口: 选中if1:192.168.5.1,即防火墙的lan接口 Vlan tag: 数值为5526交换机的vlanId,现在是在为vlan10配置,应设为”10” 点击确定,然后再配一个vlan供5526的vlan20使用,最后如下图
d.接着配置路由:
在”缺省路由:”处填入指向外网的网关:192.168.6.254
e.选中路由选项卡
f.点击新增
添加指向交换机vlan1接口的路由
g.配置防火墙策略:
点击新增:
参数如下:
使lan口访问wan口的通讯不受拦截. h.添加动态nat
点击新增
参数如下:
分别为192.168.5.0/24, 192.168.10.0/24, 192.168.20.0/24配置,最后如下图
通过nat,所有被添加的网段的ip都将转换为if0:192.168.6.100的ip地址 i.配置完后,点击右上角的应用:
j.应用后保存:点击保存
至此,三层交换机上的所以vlan都能够通过防火墙访问Internet了.
因篇幅问题不能全部显示,请点此查看更多更全内容