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策略

相关内容

热门资讯

北京三位女大学生青海自驾游两死... 2024年7月,三位北京女大学生(小静、小田、小露)在青海省海西蒙古族藏族自治州德令哈市附近自驾游时...
德意燃气灶点着火后过几分钟熄火... 回答在:可能原因是熄火保护感应针故障、溢锅造成熄火、清洁炉头上的火盖未摆正,针对这几种问题,分别解决...
德意燃气灶打不着火什么原因 主要原因有,1、很大原因是电池没有电造成的。2、也有可能是由于点火针的位置不正,离内焰火盖距离比较远...
燃气热水器感应针是什么材质 燃气热水器燃烧室上面都有白色的磁棒,这是感应针。是热水器熄火保护最前端的一个部件,当火焰烧到感应针的...
燃气热水器感应针好坏判断 一般来说燃气热水器都有一个电板,当感应针出现故障的时候,都会显示相应的代码,通常感应针故障代码为E1...
热水器感应针位置 1、燃气热水器感应针的作用就是感应火焰是否正常燃烧,不燃烧时测量对地电阻大概在4M左右,当燃气燃烧时...
绿营利用台北鼠患制造恐慌,徐巧... 台北市近期爆发鼠患议题,引来绿营猛攻。中国国民党籍台北市长蒋万安5日召开记者会,宣布将派遣“鼠类侦防...
王世坚因称赞蒋万安被骂,蒋力挺... 据台湾联合新闻网、TVBS新闻网等台媒报道,民进党“立委”王世坚日前称赞台北市长蒋万安“心胸宽大、处...
全美汽油均价较伊朗战事前上涨5... 新华社北京5月7日电 美国汽车协会5日发布数据说,美国普通汽油当天平均零售价为每加仑4.48美元,较...
中国经济数据观丨十组数据看假日... 设计:穆问春文案:底东娜来源:交通运输部、商务部、文化和旅游部、公安部、国家移民管理局等