标准ACL配置小实验走起
admin
2023-03-04 07:02:50
0

实验要求

在R1路由上建立标准ACL,实现仅允许PC1能访问PC3,禁止PC2对PC3进行访问的功能。

标准ACL配置小实验走起

具体配置

1、配置三台pc机地址、网关

PC1> ip 192.168.10.2 192.168.10.1
Checking for duplicate address...
PC1 : 192.168.10.2 255.255.255.0 gateway 192.168.10.1

PC2> ip 192.168.10.3 192.168.10.1 
Checking for duplicate address...
PC1 : 192.168.10.3 255.255.255.0 gateway 192.168.10.1

PC3> 
PC3> ip 192.168.20.2 192.168.20.1
Checking for duplicate address...
PC1 : 192.168.20.2 255.255.255.0 gateway 192.168.20.1

2、配置交换机sw

sw#conf t 
sw(config)#no ip routing

3、配置路由两端地址、子掩

R1#conf t
R1(config)#int f0/0
R1(config-if)#ip add 192.168.10.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int f0/1
R1(config-if)#ip add 192.168.20.1 255.255.255.0
R1(config-if)#no shut

4、测试三台pc连通性,可以互联互通

PC1> ping 192.168.20.2           
192.168.20.2 icmp_seq=1 timeout
84 bytes from 192.168.20.2 icmp_seq=2 ttl=63 time=15.676 ms
84 bytes from 192.168.20.2 icmp_seq=3 ttl=63 time=17.680 ms
84 bytes from 192.168.20.2 icmp_seq=4 ttl=63 time=21.956 ms
84 bytes from 192.168.20.2 icmp_seq=5 ttl=63 time=12.700 ms

PC1> ping 192.168.10.3
192.168.20.2 icmp_seq=1 timeout
192.168.20.2 icmp_seq=2 timeout
84 bytes from 192.168.10.3 icmp_seq=3 ttl=63 time=17.735 ms
84 bytes from 192.168.10.3 icmp_seq=4 ttl=63 time=14.069 ms
84 bytes from 192.168.10.3 icmp_seq=5 ttl=63 time=14.960 ms

5、在路由上定义ACL语句

R1(config-if)#access-list 1 deny host 192.168.10.2    #禁止pc2主机地址
R1(config)#do show access-list
R1(config)#access-list 1 permit any     #不写则默认拒绝所有
R1(config)#int f0/0
R1(config-if)#ip access-group 1 in     #ACL应用在接口f0/0,定义为入口

6、此时用pc1访问pc3

PC1> ping 192.168.20.2
*192.168.10.1 icmp_seq=1 ttl=255 time=20.233 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=2 ttl=255 time=4.913 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=3 ttl=255 time=12.927 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=4 ttl=255 time=12.965 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=5 ttl=255 time=13.958 ms (ICMP type:3, code:13, Communication administratively prohibited)

7、PC1可以ping通PC2

PC1>ping 192.168.10.3
84 bytes from 192.168.10.3 icmp_seq=1 ttl=64 time=0.000 ms
84 bytes from 192.168.10.3 icmp_seq=2 ttl=64 time=0.975 ms
84 bytes from 192.168.10.3 icmp_seq=3 ttl=64 time=0.997 ms
84 bytes from 192.168.10.3 icmp_seq=4 ttl=64 time=0.000 ms
84 bytes from 192.168.10.3 icmp_seq=5 ttl=64 time=1.731 ms

小型标准ACL配置实验成功

相关内容

热门资讯

终于明白“皮皮跑胡子.到底是不... 家人们!今天小编来为大家解答皮皮跑胡子透视挂怎么安装这个问题咨询软件客服徽9752949的挂在哪里买...
【第一消息】“麦穗app推筒子... 您好:麦穗app推筒子这款游戏可以开挂,确实是有挂的,需要了解加客服微信【4282891】很多玩家在...
玩家攻略科普“兴动棋牌麻将.有... 玩家攻略科普“兴动棋牌麻将.有没有挂?”外卦神器下载您好,兴动棋牌麻将这个游戏其实有挂的,确实是有挂...
玩家攻略科普“人海牛牛.真的有... 有 亲,根据资深记者爆料人海牛牛是可以开挂的,确实有挂(咨询软件无需打开...
重磅消息“八闽状元郎.辅助器?... 有 亲,根据资深记者爆料八闽状元郎是可以开挂的,确实有挂(咨询软件无需打...
玩家最新攻略“约约麻将.可以开... 您好:约约麻将这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9784099】很多玩家在这款游戏...
玩家攻略科普“九酷牛牛.究竟有... 玩家攻略科普“九酷牛牛.究竟有挂吗?”原来真的有挂您好,九酷牛牛这个游戏其实有挂的,确实是有挂的,需...
今日重大通报“老表逗娱碰胡.辅... 您好:老表逗娱碰胡这款游戏可以开挂,确实是有挂的,需要了解加客服微信【4282891】很多玩家在这款...
【第一财经】“大金牙麻将.有没... 有 亲,根据资深记者爆料大金牙麻将是可以开挂的,确实有挂(咨询软件无需打...
玩家最新攻略“蜀山四川麻将.有... 您好:蜀山四川麻将这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9784099】很多玩家在这款...