No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

HUAWEI Firewall Comprehensive Configuration Examples

This document describes the application scenarios and configuration methods in typical projects of the firewall.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Configuration Scripts

Configuration Scripts

  • The CPE configuration script is as follows:

    #                                                                          
     sysname CPE                                                                    
    #                                                                               
     ipv6                                                                           
    #                                                                               
    interface GigabitEthernet1/0/0                                                  
     ip address 192.168.0.1 255.255.255.0                                           
    #                                                                               
    interface GigabitEthernet1/0/1                                                  
     ipv6 enable                                                                    
     ipv6 address 2000::1/64                                                        
     ospfv3 1 area 0.0.0.1                                                          
    #                                                                               
    interface GigabitEthernet1/0/2                                                  
     ip address 10.1.1.1 255.255.255.0                                              
    #                                                                               
    interface GigabitEthernet1/0/3                                                  
     ipv6 enable                                                                    
     ipv6 address 3000::1/64                                                        
     ospfv3 1 area 0.0.0.0                                                          
    #                                                                               
    firewall zone local                                                             
     set priority 100                                                               
    #                                                                               
    firewall zone trust                                                             
     set priority 85                                                                
     add interface GigabitEthernet1/0/0                                             
     add interface GigabitEthernet1/0/1                                             
    #                                                                               
    firewall zone untrust                                                           
     set priority 5                                                                 
     add interface GigabitEthernet1/0/2                                             
     add interface GigabitEthernet1/0/3                                             
    #                                                                               
    firewall zone dmz                                                               
     set priority 50                                                                
    #                                                                               
    firewall interzone trust untrust                                                
     detect ftp                                                                     
    #                                                                               
    ospfv3 1                                                                        
     router-id 1.1.1.1                                                              
     area 0.0.0.0                                                                   
     area 0.0.0.1                                                                   
    #                                                                               
     ip route-static 10.1.2.0 255.255.255.0 10.1.1.2                                
    #                                                                               
    security-policy                                                                 
      rule name policy_sec_1                                                        
        source-zone trust                                                           
        destination-zone untrust                                                    
        source-address 192.168.0.0 24                                                  
        action permit    
      rule name policy_sec_2                                                        
        source-zone trust                                                           
        destination-zone untrust                                                    
        source-address 2000::2 64                                                  
        action permit   
      rule name policy_sec_3                                                        
        source-zone untrust                                                           
        destination-zone local                                                                                                    
        action permit                                                                         
    #                                                                                
    nat-policy                                                                      
      rule name policy_nat_1                                                        
        source-zone trust                                                           
        destination-zone untrust                                                    
        source-address 192.168.0.0 24                                               
        action source-nat easy-ip                                                          
    #                                                                               
    return                                                                          
  • The CGN configuration script is as follows:

    #                                                                          
     sysname CGN                   
    #                                                                               
     ipv6   
    #                                                                               
    firewall hash-mode source-only                                                  
    #                                                                               
     nat64 prefix 6000:: 96                                                         
    #                                                                               
    interface GigabitEthernet1/0/0                                                  
     undo shutdown                                                                  
     ip address 1.1.1.1 255.255.255.0                                             
    #                                                                               
    interface GigabitEthernet1/0/1                                                  
     undo shutdown                                                                  
     ipv6 enable                                                                    
     ipv6 address 5000::1/64                                                        
     ospfv3 1 area 0.0.0.2                                                          
    #                                                                               
    interface GigabitEthernet1/0/2                                                  
     undo shutdown                                                                  
     ip address 10.1.2.1 255.255.255.0                                              
    #                                                                               
    interface GigabitEthernet1/0/3                                                  
     undo shutdown                                                                  
     ipv6 enable                                                                    
     ipv6 address 4000::1/64                                                        
     ospfv3 1 area 0.0.0.0                                                          
    #                                                                               
    firewall zone local                                                             
     set priority 100                                                               
    #                                                                               
    firewall zone trust                                                             
     set priority 85                                                                
     add interface GigabitEthernet1/0/2                                             
     add interface GigabitEthernet1/0/3                                             
    #                                                                               
    firewall zone untrust                                                           
     set priority 5                                                                 
     add interface GigabitEthernet1/0/0                                             
     add interface GigabitEthernet1/0/1                                             
    #                                                                               
    firewall zone dmz                                                               
     set priority 50
    #                                                                               
    security-policy                                                                 
     rule name policy1                                                              
      source-zone trust                                                             
      source-zone untrust                                                           
      destination-zone trust                                                        
      destination-zone untrust                                                      
      action permit                                                                 
     rule name policy2                                                                                                                          
      source-zone untrust                                                                                                                
      destination-zone local                                                     
      action permit                                                                  
    #                                                                                
    nat address-group addressgroup1                                                 
     mode pat                                                                        
     port-block-size 256                                                             
     route enable                                                                    
     section 1 1.1.2.1 1.1.2.5                                                  
    nat address-group addressgroup2                                                 
     nat-type nat64                                                                   
     mode pat                                                             
     route enable                                                                    
     section 1 1.1.2.11 1.1.2.15                                                  
    #                                                                               
    nat-policy                                                                      
      rule name policy_nat_1                                                        
        source-zone trust                                                           
        destination-zone untrust                                                    
        source-address 10.1.1.0 24                                                  
        action source-nat address-group addressgroup1                                      
      rule name policy_nat64                                                        
        source-zone trust                                                           
        destination-zone untrust                                                    
        source-address 2000:: 64                                                  
        action source-nat address-group addressgroup2                                      
    #                                                                               
    firewall interzone trust untrust                                                
     detect ftp                                                                     
    #                                                                               
    ospfv3 1                                                                        
     router-id 2.2.2.2                                                              
     import-route static                                                            
    #                                                                               
     ipv6 route-static 6000:: 96 NULL0                                              
    #                                                                               
    return                                                                          
Translation
Download
Updated: 2019-01-26

Document ID: EDOC1100062972

Views: 16688

Downloads: 717

Average rating:
This Document Applies to these Products
Related Version
Related Documents
Share
Previous Next