---恢复内容开始---
扩展acl
(1)拓扑图
地址规划(本人学号后三位为056)
设备 |
接口 |
地址 |
网关 |
R1 |
S0/0/0 F0/0 F0/1 |
10.56.12.1 10.56.1.1 10.56.2.1 |
|
R2 |
S0/0/0 S0/0/1 |
10.56.12.2 10.56.23.2 |
|
R3 |
S0/0/1 F0/0 |
10.56.23.3 10.56.3.1 |
|
PC1 |
Fa0 |
10.56.1.100 |
10.56.1.1 |
PC2 |
Fa0 |
10.56.2.100 |
10.56.2.1 |
Server0 |
Fa0 |
10.56.3.100 |
10.56.3.1 |
预配置
设置接口地址
配置静态路由
静态路由配置如下:
R1(config)#ip route 10.56.23.0 255.255.255.0 10.56.12.2
R1(config)#ip route 10.56.3.0 255.255.255.0 10.56.12.2
R2(config)#ip route 10.56.3.0 255.255.255.0 10.56.23.3
R2(config)#ip route 10.56.1.0 255.255.255.0 10.56.12.1
R2(config)#ip route 10.56.2.0 255.255.255.0 10.56.12.1
R3(config)#ip route 10.56.12.0 255.255.255.0 10.56.23.2
R3(config)#ip route 10.56.2.0 255.255.255.0 10.56.23.2
R3(config)#ip route 10.56.1.0 255.255.255.0 10.56.23.2
检验是否做通
PC1ping server
扩展acl配置
R1(config)#access-list 110 remark this is an example for extended acl
R1(config)#access-list 110 deny tcp 10.56.1.0 0.0.0.255 host 10.56.3.100 eq 80
//拒绝PC1 所在网段访问Server 10.56.3.100 的Web 服务
R1(config)#access-list 110 deny tcp 10.56.2.0 0.0.0.255 host 10.56.3.100 eq 21
R1(config)#access-list 110 deny tcp 10.56.2.0 0.0.0.255 host 10.56.3.100 eq 20
//拒绝PC2 所在网段访问Server 10.56.3.100 的Ftp 服务
R1(config)#access-list 110 deny tcp 10.56.1.0 0.0.0.255 host 10.56.3.100 eq 1433
//拒绝PC1 所在网段访问Server 10.56.3.100 的SQL 服务
R1(config)#access-list 110 deny tcp 10.56.1.0 0.0.0.255 host 10.56.23.3 eq 23
R1(config)#access-list 110 deny tcp 10.56.1.0 0.0.0.255 host 10.56.3.3 eq 23
//拒绝PC1 所在网段访问路由器R3 的Telnet 服务
R1(config)#access-list 110 deny tcp 10.56.2.0 0.0.0.255 host 10.56.12.2 eq 80
R1(config)#access-list 110 deny tcp 10.56.2.0 0.0.0.255 host 10.56.23.2 eq 80
//拒绝PC2 所在网段访问路由器R2 的Web 服务
R1(config)#access-list 110 deny icmp 10.56.1.0 0.0.0.255 host 10.56.3.100
R1(config)#access-list 110 deny icmp 10.56.2.0 0.0.0.255 host 10.56.3.100
//拒绝PC1 和PC2 所在网段ping Server 服务器
R1(config)#access-list 110 permit ip any any
R1(config)#int s0/0/0
R1(config-if)#ip access-group 110 out
//接口下应用ACL
配置路由器R3
R3(config)#access-list 120 deny icmp host 10.56.23.2 host 10.56.23.3 echo
R3(config)#access-list 120 permit ip any any
R3(config)#int s0/0/1
R3(config-if)#ip access-group 120 in
实验调试
(一)路由器R1 上查看ACL110
(二)路由器R3 和路由器R2 互相ping
R2#ping 10.56.23.3
路由器R3 查看ACL 120
(三)配置命令扩展ACL
R3(config)#ip access-list extended ac1120
R3(config-ext-nacl)#deny icmp host 10.56.23.2 host 10.56.23.3 echo
R3(config-ext-nacl)#permit ip any any
R3(config-ext-nacl)#int s0/0/1
R3(config-if)#ip access-group ac1120 in
检验