第八章---ACL技术
一、实验拓扑
二、实验需求
1、给各设备配置IP
2、达到全网通
3、pc1可以访问telnet R1,不能ping R1
pc1不能访问telnet R2,可以ping R2
pc2不可以访问telnet R1,能ping r1
pc2能访问telnet R2,不能ping R2
三、实验步骤
1、配置ip
[pc1]int g0/0/0
[pc1-g0/0/0]ip add 192.168.1.10 24
[pc1]ip route-static 0.0.0.0 0 192.168.1.254
[pc2]int g0/0/0
[pc2-g0/0/0]ip add 192.168.1.11
[pc2]ip route-static 0.0.0.0 0 192.168.1.254
[r1]int g0/0/0
[r1-g0/0/0]ip add 192.168.1.254
[r1]int g0/0/1
[r1-g0/0/1]ip add 192.168.2.1
[r2]int g0/0/0
[r2-g0/0/0]ip add 192.168.2.2
2、达到全网通
此时R1与所有网段直连,只需要在R2上配置缺省
[r2]ip route-static 192.168.1.0 24 192.168.2.1
此时已经全网通
3、配置telnet协议
[r1]aaa
[r1-aaa]local-user yx privilege level 15 password cipher yx520
[r1-aaa]local-user yx service-type telnet
[r1-aaa]quit
[r1]user-int vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
[r1-ui-vty0-4]q
[r2]aaa
[r2-aaa]local-user qgk privilege level 15 password cipher qgk520
[r2-aaa]local-user qgk service-type telnet
[r2-aaa]quit
[r2]user-int vty 0 4
[r2-ui-vty0-4]authentication-mode aaa
[r2-ui-vty0-4]q
此时可以实现远程登陆
配置访问控制列表
pc1可以访问telnet R1,不能ping R1
[r1]acl 3000
[r1-acl-adv-3000]rule deny icmp source 192.168.1.10 0.0.0.0 destination 192.168.1.254 0.0.0.0
[r1-acl-adv-3000]rule deny icmp source 192.168.1.10 0.0.0.0 destination 192.168.2.1 0.0.0.0
pc1不能访问telnet R2,可以ping R2
[r1-acl-adv-3000]rule deny telnet source 192.168.1.10 0.0.0.0 destination 192.168.2.2 0.0.0.0 destination-port eq 23
pc2不可以访问telnet R1,能ping r1
[r1-acl-adv-3000]rule deny telnet source 192.168.1.11 0.0.0.0 destination 192.168.1.254 0.0.0.0 destination-port eq 23
[r1-acl-adv-3000]rule deny telnet source 192.168.1.11 0.0.0.0 destination 192.168.2.2 0.0.0.0 destination-port eq 23
pc2能访问telnet R2,不能ping R2
[r1-acl-adv-3000]rule deny icmp source 192.168.1.11 0.0.0.0 destination 192.168.2.2 0.0.0.0
[r1]dis this---查看写了多少规则
此时要下放规则
[r1]int g0/0/0
[r1-g0/0/0]traffic-filter inbound acl 3000---从入接口下放规则
此时pc1能访问telnet R1,但不能ping r1
pc1不能访问telnet R2,可以ping R2
pc2不可以访问telnet R1,能ping r1
pc2能访问telnet R2,不能ping R2