一.实验拓扑图

二.要求

1、VLAN 2属于办公区;VLAN 3属于生产区
2、办公区PC在工作时间(周一至周五,早8到晚6)可以正常访问OA Server,其他时间不允许
3、办公区c司以在任意时刻访问Web Server
4、生产区PC可以在住意时刻访问OA Server,但是不能访问Web Server
5、特例:生产区PC3可以在每周一早10到早11访问Web Server,用来更新企业最新产品信息

三.配置

pc1

pc2

pc3

OA

web

lsw1(trust)


vlan batch 2 3  创建VLAN

PC1 接入端口 (VLAN2 办公区)
interface Ethernet0/0/1
 port link-type access
 port default vlan 2

PC2 接入端口 (VLAN3 生产区)
interface Ethernet0/0/2
 port link-type access
 port default vlan 3

PC3 接入端口 (VLAN3 生产区)
interface Ethernet0/0/3
 port link-type access
 port default vlan 3

上联防火墙接口 (Trunk)
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 3

lsw2(dmz)


vlan batch 10   创建VLAN

OA  接入端口
interface Ethernet0/0/1
 port link-type access
 port default vlan 10

Web 接入端口
interface Ethernet0/0/2
 port link-type access
 port default vlan 10

上联防火墙接口 (Access)
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10

 接口IP配置(Web界面或命令行)


int g0/0/0
 ip address 192.168.1.126 255.255.255.0
 service-manage enable
 service-manage https permit   
 service-manage ping permit
 

in g1/0/1
 ip address 192.168.1.254 255.255.255.0
 

int g1/0/2
 ip address 10.0.0.254 255.255.255.0

(忘截图了)
 

增加安全区域


firewall zone trust
 add interface GigabitEthernet1/0/1
 

firewall zone dmz
 add interface GigabitEthernet1/0/2
 

firewall zone untrust
 add interface GigabitEthernet0/0/0

 配置安全策略


办公区(PC1) 工作时间访问OA Server


time-range work-time 08:00:00 to 18:00:00 working-day

security-policy
 rule name Office_to_OA_worktime
  source-zone trust
  destination-zone dmz
  source-address 192.168.1.1 mask 255.255.255.255
  destination-address 10.0.0.1 mask 255.255.255.255
  time-range work-time
  action permit


办公区(PC1) 任意时间访问Web Server


 rule name Office_to_Web_anytime
  source-zone trust
  destination-zone dmz
  source-address 192.168.1.1 mask 255.255.255.255
  destination-address 10.0.0.2 mask 255.255.255.255
  action permit


生产区(PC2/PC3) 任意时间访问OA Server


 rule name Production_to_OA
  source-zone trust
  destination-zone dmz
  source-address 192.168.1.129 mask 255.255.255.255
  source-address 192.168.1.130 mask 255.255.255.255
  destination-address 10.0.0.1 mask 255.255.255.255
  action permit


生产区默认禁止访问Web Server



 rule name Production_to_Web_deny
  source-zone trust
  destination-zone dmz
  source-address 192.168.1.128 mask 255.255.255.128
  destination-address 10.0.0.2 mask 255.255.255.255
  action deny


特例 PC3 周一 10:00-11:00 访问Web Server


time-range special-time 10:00 to 11:00 Mon

 rule name PC3_Web_special
  source-zone trust
  destination-zone dmz
  source-address 192.168.1.130 mask 255.255.255.255
  destination-address 10.0.0.2 mask 255.255.255.255
  time-range special-time
  action permit



四.结果测试

办公区工作时间访问OAPC1 ping 10.0.0.1通

办公区任意时间访问WebPC1 ping 10.0.0.2通

生产区访问OAPC2 ping 10.0.0.1通

生产区访问WebPC2 ping 10.0.0.2不通

Logo

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。

更多推荐