ACL典型配置案列

ACL典型配置案列


一、组网需求

      要求1:某公司内的各部门之间通过Device A实现互连,该公司的工作时间为每周工作日的8点到18点。

      要求2 :  通过配置,允许总裁办在任意时间、财务部在工作时间访问财务数据库服务器,禁止其它部门在任何时间、财务部在非工作时间访问该服务器。

二、组网图



ACL典型配置组网图

三、配置步骤

# 创建名为work的时间段,其时间范围为每周工作日的8点到18点。

<DeviceA> system-view

[DeviceA] time-range work 08:0 to 18:00 working-day

# 创建IPv4高级ACL 3000,并制订如下规则:允许总裁办在任意时间、财务部在工作时间访问财务数据库服务器,禁止其它部门在任何时间、财务部在非工作时间访问该服务器。

[DeviceA] acl number 3000

[DeviceA-acl-adv-3000] rule permit ip source 192.168.1.0 0.0.0.255 destination 192.168.0.100 0

[DeviceA-acl-adv-3000] rule permit ip source 192.168.2.0 0.0.0.255 destination 192.168.0.100 0 time-range work

[DeviceA-acl-adv-3000] rule deny ip source any destination 192.168.0.100 0

[DeviceA-acl-adv-3000] quit

# 应用IPv4高级ACL 3000对接口GigabitEthernet1/0/1出方向上的报文进行过滤。

[DeviceA] interface gigabitethernet 1/0/1

[DeviceA-GigabitEthernet1/0/1] packet-filter 3000 outbound

[DeviceA-GigabitEthernet1/0/1] quit

四、 验证配置

配置完成后,在各部门的PC(假设均为Windows XP操作系统)上可以使用ping命令检验配置效果,在Device A上可以使用display acl命令查看ACL的配置和运行情况。例如在工作时间:

# 在财务部的PC上检查到财务数据库服务器是否可达。

C:\> ping 192.168.0.100

Pinging 192.168.0.100 with 32 bytes of data:

Reply from 192.168.0.100: bytes=32 time=1ms TTL=255

Reply from 192.168.0.100: bytes=32 time<1ms TTL=255

Reply from 192.168.0.100: bytes=32 time<1ms TTL=255

Reply from 192.168.0.100: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.0.100:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

    Minimum = 0ms, Maximum = 1ms, Average = 0ms

由此可见,财务部的PC能够在工作时间访问财务数据库服务器。

# 在市场部的PC上检查财务数据库服务器是否可达。

C:\> ping 192.168.0.100

Pinging 192.168.0.100 with 32 bytes of data:

Request timed out.

Request timed out.

Request timed out.

Request timed out.

Ping statistics for 192.168.0.100:

    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

由此可见,市场部的PC不能在工作时间访问财务数据库服务器。

# 查看IPv4高级ACL 3000的配置和运行情况。

[DeviceA] display acl 3000

Advanced ACL  3000, named -none-, 3 rules,

ACL's step is 5

rule 0 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.0.100 0

rule 5 permit ip source 192.168.2.0 0.0.0.255 destination 192.168.0.100 0 time-range work (Active)

rule 10 deny ip destination 192.168.0.100 0

由此可见,由于目前是工作时间,因此规则5是生效的。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容