ACL访问控制列表的配置

实验目的:

理解ACL的工作原理

掌握ACL的配置

对比标准ACL和扩展ACL的区别

实验环境拓扑图及要求:

实验拓扑:

 

image

说明:

1、虚拟PC2用桥接PC模拟

2、因桥接到真实网络,建议内部地址重新自主设置

3、测试server用路由器模拟

4、测试server上开启http服务和telnet服务

要求:

1、 全网互通

RA:

en

conf t

host RA

no ip domain-lo

int f1/0

ip add 192.168.10.1 255.255.255.0

no sh

exit

int f0/0

ip add 172.16.20.1 255.255.255.0

no sh

end

-----------------------------------------------

server:

en

conf t

host server

no ip domain-lo

int f0/0

ip add 172.16.20.2 255.255.255.0 //配置IP

no sh

exit

line vty 0 4 //激活telnet

password cisco

login

enable password bt0901jl //配置密码

ip route 0.0.0.0 0.0.0.0 172.16.20.1 //配置默认路由

end

-----------------------------------------------

SW1:

en

conf t

no ip domain-lo

no ip routing //禁用路由功能

host SW1

int vlan 1

ip add 192.168.10.11 255.255.255.0 //配置vlan1的IP地址

no sh

exit

ip default-gateway 192.168.10.1 //配置网关

end

clip_image002 clip_image004 clip_image006 clip_image008 clip_image010 clip_image012

2、 测试server上开启http服务和telnet服务

clip_image014 clip_image016 clip_image018 clip_image020

3、 禁止PC1访问外部网络,PC2能正常访问外部网络。提示:标准ACL实现。

RA:

conf t

access-list 1 deny host 192.168.10.11

access-list 1 permit any

int f1/0

ip access-group 1 in

end

clip_image022 clip_image024

删除

RA:

conf t

no access-list 1 deny host 192.168.10.11

no access-list 1 permit any

int f1/0

no ip access-group 1 in

end

clip_image026 clip_image028

4、 禁止PC1访问测试server的telnet服务,能ping通。提示:扩展ACL实现,记得删除之前ACL。

RA:

conf t

access-list 101 deny tcp host 192.168.10.11 host 172.16.20.2 eq 23 //禁止TCP的23端口

access-list 101 permit ip any any

int f1/0

ip access-group 101 in

end

clip_image030 clip_image032 clip_image034

删除

RA:

conf t

no access-list 101 deny tcp host 192.168.10.11 host 172.16.20.2 eq 23

no access-list 101 permit ip any any

end

clip_image036

5、 禁止PC2访问测试server的http服务,能访问测试server的telnet服务。提示:扩展ACL实现。提示:扩展ACL实现,记得删除之前ACL。

RA:

conf t

access-list 101 deny tcp host 192.168.10.12 host 172.16.20.2 eq 80 //禁止tcp 的80端口

access-list 101 permit ip any any

int f1/0

ip access-group 101 in

end

clip_image038

clip_image040 clip_image042

删除掉

RA:

conf t

no access-list 101 deny tcp host 192.168.10.12 host 172.16.20.2 eq 80

no access-list 101 permit ip any any

end

clip_image044 clip_image046

6、 禁止PC2访问ping通测试server,但能够通过HTTP和telnet访问测试server,记得删除之前ACL。

RA:

conf t

access-list 101 deny icmp host 192.168.10.12 host 172.16.20.2 echo //禁止ICMP请求

access-list 101 permit ip any any //允许其它所有

int f1/0

ip access-group 101 in

end

clip_image048

clip_image050 clip_image052 clip_image054

删除掉。

RA:

conf t

no access-list 101 deny icmp host 192.168.10.12 host 172.16.20.2 echo

no access-list 101 permit ip any any

end

clip_image056

7、 用命名ACL实现要求3、4、5。

RA:

conf t

ip access-list standard cisco

deny host 192.168.10.11

permit any

ip access-list extended xiaj

deny tcp host 192.168.10.11 host 172.16.20.2 eq 23

permit ip any any

ip access-list extended bt0901

deny tcp host 192.168.10.12 host 172.16.20.2 eq 80

permit ip any any

clip_image058

RA:

Conf t

int f1/0

ip access-group cisco in

end

clip_image060clip_image062

在接口上删除cisco,测试。!

RA:

Conf t

Int f1/0

no ip access

no ip access-group cisco in

end

clip_image064

在接口上应用bt0901,测试。

RA:

Conf t

int f1/0

ip access-group bt0901 in

end

clip_image066 clip_image068 clip_image070

在接口上删除bt0901,测试…

RA:

conf t

int f1/0

no ip access-group bt0901 in

end

clip_image072

在接口上应用xiaj,测试

RA:

conf t

int f1/0

ip access-group xiaj in

end

clip_image074

在接口上删除xiaj,测试

RA:

conf t

int f1/0

no access-group xiaj in

end

clip_image076

你可能感兴趣的:(职场,acl,列表,访问,休闲)