一、实验拓扑:
二、实验要求:
1、只允许在工作日的09:00-18:00期间,放行Outside访问Inside的FTP流量;
2、ASA上:show access-list,查看时间如果超过范围,是否有inactive提示?
3、ASA只匹配一次,就会记录这种源目IP、端口等的映射,放在状态信息的表项里边去;比如R1远程登录R2经过ASA,第一次是1,进去后enable等操作,该数值不变的;
如果退出再重新登录的话,就会增加数值的;节省ASA的资源;
路由器的话,每匹配一次,数目就会+1;比如ACL放行Ping包,Ping 1次,这里是1,Ping 5次这里就会显示5。
三、命令部署:
1、定义时间范围:
ASA(config)# time-range abc
ASA(config-time-range)# periodic weekdays 9:00 to 18:00
2、ACL抓取流量并应用time-range:
ASA(config)#access-list name extended permit tcp 202.100.1.0 255.255.255.0 10.1.1.0 255.255.255.0 eq ftp time-range abc
3、接口下调用ACL:
ASA(config)# access-group name in interface outside
4、调整时区、时间:
ASA(config)# clock timezone beijing +8 //调整时区
ASA(config)# clock set 16:09:00 2 june 2018 //调整时间
四、验证:
1、ASA:show access-list:
ASA# show access-list
access-list cached ACL log flows: total 0, denied 0 (deny-flow-max 4096)
alert-interval 300
access-list name; 1 elements; name hash: 0x72262761
access-list name line 1 extended permit tcp 202.100.1.0 255.255.255.0 10.1.1.0 255.255.255.0 eq ftp time-range abc (hitcnt=0) 0x15877aab
2、查看时间:
ASA# show clock
16:05:46.929 UTC Tue May 29 2018
3、调整时区、时间后查看:
ASA(config)# show clock
16:09:28.149 beijing Sat Jun 2 2018
4、调整时间后查看ACL:
ASA(config)# show access-list
access-list cached ACL log flows: total 0, denied 0 (deny-flow-max 4096)
alert-interval 300
access-list name; 1 elements; name hash: 0x72262761
access-list name line 1 extended permit tcp 202.100.1.0 255.255.255.0 10.1.1.0 255.255.255.0 eq ftp time-range abc (hitcnt=0) (inactive) 0x15877aab
R1依然不能远程登录R2,部分效果依然出不来,先放过吧!
转载于:https://blog.51cto.com/13856092/2138570