![](https://i-blog.csdnimg.cn/blog_migrate/5ed91daaa4447fdbe1c514656280a858.png)
实验步骤
配置接口IP地址 与路由
给充当pc的路由器的接口配置IP地址与路由
[pc1]INTG0/0/0
[pc1-GigabitEthernet0/0/0]IPADD 192.168.1.10 24
[pc1-GigabitEthernet0/0/0]Q
[pc1]IProute-static 192.168.2.0 24 192.168.1.1
[PC2]intg0/0/0
[PC2-GigabitEthernet0/0/0]ipadd 192.168.1.20 24
[PC2]iproute-static 192.168.2.0 24 192.168.1.1
为R1的接口配置IP地址
[R1]intg0/0/0
[R1-GigabitEthernet0/0/0]ipadd 192.168.1.1 24
[R1-GigabitEthernet0/0/0]intg0/0/1
[R1-GigabitEthernet0/0/1]ipadd 192.168.2.1 24
为R2的接口配置IP地址
[R2]intg0/0/0
[R2-GigabitEthernet0/0/0]ipadd 192.168.2.2 24
配置telnet 环境
为R1 配置telnet
创建用户->指定服务类型->创建虚拟用户通道->指定用户认证方式
[R1]AAA 进入aaa模式
[R1-aaa]LOCAL-USERR1 privilege level 15 password cipher r112345
Info: Adda new user.
创建新用户 R1 给予管理员权限密码为 r112345
[R1-aaa]local-userR1 service-type telnet 为用户添加服务类型
[R1-aaa]q
[R1]user-inter
[R1]user-interface ?
INTEGER<0,129-149> The first user terminal interface to beconfigured
console Primary user terminal interface
current Thecurrent user terminal interface
maximum-vty The maximum number of VTY users, thedefault value is 5
tty The asynchronous serial userterminal interface
vty The virtual user terminalinterface
[R1]user-interfacevty 0 4 创建 虚拟用户终端通道
[R1-ui-vty0-4]auth
[R1-ui-vty0-4]authentication-mode aaa 指定用户认证方式
[R1-ui-vty0-4]q
为R2配置telnet
创建用户->指定服务类型->创建虚拟用户通道->指定用户认证方式
[R2]AAA 进入aaa模式
[R2-aaa]LOCAL-USERR2 privilege level 15 password cipher r212345
Info: Adda new user.
创建新用户 R2 给予管理员权限密码为 r212345
[R2-aaa]local-userR1 service-type telnet 为用户添加服务类型
[R2-aaa]q
[R2]user-inter
[R2]user-interfacevty 0 4 创建虚拟用户终端通道
[R2-ui-vty0-4]auth
[R2-ui-vty0-4]authentication-mode aaa 指定用户认证方式
[R2-ui-vty0-4]q
测试网络连通性 与telnet 服务
![](https://i-blog.csdnimg.cn/blog_migrate/e434008a17e1801961ca444b17bba98e.png)
![](https://i-blog.csdnimg.cn/blog_migrate/37a679ffdc5bce301877f2d7a1e94851.png)
![](https://i-blog.csdnimg.cn/blog_migrate/cb59a87b88417cb0224d43eb6fde816b.png)
配置acl规则
1、pc1可以访问telnet R1 ,不能 ping R1
[R1]acl3000
[R1-acl-adv-3000]ruledeny icmp source 192.168.1.10 0.0.0.0 destination 192.168
.1.10.0.0.0
[R1-acl-adv-3000]ruledeny icmp source 192.168.1.10 0.0.0.0 destination 192.168
.2.10.0.0.0
2、pc1不能访问 telnet R2,可以ping R2
[R1-acl-adv-3000]Ruledeny tcp source 192.168.1.10 0.0.0.0 destination 192.168.2
.20.0.0.0 destination-port eq 23
3、pc2 不可以访问 telnet R1,可以ping R1
Rule denytcp source 192.168.1.11 0.0.0.0 destination 192.168.1.1 0.0.0.0destination-port eq 23
Rule denytcp source 192.168.1.11 0.0.0.0 destination 192.168.2.1 0.0.0.0destination-port eq 23
4、pc2能 访问 telnet R2 不可以ping R2
Rule deny icmp source 192.168.1.11 0.0.0.0 destination192.168.2.2 0.0.0.0
测试
pc1可以访问telnet R1 ,不能 ping R1
![](https://i-blog.csdnimg.cn/blog_migrate/3ab42a5d115e4c633b2e593933c17d50.png)
2、pc1不能访问telnet R2,可以ping R2
![](https://i-blog.csdnimg.cn/blog_migrate/fe1f70b82f12fe849cbd7453e8fa78b1.png)
3、pc2 不可以访问telnet R1,可以ping R1
![](https://i-blog.csdnimg.cn/blog_migrate/a6f1ccd350923ec7184ff37d65177071.png)
4、pc2能 访问 telnet R2 不可以ping R2
![](https://i-blog.csdnimg.cn/blog_migrate/37427b5facaf8b4b5c6730346dc04613.png)
测试结果正确。
实验结束