ACL实验

1.配置IP地址

[R1]int G 0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.2.1 24

[R1-GigabitEthernet0/0/1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24


[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.2.2 24


[pc1]int g 0/0/0
[pc1-GigabitEthernet0/0/0]ip add 192.168.1.10 24

[pc2]int g 0/0/0
[pc2-GigabitEthernet0/0/0]ip add 192.168.1.11 24

2.配置静态路由,实现全网通

[R2]ip route-static 192.168.1.0 24 192.168.2.1

测试,是否全网可达

3.配置Telnet

#创建一个zzq用户,密码为123456
[R1]aaa
[R1-aaa]local-user?
[R1-aaa]local-user zzq privilege level 15 password cipher 123456

#定义用户服务类型
[R1-aaa]local-user zzq service-type telnet
#主要作用于Telnet

#开启虚拟端口
[R1]user-interface vty 0
[R1-ui-vty0]authentication-mode aaa

#重复上述步骤,在R2开启
[R2]aaa	
[R2-aaa]local-user zzq privilege level 15 password cipher 123456
Info: Add a new user.
[R2-aaa]local-user zzq service-type telnet
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode aaa 

测试

4.配置ACL

#创建高级ACL
[R1]acl 3000

#不能pingR1
[R1-acl-adv-3000]rule deny icmp source 192.168.1.10 0.0.0.0 destination 192.168.1.1 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

#不能telnet R2
[R1-acl-adv-3000]rule deny tcp source 192.168.1.10 0.0.0.0 destination 192.168.2.2 0.0.0.0 destination-port eq 23

#进入0/0/0接口调用
[R1-GigabitEthernet0/0/0]traffic-filter inbound acl 3000


[R1-acl-adv-3000]rule deny tcp source 192.168.1.11 0.0.0.0 destination 192.168.1.1 0.0.0.0
[R1-acl-adv-3000]rule deny tcp source 192.168.1.11 0.0.0.0 destination 192.168.1.1 0.0.0.0 destination-port eq 23
[R1-acl-adv-3000]rule deny tcp source 192.168.1.11 0.0.0.0 destination 192.168.2.1 0.0.0.0
[R1-acl-adv-3000]rule deny tcp source 192.168.1.11 0.0.0.0 destination 192.168.2.1 0.0.0.0 destination-port eq 23
[R1-acl-adv-3000]rule de icmp source 192.168.1.11 0.0.0.0 destination 192.168.2.2 0.0.0.0

测试

Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ho r12 r12(config)#ho r1 r1(config)#no ip do r1(config)#no ip domain-lo r1(config)#no ip domain-lookup r1(config)#line con 0 r1(config-line)#logg sy r1(config-line)#exec-t 00 r1(config-line)#exi r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)# r1(config)#int s1/2 r1(config-if)#ip add 12.1.1.1 255.255.255.0 r1(config-if)#no sh r1(config)#router ei 10 r1(config-router)#no au r1(config-router)#no auto-summary r1(config-router)#net 12.1.1.0 0.0.0.255 r1(config-router)# r1(config-router)# r1(config-router)# r1(config-router)# *Mar 1 00:06:38.539: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 10: Neighbor 12.1.1.2 (Serial1/2) is up: new adjacency r1(config-router)# r1(config-router)# r1(config-router)# r1(config-router)# r1(config-router)# r1(config-router)# r1(config-router)# r1(config-router)#end r1#telnet 23.1.1.2 *Mar 1 00:07:27.839: %SYS-5-CONFIG_I: Configured from console by console r1#telnet 23.1.1.2 Trying 23.1.1.2 ... Open User Access Verification Username: xiaoan Password: r3>en % No password set r3> r3> r3> r3>en Password: r3# r3# r3# r3# r3#exi [Connection to 23.1.1.2 closed by foreign host] r1# r1# r1# r1# r1# r1# r1# r1# r1# r1# r1# r1#telnet 23.1.1.2 Trying 23.1.1.2 ... Open User Access Verification Username: xiaoan Password: r3>exi [Connection to 23.1.1.2 closed by foreign host] r1# r1# r1# r1# r1# r1# r1# r1#telnet 23.1.1.2 Trying 23.1.1.2 ... % Destination unreachable; gateway or host down r1#telnet 23.1.1.2 Trying 23.1.1.2 ... % Destination unreachable; gateway or host down r1#ping 23.1.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 23.1.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 32/106/184 ms
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值