一.需求分析
1.R2开启telnet服务
2.PC1可以ping通R2,但是不能telnet R2
3.PC2可以telnet R2,但是不能ping通R2
配置IP
[PC1]int g 0/0/0
[PC1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[PC2]int g 0/0/0
[PC2-GigabitEthernet0/0/0]ip add 192.168.1.2 24
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[R1]int g 0/0/1
[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]ip route-static 0.0.0.0 0 192.168.1.254
[PC2]ip route-static 0.0.0.0 0 192.168.1.254
[R2]ip route-static 0.0.0.0 0 192.168.2.1
在r2启动tenet
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode aaa
[R2-ui-vty0-4]q
[R2]aaa
[R2-aaa]local-user huawei password cipher 123456 privilege level 15
[R2-aaa]local-user huawei service-type telnet
[R2-aaa]q
配置ACL
[R1]acl 3000
[R1-acl-adv-3000]rule deny tcp source 192.168.1.1 0.0.0.0 destination 192.168.2.
2 0.0.0.0 destination-port eq telnet
[R1-acl-adv-3000]q.
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]traffic-filter inbound acl 3000
[R1-GigabitEthernet0/0/0]q
[R1]acl 3100
[R1-acl-adv-3100]rule deny ip source 192.168.1.2 0.0.0.0 destination 192.168.2.2
0.0.0.0
[R1-acl-adv-3100]q
[R1]int g 0/0/1
[R1-GigabitEthernet0/0/1]traffic-filter outbound acl 3100
[R1-GigabitEthernet0/0/1]q
实验完成