ACL实验

该实验详细描述了如何配置ACL以实现R2的telnet服务仅对PC2开放,同时阻止PC1telnet到R2并限制其ping通信。此外,PC2被禁止pingR2。配置包括IP地址设定、路由设置、telnet服务启用以及ACL规则的制定和应用。
摘要由CSDN通过智能技术生成
ACL实验

在这里插入图片描述

实验要求:

1.R2开启telnet服务

2.PC1可以ping通R2,但是不能telnet R2

3.PC2可以telnet R2,但是不能ping通R2

实验步骤:

1.配置IP

[R1]int g 0/0/0

[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24

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

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

[PC1-GigabitEthernet0/0/0]ip add 192.168.1.2 24

[PC2-GigabitEthernet0/0/0]ip add 192.168.1.3 24

2.写缺省路由

[PC1]ip route-static 0.0.0.0 0 192.168.1.1

[PC2]ip route-static 0.0.0.0 0 192.168.1.1

[R2]ip route-static 192.168.1.0 24 192.168.2.1

4.开启R1和R2telnet

[R1]aaa
[R1-aaa]local-user Lxx password cipher 123456
[R1-aaa]local-user Lxx service-type telnet 
[R1-aaa]local-user Lxx privilege level 15
[R1-aaa]q	
[R1]user-interface vty 0 4	
[R1-ui-vty0-4]authentication-mode aaa

在这里插入图片描述

[R2]aaa
[R2-aaa]local-user Lxx password cipher 123456
Info: Add a new user.	
[R2-aaa]local-user Lxx service-type telnet
[R2-aaa]local-user Lxx privilege level 15
[R2-aaa]q
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode aaa

在这里插入图片描述

5.写ACL表

[R1]acl 3000

[R1-acl-adv-3000]rule deny icmp source 192.168.1.2 0 destination 192.168.1.1 0

[R1-acl-adv-3000]rule deny icmp source 192.168.1.2 0 destination 192.168.2.1 0

[R1-acl-adv-3000]rule deny tcp source 192.168.1.2 0 destination 192.168.2.2 0 de
stination-port eq 23

[R1-acl-adv-3000]rule deny tcp source 192.168.1.3 0 destination 192.168.1.1 0 de
stination-port eq 2

[R1-acl-adv-3000]rule deny tcp source 192.168.1.3 0 destination 192.168.2.1 0 de
stination-port eq 23 

[R1-acl-adv-3000]rule deny icmp source 192.168.1.3 0 destination 192.168.2.2 0

[R1-acl-adv-3000]q
  • 接口调用
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]traffic-filter inbound acl 3000

6.测试
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值