基于时间的acl实验

拓扑图如下(学号26):

 

 

配置静态路由:

R1(config)#int f0/0

R1(config-if)#ip address 10.26.1.1 255.255.255.0

R1(config-if)#no shutdown

R1(config)#int f0/1

R1(config-if)#ip address 14.26.2.1 255.255.255.0

R1(config-if)#no shutdown

 

R4(config)#ip route 10.26.1.0 255.255.255.0 14.26.2.1

R3(config)#ip route 14.26.2.0 255.255.255.0 10.26.1.1

R2(config)#ip route 14.26.2.0 255.255.255.0 10.26.1.1

 

测试网络是否Ping通:

R2pingR4

 

 

R1pingR4

 

 

R3pingR2

 

 

R4pingR2

基于时间的acl

R1(config)#time-range  TELNET

R1(config-time-range)#periodic weekdays 9:00 to 14:00

R1(config)#access-list 150 deny tcp host 10.26.1.2 any eq 23 time TELNET

 R1(config)#$ 150 deny tcp host 10.26.1.2 any eq 23 time-range TELNET

R1(config)#access-list 150 permit ip any any

R1(config)#int f0/0

R1(config-if)#ip access-group 150 in

查看路由器时间

 

 

测试R2R4发起telnet会话

r2#telnet 14.26.2.4

Trying 14.26.2.4 ...

% Destination unreachable; gateway or host down

r2#

说明:可以看到,在规定的时间范围内,R2R4发起telnet会话是被拒绝的。

测试除telnet外的其它流量

r2#ping 14.26.2.4

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 14.26.2.4, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

r2#

说明:可以看到,在规定的时间范围内,除了telnet之外,其它流量不受限制

 

 

查看当前R1的时间

r1#sh clock

 

 

测试R2R4发起telnet会话

r2#telnet 14.26.2.4

Trying 14.26.2.4 ... Open

r4>

说明:在时间范围之外,所限制的流量被放开。

 

 

posted @ 2019-05-26 18:09  yuesx  阅读(169)  评论(2编辑  收藏  举报