ACL和NET(HW)

 

ACL和NET(HW)

第一步:pc1和pc2等相同操作

[pc1]interface    GigabitEthernet    0/0/0

[pc1-GigabitEthernet0/0/0]ip  address   172.16.1.1  24

     ##查看接口:

ACL和NET(HW)

第二步:手工指路

[pc1]ip route-static 0.0.0.0 0.0.0.0 172.16.1.254

[pc2]ip route-static 0.0.0.0 0.0.0.0 172.16.1.254

[R2]ip route-static 172.16.1.0 255.255.255.0 172.16.2.1

第三步:添加策略,例如允许ping ,不允许telnet访问。

[r1]rule 5 deny icmp source 172.16.1.1 0 destination 172.16.2.1 0

[r1]rule 10 deny icmp source 172.16.1.1 0 destination 172.16.1.254 0

[r1]rule 15 deny tcp source 172.16.1.2 0 destination 172.16.2.1 0 destination-port  eq telnet

 [r1]rule 20 deny icmp source 172.16.1.2 0 destination 172.16.2.1 0

 [r1]rule 25 deny tcp source 172.16.1.2 0 destination 172.16.1.254 0 destination-port eq telnet(端口为目标端口)

第四步:开启telnet服务

[r1]user-interface  VTY  0 4

[r1-ui-vty0-4]authentication-mode aaa

[r1]aaa

[r1-aaa]local-user  haha  privilege  level  15 password   cipher  1234

测试:

Pc1ping

ACL和NET(HW)

Pc2:telnet

ACL和NET(HW)