实验要求:
网段划分:
192.168.1.0/24
192.168.1.0/25
192.168.1.128/25
PC1基础配置:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys PC1
[PC1]int g0/0/0 进入接口配置IP地址
[PC1-GigabitEthernet0/0/0]ip add 192.168.1.1 25
[PC1]ip route-static 0.0.0.0 0 192.168.1.3//添加缺省路由,否则PC1访问不了R2
PC2基础配置
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys PC2
[PC2]int g0/0/0
[PC2-GigabitEthernet0/0/0]ip add 192.168.1.2 25
[PC2]ip route-static 0.0.0.0 0 192.168.1.3//添加缺省路由,否则PC2访问不到R2
R1的基础配置:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.3 25
[R1-GigabitEthernet0/0/0]q
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.129 25
R2的基础配置:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.130 25
[Huawei-GigabitEthernet0/0/0]q
[Huawei]ip route-static 0.0.0.0 0 192.168.1.129//添加缺省路由,否则R2访问不到PC1,PC2;
测试ping通性(全网可达)
R1配置远程登录:
[R1]aaa //认证授权审计
[R1-aaa]local-user xixi password cipher 123 //添加新用户
Info: Add a new user.
[R1-aaa]local-user xixi service-type telnet //选择用户服务类型
[R1-aaa]local-user xixi privilege level 15 //设置远程登录用户权限等级;
[R1]user-interface vty 0 4 //虚拟登录接口调用认证
[R1-ui-vty0-4]authentication-mode aaa
R2的远程登录配置:
[Huawei]aaa
[Huawei-aaa]local-user haha password cipher 123
Info: Add a new user.
[Huawei-aaa]local-user haha service-type telnet
[Huawei-aaa]local-user haha privilege level 15
[Huawei-aaa]q
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode aaa
测试R2,R1上的telnet是否配置成功
telnet配置成功!
实现PC1不能ping 通R1,PC2可以telnetR1
[R1]acl 3001
[R1-acl-adv-3001]rule deny icmp source 192.168.1.1 de
[R1-acl-adv-3001]rule deny icmp source 192.168.1.1 0 destination 192.168.1.3 0
[R1-acl-adv-3001]rule deny tcp source 192.168.1.2 0 destination 192.168.1.3 0 de
stination-port eq 23
测试:
PC1ping R1失败
PC1 telnet R1
R1上的ACL配置成功!!!
在R2上配置ACL:
[R2]acl 3002
[R2-acl-adv-3002]rule deny icmp source 193.168.1.2 0 destination 192.168.1.130 0
[R2-acl-adv-3002]rule deny tcp source 192.168.1.1 0 destination 192.168.1.130 0 destination-port eq 23
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]traffic-filter inbound acl 3002
测试
PC2 ping R2
由于acl没有ping通
PC1 Telnet R2
由于ACL访问不成功
实验完成!!!
总结:telnet命令一定要在用户模式下使用,否则运行不了
!!!