Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cloud Firewall/ User Guide/ Enabling NAT Gateway Traffic Protection

Enabling NAT Gateway Traffic Protection

Updated on 2025-01-22 GMT+08:00

CFW protects the traffic of the NAT gateway by protecting the VPC of the NAT gateway. In addition, CFW supports fine-grained access control over private IP addresses to prevent unauthorized external connections from intranet servers.

SNAT and DNAT are supported.

Networking

SNAT and DNAT network diagrams are as follows.

Constraints

  • Only the professional edition supports NAT gateway traffic protection.
  • Traffic diversion depends on the enterprise router
  • By default, CFW supports standard private network CIDR blocks. To enable non-standard CIDR block communication, submit a service ticket.
  • To let the DNAT gateway divert east-west traffic to the CFW cluster and configure DNAT rules, submit a service ticket to ask service O&M personnel to upgrade CFW. The old version does not support DNAT functions and may cause traffic loss.

Enabling NAT Gateway Traffic Protection

A firewall has been created. For details, see Creating a VPC Border Firewall.

Step 1: Connect VPC1 and VPC-NAT to an Enterprise Router

  1. Add VPC connections.
    For details, see Adding VPC Attachments to an Enterprise Router.
    NOTE:

    Two connections need to be added. Set their Attached Resource to VPC1 and VPC-NAT, respectively.

  2. Create two route tables.
    1. In the upper left corner, click and choose Networking > Enterprise Router. Click Manage Route Table.
    2. Create an association route table and a propagation route table, used for connecting to a protected VPC and a firewall, respectively.

      Click the Route Tables tab. Click Create Route Table. For more information, see Table 1.

      Table 1 Route table parameters

      Parameter

      Description

      Name

      Route table name.

      It must meet the following requirements:
      • Must contain 1 to 64 characters.
      • Can contain letters, digits, underscores (_), hyphens (-), and periods (.).

      Description

      Route table description

      Tag

      During the route table creation, you can tag the route table resources. Tags identify cloud resources for purposes of easy categorization and quick search.

      For details about tags, see Tag Overview.

  3. Configure the association route table.
    1. Create an association between VPC1 and VPC-NAT. On the route table configuration page, click the Associations tab and click Create Association. For more information, see Table 2.
      Table 2 Association parameters

      Parameter

      Description

      Attachment Type

      Select VPC.

      Attachment

      Select the VPC attachment from the Attachment drop-down list.

      NOTE:

      Two associations need to be added. Set their Attachment to VPC1 and VPC-NAT attachments, respectively.

    2. Add a static route to the firewall. Click the Routes tab and click Create Route. For more information, see Table 3.
      Figure 1 Creating a route
      Table 3 Route parameters

      Parameter

      Description

      Destination

      Set the destination address.

      • If 0.0.0.0/0 is configured, all the traffic of the VPC is protected by CFW.
      • If a CIDR block is configured, the traffic of the CIDR block is protected by CFW.

      Blackhole Route

      You are advised to disable this function. If it is enabled, the packets from a route that matches the destination address of the blackhole route will be discarded.

      Attachment Type

      Set Attachment Type to CFW instance.

      Next Hop

      Select the automatically generated firewall attachment cfw-er-auto-attach.

      Description

      (Optional) Description of a route.

  4. Configure the propagation route table.
    1. Create a propagation for VPC1. On the route table setting page, click the Propagations tab and click Create Propagation. For more information, see Table 4.
      Figure 2 Creating a propagation
      Table 4 Propagation parameters

      Parameter

      Description

      Attachment Type

      Select VPC.

      Attachment

      Select the VPC1 attachment from the Attachment drop-down list.

    2. Add a static route to VPC-NAT. Click the Routes tab and click Create Route. For more information, see Table 5.
      Table 5 Route parameters

      Parameter

      Description

      Destination

      Set it to 0.0.0.0/0.

      Blackhole Route

      You are advised to disable this function. If it is enabled, the packets from a route that matches the destination address of the blackhole route will be discarded.

      Attachment Type

      Select VPC.

      Next Hop

      Select the VPC-NAT attachment from the drop-down list.

Step 2: Configure a NAT Gateway

  1. Add an SNAT rule.
    1. Return to the Enterprise Router page. In the navigation pane of Network Console, choose NAT Gateway > Public NAT Gateways.
    2. Click the name of a public network NAT gateway. The Basic Information tab is displayed. Click the SNAT Rules tab.
    3. Click Add SNAT Rule. For more information, see Table 6.
      Table 6 Adding an SNAT rule

      Parameter

      Description

      Scenario

      Scenario where the SNAT rule is used. Select VPC.

      CIDR Block

      Select Custom to enable servers in this subnet to use the SNAT rule to access the Internet.

      • Custom: Customize a CIDR block or enter the IP address of a VPC.

      EIP

      EIP used for accessing the Internet.

      You can select only an EIP that is not bound to any resource, an EIP that is bound to a DNAT rule whose Port Type is not set to All ports in the current public NAT gateway, or an EIP that is bound to an SNAT rule of the current public NAT gateway.

      You can select multiple EIPs at once. Up to 20 EIPs can be selected for each SNAT rule. If you have selected multiple EIPs for an SNAT rule, one EIP will be chosen randomly.

      Monitoring

      Monitoring of the number of SNAT connections.

      You can set alarm rules to monitor your SNAT connections and keep informed of any changes in a timely manner.

      Description

      Supplementary information about the SNAT rule. Enter up to 255 characters.

  2. Configure the VPC-NAT route table.
    1. In the service list, click Virtual Private Cloud under Networking. In the navigation pane, choose Route Tables.
    2. In the Name column, click the route table name of a VPC. The Summary page is displayed.
    3. Click Add Route. For more information, see Table 7.
      Table 7 Route parameters

      Parameter

      Description

      Destination Type

      Select IP address.

      Destination

      Destination CIDR block. Enter the IP address of VPC1.

      NOTE:

      The value cannot conflict with existing routes or subnet CIDR blocks in the VPC.

      Next Hop Type

      Select Enterprise Router from the drop-down list.

      Next Hop

      Select a resource for the next hop.

      The enterprise routers you created are displayed in the drop-down list.

      Description

      (Optional) Supplementary information about the route.

      NOTE:

      Enter up to 255 characters. Angle brackets (< or >) are not allowed.

Step 3: Configure a route table for VPC1

  1. On the Route Tables page, in the Name column, click the route table name of VPC1. The Summary page is displayed.
  2. Click Add Route. For more information, see Table 8.
    Table 8 Route parameters

    Parameter

    Description

    Destination Type

    Select IP address.

    Destination

    Destination CIDR block. Set it to 0.0.0.0/0.

    Next Hop Type

    Select Enterprise Router from the drop-down list.

    Next Hop

    Select a resource for the next hop.

    The enterprise routers you created are displayed in the drop-down list.

    Description

    (Optional) Supplementary information about the route.

    NOTE:

    Enter up to 255 characters. Angle brackets (< or >) are not allowed.

Step 4: Enable a VPC Border Firewall

  1. In the navigation pane, choose Assets > Inter-VPC Border Firewalls.
  2. Click Enable Protection to the right of Firewall Status.
  3. Click OK.

Follow-up Operations

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback