< Home

Example for Using Advanced ACL6s to Filter Certain Types of IPv6 Packets

Networking Requirements

As shown in Figure 1, users are connected to the Switch through GE0/0/1. The Switch needs to block certain types of IPv6 packets from users in which the source IPv6 address is fc01::2/64 and the destination IPv6 address is fc01::1/64.

Figure 1 Using advanced ACL6s to filter certain types of IPv6 packets

Configuration Roadmap

The following configurations are performed on the Switch. The configuration roadmap is as follows:

  1. Configure an advanced ACL6 and an ACL6-based traffic classifier to filter the IPv6 packets in which the source IPv6 address is the host address fc01::2/64 and the destination IPv6 address is fc01::1/64.
  2. Configure a traffic behavior to discard the packets matching the ACL6.
  3. Configure and apply a traffic policy to make the ACL6 and traffic behavior take effect.

Procedure

  1. Enable the IPv6 forwarding capability, add an interface to a VLAN, and assign an IPv6 address to the VLANIF interface.

    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] ipv6
    [Switch] vlan batch 10
    [Switch] interface gigabitethernet 0/0/1
    [Switch-GigabitEthernet0/0/1] port link-type trunk
    [Switch-GigabitEthernet0/0/1] port trunk allow-pass vlan 10
    [Switch-GigabitEthernet0/0/1] quit
    [Switch] interface vlanif 10
    [Switch-Vlanif10] ipv6 enable
    [Switch-Vlanif10] ipv6 address fc01::1 64
    [Switch-Vlanif10] quit

  2. Configure an advanced ACL6 and an ACL6-based traffic classifier. Configure a traffic behavior and traffic policy, and apply the traffic policy to the inbound direction of GE0/0/1 to reject the IPv6 packets with the source IPv6 address of fc01::2/64 and the destination IPv6 address of fc01::1/64.

    [Switch] acl ipv6 number 3001
    [Switch-acl6-adv-3001] rule deny ipv6 source fc01::2/64 destination fc01::1/64
    [Switch-acl6-adv-3001] quit
    [Switch] traffic classifier class1
    [Switch-classifier-class1] if-match ipv6 acl 3001
    [Switch-classifier-class1] quit
    [Switch] traffic behavior behav1
    [Switch-behavior-behav1] deny
    [Switch-behavior-behav1] statistic enable
    [Switch-behavior-behav1] quit
    [Switch] traffic policy policy1
    [Switch-trafficpolicy-policy1] classifier class1 behavior behav1
    [Switch-trafficpolicy-policy1] quit
    [Switch] interface gigabitethernet 0/0/1
    [Switch-GigabitEthernet0/0/1] traffic-policy policy1 inbound
    [Switch-GigabitEthernet0/0/1] quit

  3. Verify the configuration.

    # Check the ACL6 configuration.

    [Switch] display acl ipv6 3001
    
    Advanced IPv6 ACL 3001, 1 rule
     rule 0 deny ipv6 source FC01::/64 destination FC01::/64

    # Check the configuration of the traffic classifier.

    [Switch] display traffic classifier user-defined
      User Defined Classifier Information:                                          
       Classifier: class1                                                           
        Operator: OR                                                                
        Rule(s) : if-match ipv6 acl 3001                                            
                                                                                    
    Total classifier number is 1                                                    

    # Check the configuration of the traffic policy.

    [Switch] display traffic policy user-defined
      User Defined Traffic Policy Information:                                      
      Policy: policy1                                                               
       Classifier: class1                                                           
        Operator: OR                                                                
         Behavior: behav1                                                           
          Deny                                                                      
          Statistic: enable                                                         
                                                                                    
    Total policy number is 1                                                        

    # If PC1 cannot access the network, run the display traffic policy statistics interface gigabitethernet 0/0/1 inbound command on the Switch. The command output shows that the number of matched packets is the same as the number of discarded packets. This indicates that packets matching ACL 3001 are all discarded.

Configuration Files

Switch configuration file

#
sysname Switch
#
ipv6
#
vlan batch 10
#
acl ipv6 number 3001
 rule 0 deny ipv6 source FC01::/64 destination FC01::/64
#
traffic classifier class1 operator or
 if-match ipv6 acl 3001
#
traffic behavior behav1
 deny
 statistic enable
#
traffic policy policy1 match-order config
 classifier class1 behavior behav1
#
interface Vlanif10
 ipv6 enable
 ipv6 address FC01::1/64
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 10
 traffic-policy policy1 inbound
#
return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic