【锐捷网络】基于时间的访问控制列表实验
实验名称 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

基于时间的访问控制列表

 

实验目的

       掌握基于时间段进行控制的 IP 访问列表配置。

 

背景描述

    某公司经理最近发现,有些员工在上班时间经常上网浏览与工作无关的网站,影响了工作,因此他通知网络管理员,在网络上进行设置,在上班时间只允许浏览与工作相关的几个网站,禁止访问其它网站。
    本实验以 1 S<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />2126G 交换机和 1 R2624 路由器为例。 PC 机的 IP 地址和缺省网关分别为 172.16.1.1/24 172.16.1.2/24 ,服务器 (Server) IP 地址和缺省网关分别为 160.16.1.1/24 160.16.1.2/24 ,路由器的接口 F0 F1 IP 地址分别为 172.16.1.2/24 160.16.1.2/24

 

实现功能

       基于时间对网络访问进行控制,提高网络的使用效率和安全性。

 

实验拓扑
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /> 
实验设备

    S2126G 1 台)、 R2624(1 )

 

实验步骤

 

第一步: 在路由器上定义基于时间的访问控制列表
Router(config)#access-list 100 permit ip any host 160.16.1.1      !定义扩展访问列表,允许访问主机 160.16.1.1
Router(config)#access-list 100 permit ip any any time-range t1  ! 关联 time-range 接口 t1 ,允许在规定时间段访问任何网络

 

Router(config)#time-range t1     !定义 time-range 接口 t1 ,即定义时间段
Router(config- time-range)#absolute start 8:00 1 oct 2004 end 18:00 30 dec 2020     !定义绝对时间
Router(config- time-range)#periodic daily 0:00 to 8:00    ! 定义周期性时间段(非上班时间)
Router(config- time-range)#periodic daily 17:00 to 23:59

 

验证测试: 验证访问列表和 time-range 接口配置
Router# show access-lists           !显示所有访问列表配置
Extended IP access list 100
    permit ip any host 160.16.1.1
    permit ip any any

 

Router#show time-range      ! 显示 time-range 接口配置
time-range entry:t1
   absolute start 08:00 1 October 2004 end 18:00 30 December 2020
   periodic daily 00:00 to 08:00
   periodic daily 17:00 to 23:59

 

第二步: 在接口上应用访问列表
Router(config)# interface fastethernet 1     ! 进入接口 F1 配置模式
Router(config-if)# ip access-group 100 out    ! 在接口 F1 的出方向上应用访问列表 100

 

验证测试: 验证接口上应用的访问列表
Router#show ip interface fastEthernet 1
FastEthernet1 is up, line protocol is up
  Internet address is 160.16.1.2/24
  Broadcast address is 255.255.255.255
  Address determined by setup command
  MTU is 1500 bytes
  Helper address is not set
  Directed broadcast forwarding is disabled
  Outgoing access list is 100          !显示在出口上应用了访问列表 100
  Inbound  access list is not set
  Proxy ARP is enabled
  Security level is default
  Split horizon is enabled
  ICMP redirects are always sent
  ICMP unreachables are always sent
  ICMP mask replies are never sent
  IP fast switching is enabled
  IP fast switching on the same interface is disabled
  IP multicast fast switching is enabled
  Router Discovery is disabled
  IP output packet accounting is disabled
  IP access violation accounting is disabled
  TCP/IP header compression is disabled
  Policy routing is disabled