Files
eNSP-assignment/期末ACL实验脚本.txt

43 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

AR1==============================
sys
sysname AR1
int g0/0/0
ip add 192.168.1.254 24
int g0/0/1
ip add 192.168.2.254 24
int g0/0/2
ip add 10.1.12.1 24
ip route-static 0.0.0.0 0 10.1.12.2
# 需求2PC1不能访问PC4但PC4可以访问PC1
# 若只拒绝源IP为PC1目的IP为PC4的报文是不能实现这个需求因为PC4 ping PC1的回包也被deny了
# 只需拒绝PC1主动ping PC4的icmp echo报文即可剩下默认放通所有(即不再deny PC4 ping PC1时PC1给PC4返回的echo-reply报文)
# 即可实现PC4单向ping通PC1
# 需求1PC1和PC2不能互访。
# 直接简单粗暴拒绝源目IP分别为PC1和PC2的报文即可源目反之由于回包已被拒绝仍然不能通
# 所以只需下面一条rule 5就可以实现PC1 PC2不能互访的效果
acl 3002
rule 5 deny ip source 192.168.1.1 0 destination 192.168.2.1 0
rule 10 deny icmp source 192.168.1.1 0 destination 192.168.4.1 0 icmp-type echo
int g0/0/0
traffic-filter inbound acl 3002
AR2==============================
sys
sysname AR2
int g0/0/1
ip add 192.168.3.254 24
int g0/0/2
ip add 192.168.4.254 24
int g0/0/0
ip add 10.1.12.2 24
ip route-static 0.0.0.0 0 10.1.12.1