ACL中命名访问控制列表是怎样的
admin
2023-02-27 13:01:53
0

实验拓扑图及实验要求

ACL中命名访问控制列表是怎样的

实验步骤:

一、配置sw交换机

conf t                //进入全局模式,设定vlan10 和20
vlan 10,20
ex
do show vlan-sw b      //查看vlan信息

VLAN Name                             Status    
10   VLAN0010                         active    
20   VLAN0020                         active    

int range fa1/1 -2          //进入端口fa1/1和1/2 接口,将端口划入vlan10
sw mo acc
sw acc vlan 10
ex
do show vlan-sw b       //查看vlan信息

VLAN Name                             Status    Ports
10   VLAN0010                         active    Fa1/1, Fa1/2
20   VLAN0020                         active    

int f1/3                //进入端口f1/3,将端口划入vlan20 
sw mo acc
sw acc vlan 20
ex
do show vlan-sw b

VLAN Name                             Status    Ports
10   VLAN0010                         active    Fa1/1, Fa1/2
20   VLAN0020                         active    Fa1/3

int f1/0          //进入端口f1/0,配置trunk链路
sw mo t
sw t en dot1q
ex
no ip routing          //关闭路由功能

二、配置sw-3三层交换机

conf t
no switchport                //关闭交换功能
int f1/1
ip add 192.168.100.1 255.255.255.0
no shut
ex
vlan 10,20
ex
int vlan 10
ip add 192.168.10.1 255.255.255.0
no shut
ex
int vlan 20
ip add 192.168.20.1 255.255.255.0
no shut
ex
do show ip int b        //查看vlan信息

FastEthernet1/1            192.168.100.1   YES manual up                    up 
Vlan10                     192.168.10.1    YES manual up                    down    
Vlan20                     192.168.20.1    YES manual up                    down

int f1/0                   //进入端口f1/0配置trunk链路
sw mo t
sw t en dot1q
do show ip route        //查看路由表

C    192.168.10.0/24 is directly connected, Vlan10
C    192.168.20.0/24 is directly connected, Vlan20
C    192.168.100.0/24 is directly connected, FastEthernet1/1

三、配置客户机ip地址,并测试全网互通性

1、配置客户机ip地址

PC1> ip 192.168.100.100 192.168.100.1
Checking for duplicate address...
PC1 : 192.168.100.100 255.255.255.0 gateway 192.168.100.1

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

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

PC4> ip 192.168.20.20 192.168.20.1
Checking for duplicate address...
PC1 : 192.168.20.20 255.255.255.0 gateway 192.168.20.1

2、测试全网互通性


四、配置命名acl、策略

在sw-3交换机上进行配置,全局模式下

ip access-list standard yun          //设定模式以及命名名称,standard为标准命名ACL,extended为扩展命名ACL
permit host 192.168.10.10            //设定允许访问主机ip的条目
deny 192.168.10.0 0.0.0.255        //设定拒绝的网段条目
permit any                                    //设顶允许其他所有主机访问
ex
do show access-list                   //查看访问列表清单

Standard IP access list yun
    10 permit 192.168.10.10
    20 deny   192.168.10.0, wildcard bits 0.0.0.255
    30 permit any
    
int f1/1                                       //进入端口f1/1,将ACL应用与此出方向
ip access-group yun out

五、测试acl效果

1、测试vlan10中的主机2与主机1的互通性

PC2> ping 192.168.100.100
192.168.100.100 icmp_seq=1 timeout
192.168.100.100 icmp_seq=2 timeout
84 bytes from 192.168.100.100 icmp_seq=3 ttl=63 time=15.953 ms
84 bytes from 192.168.100.100 icmp_seq=4 ttl=63 time=19.232 ms
84 bytes from 192.168.100.100 icmp_seq=5 ttl=63 time=19.049 ms

2、测试主机4与主机1的互通性

PC4> ping 192.168.100.100
84 bytes from 192.168.100.100 icmp_seq=1 ttl=63 time=20.226 ms
84 bytes from 192.168.100.100 icmp_seq=2 ttl=63 time=18.953 ms
84 bytes from 192.168.100.100 icmp_seq=3 ttl=63 time=18.208 ms
84 bytes from 192.168.100.100 icmp_seq=4 ttl=63 time=17.023 ms
84 bytes from 192.168.100.100 icmp_seq=5 ttl=63 time=12.985 ms

3、测试vlan10中的其他主机与主机1的互通性

PC3> ping 192.168.100.100
*192.168.10.1 icmp_seq=1 ttl=255 time=8.907 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=2 ttl=255 time=3.775 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=3 ttl=255 time=7.979 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=4 ttl=255 time=5.965 ms (ICMP type:3, code:13, Communication administratively prohibited)
*192.168.10.1 icmp_seq=5 ttl=255 time=1.992 ms (ICMP type:3, code:13, Communication administratively prohibited)

命名访问控制列表可灵活的调整策略前提是在标准访问列表以及扩展访问列表的基础上,可以使用no+ACL号删除策略.也可以使用ACL号+permittip追加ACL策略

相关内容

热门资讯

最新引进“十胡卡.真的有挂吗?... 最新引进“十胡卡.真的有挂吗?”确实真的有挂您好,十胡卡这个游戏其实有挂的,确实是有挂的,需要了解加...
终于懂了“同城游跑胡子.怎么开... 网上科普关于“同城游跑胡子有没有挂”话题很是火热,小编也是针对同城游跑胡子作*弊开挂的方法以及开挂对...
【第一消息】“微乐海南麻将.辅... 家人们!今天小编来为大家解答微乐海南麻将透视挂怎么安装这个问题咨询软件客服徽9784099的挂在哪里...
降低家庭养育成本,中国拟对托育... 12月22日,托育服务法草案提请十四届全国人大常委会第十九次会议首次审议。草案共8章76条,包括总则...
我来教教您“哪吒重生.开挂器?... 有 亲,根据资深记者爆料哪吒重生是可以开挂的,确实有挂(咨询软件无需打开...
俄称普京愿与马克龙展开对话,法... 【环球网报道】据美国政治新闻网站(Politico)等外媒报道,俄总统新闻秘书、克宫发言人佩斯科夫当...
【第一资讯】“丽水都莱.怎么开... 您好:丽水都莱这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9752949】很多玩家在这款游戏...
【第一资讯】“人海牛牛.可以开... 网上科普关于“人海牛牛有没有挂”话题很是火热,小编也是针对人海牛牛作*弊开挂的方法以及开挂对应的知识...
终于懂了“乐暴延边麻将.开挂器... 家人们!今天小编来为大家解答乐暴延边麻将透视挂怎么安装这个问题咨询软件客服徽4282891的挂在哪里...
今日重大发现“白金岛红拐弯.开... 您好:白金岛红拐弯这款游戏可以开挂,确实是有挂的,需要了解加客服微信【9752949】很多玩家在这款...