1 Topology Configure the IP of each interface and PC according to the topology



2 R1 configures the corresponding rules


[R1]acl number 2000//Create basic ACL2000 range 2000-2999

[R1-acl-basic-2000]rule 5 deny source 192.168.1.100 0.0.0.0 //Reject traffic from the host whose source IP is 192.168.1.100

[R1-acl-basic-2000]rule 10 deny source 192.168.1.101 0.0.0.0 //Reject traffic from the host whose source IP is 192.168.1.101

[R1-acl-basic-2000]rule 999 permit //Allow all traffic to pass. The implicit rule on Huawei devices is to allow all traffic, and other manufacturers' default rules are to deny all traffic.

[R1]int g0/0/0

[R1-GigabitEthernet0/0/0]traffic-filter inbound acl 2000 //The traffic filtering of ACL2000 is called in the inbound direction of port 0


3. Change IP test on PC1

The IP of PC1 is 192.168.1.100 for testing



Can't pass


The IP of PC1 is 192.168.1.101 for testing



Can't pass

  

The IP of PC1 is 192.168.1.102 for testing



Advanced ACL


1 Topology Configure the IP of each interface and PC according to the topology



2 R1 configures the corresponding rules


[R1]acl number 3000//Create advanced ACL 3000 range 3000-3999

[R1-acl-adv-3000]rule 5 deny ip source 192.168.1.100 0.0.0.0 destination 192.168

.2.100 0.0.0.0 //Add a rule to deny access to the IP address of the source address 192.168.1.100 and the destination address 192.168.2.100

//Reject all network segments is 192.168.1.0 0.0.0.255

[R1-acl-adv-3000]rule 999 permit ip source any destination any //Permit all IP traffic

[R1-acl-adv-3000]q

[R1]int g0/0/0

[R1-GigabitEthernet0/0/0]traffic-filter inbound acl 3000 //Call ACL3000 traffic filtering in the direction of port 0


3. Change IP test on PC1


PC1 IP address 192.168.1.100



PC1 IP address 192.168.1.101



OK


4 Deny all traffic configuration for odd-numbered IPs Clear the configuration of ACL3000

[R1]acl number 2001

[R1-acl-basic-2001]rule 5 deny source 192.168.1.1 0.0.0.254 //Reject traffic access from odd IPs. The wildcard 0 represents a strict match and 1 represents any match.

[R1-acl-basic-2001]q

[R1]int g0/0/0

[R1-GigabitEthernet0/0/0]traffic-filter inbound acl 2001


5. Change IP test on PC1


PC1 IP address 192.168.1.100



PC1 IP address 192.168.1.199



PC1 IP address 192.168.1.200