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                                                                           
    #                                                                               
    acl number 2000                                                                 
     rule 5 permit source 192.168.1.0 0.0.0.255                                     
    #                                                                               
    interface GigabitEthernet1/0/0                                                  
     ip address 192.168.0.1 255.255.255.0                                           
    #                                                                               
    interface GigabitEthernet1/0/1                                                  
     ipv6 enable                                                                    
     ipv6 address 22:0:101:101::1/64                                                
    #                                                                               
    interface GigabitEthernet1/0/2                                                  
     ip address 10.1.1.1 255.255.255.0                                              
    #                                                                               
    interface Tunnel1                                                               
     ipv6 enable                                                                    
     ipv6 address 22:0:101:100::1/56                                                
     tunnel-protocol ipv6-ipv4 6rd                                                  
     source 10.1.1.1                                                                
     ipv6-prefix 22::/32                                                            
     ipv4-prefix length 8                                                           
     border-relay address 10.1.2.1                                                  
    #                                                                               
    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 Tunnel1                                                          
    #                                                                               
    firewall zone dmz                                                               
     set priority 50                                                                
    #                                                                               
    firewall interzone trust untrust                                                
     detect ftp                                                                     
    #                                                                               
     ipv6 route-static 22:: 32 Tunnel 1                                             
     ipv6 route-static 3000:: 64 22:0:102:100::1                                    
    #                                                                               
    security-policy                                                                 
     rule name policy1                                                              
      source-zone trust                                                             
      source-zone untrust                                                           
      destination-zone trust                                                        
      destination-zone untrust                                                      
      action permit                                                                 
     rule name policy2                                                              
      source-zone local                                                             
      source-zone untrust                                                           
      destination-zone local                                                        
      destination-zone untrust                                                      
      action permit                                                                 
    #                                                                                
    nat-policy                                                                      
      rule name policy_nat_1                                                        
        source-zone trust                                                           
        destination-zone untrust                                                    
        source-address 192.168.1.0 24                                               
        action source-nat easy-ip                                                          
    #                                                                               
    return                                                                          
  • The CGN configuration script is as follows:

    #                                                                          
     sysname CGN                   
    #                                                                               
     ipv6                                                                           
    #                                                                               
    firewall hash-mode source-only                                                  
    #                                                                               
    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 3000::1/64                                                        
    #                                                                               
    interface GigabitEthernet1/0/2                                                  
     undo shutdown                                                                  
     ip address 10.1.2.1 255.255.255.0                                              
    #                                                                               
    interface Tunnel1                                                               
     ipv6 enable                                                                    
     ipv6 address 22:0:102:100::1/56                                                
     tunnel-protocol ipv6-ipv4 6rd                                                  
     source 10.1.2.1                                                                
     ipv6-prefix 22::/32                                                            
     ipv4-prefix length 8                                                           
    #                                                                               
    firewall zone local                                                             
     set priority 100                                                               
    #                                                                               
    firewall zone trust                                                             
     set priority 85                                                                
     add interface GigabitEthernet1/0/2                                             
     add interface Tunnel1                                                          
    #                                                                               
    firewall zone untrust                                                           
     set priority 5                                                                 
     add interface GigabitEthernet1/0/0                                             
     add interface GigabitEthernet1/0/1                                             
    #                                                                               
    firewall zone dmz                                                               
     set priority 50  
    #                                                                                
     nat address-group addressgroup1                                                 
     mode pat                                                                        
     port-block-size 256                                                             
     route enable                                                                    
     section 1 1.1.2.1 1.1.2.5                                                  
    #                                                                               
    security-policy                                                                 
     rule name policy1                                                              
      source-zone trust                                                             
      source-zone untrust                                                           
      destination-zone trust                                                        
      destination-zone untrust                                                      
      action permit                                                                 
     rule name policy2                                                              
      source-zone local                                                             
      source-zone trust                                                           
      destination-zone local                                                        
      destination-zone trust                                                      
      action permit                                                                 
    #                                                                               
    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                                      
    #                                                                               
    firewall interzone trust untrust                                                
     detect ftp                                                                     
    #                                                                               
     ipv6 route-static 22:: 32 Tunnel 1                                             
    #                                                                               
    return                                                                          
Translation
Download
Updated: 2019-01-26

Document ID: EDOC1100062972

Views: 16777

Downloads: 721

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