【銳捷網絡】基於時間的訪問控制列表實驗
【實驗名稱】
基於時間的訪問控制列表
【實驗目的】
掌握基於時間段進行控制的IP訪問列表配置。
【背景描述】
某公司經理最近發現,有些員工在上班時間經常上網瀏覽與工作無關的網站,影響了工作,因此他通知網絡管理員,在網絡上進行設置,在上班時間只允許瀏覽與工作相關的幾個網站,禁止訪問其它網站。
本實驗以1臺S2126G 交換機和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 。
【實現功能】
基於時間對網絡訪問進行控制,提高網絡的使用效率和安全性。
【實驗拓撲】
【實驗設備】
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
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