- What's New
- Function Overview
- Service Overview
- Billing
- Getting Started
-
User Guide
-
Elastic IP User Guide
- Permissions Management
- Elastic IP
- IPv6 EIP
- EIP Billing
- EIP Pool
- Shared Bandwidth
- Resource Package
- Cloud Eye Monitoring
- Managing EIP Quotas
- Global Elastic IP User Guide
-
Elastic IP User Guide
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- APIs
- API V3
- Native OpenStack Neutron APIs V2.0
- Application Examples
- Permissions Policies and Supported Actions
- Appendix
- SDK Reference
-
FAQs
-
Product Consultation
- Managing Quotas
- How Do I Assign or Retrieve a Specific EIP?
- Why Is an EIP Newly Assigned the Same as the One I Released?
- Can I Buy a Specific EIP?
- Does an EIP Change Over Time?
- Why Can't I Find My Purchased EIP on the Management Console?
- What Is the EIP Assignment Policy?
- Can an EIP Be Used or Migrated Across Accounts?
- How Do I Query the Traffic Usage of My EIP?
- Do I Need to Configure a Shared Data Package for Use After It Is Purchased?
- Can I Change the Dedicated Bandwidth Used by an EIP to a Shared Bandwidth?
- How Many ECSs Can I Bind an EIP To?
- What Are the Differences Between EIP, Private IP Address, and Virtual IP Address?
- What Are the Differences Among a Bandwidth Add-On Package, Shared Data Package, and Shared Bandwidth?
- When Should I Use Premium BGP and Are There Any Limitations on Using Premium BGP?
- Why My EIPs Are Frozen? How Do I Unfreeze My EIPs?
-
Billing and Payments
- How Is an EIP Billed?
- How Do I Change My EIP Billing Mode Between Pay-per-Use and Yearly/Monthly?
- How Do I Change the Billing Option of a Pay-per-Use EIP Between By Bandwidth and By Traffic?
- Why Am I Still Being Billed After My EIP Has Been Unbound or Released?
- When Will I Be Billed for Reservation Price?
-
EIP Binding and Unbinding
- How Do I Access an ECS with an EIP Bound from the Internet?
- How Can I Unbind an Existing EIP from an Instance and Bind Another EIP to the Instance?
- Can I Bind an EIP of an ECS to Another ECS?
- Can I Bind an EIP to a Cloud Resource in Another Region?
- Can Multiple EIPs Be Bound to an ECS?
- What Are the Differences Between Unbinding and Releasing an EIP?
-
Bandwidth
- How Do I Increase a Bandwidth to Be More Than 300 Mbit/s?
- What Bandwidth Types Are Available?
- How Many EIPs Can I Add to Each Shared Bandwidth?
- What Are the Differences Between a Dedicated Bandwidth and a Shared Bandwidth?
- What Are Inbound Bandwidth and Outbound Bandwidth?
- How Do I Know If My EIP Bandwidth Has Been Exceeded?
- What Are the Differences Between Public Bandwidth and Private Bandwidth?
- Can I Increase a Yearly/Monthly Bandwidth and Decrease It Later?
- What Is the Relationship Between Bandwidth and Upload/Download Rate?
- What Are the Differences Among Static BGP, Dynamic BGP, and Premium BGP?
-
Connectivity
- What Are the Priorities of the Custom Route and EIP If Both Are Configured for an ECS to Enable the ECS to Access the Internet?
- Why Can't My ECS Access the Internet Even After an EIP Is Bound?
- What Should I Do If an EIP Cannot Be Pinged?
- How Do I Unblock an EIP?
- Why Is There Network Jitter or Packet Loss During Cross-Border Communications?
- Why Does the Download Speed of My ECS Is Slow?
-
Product Consultation
- Videos
- Glossary
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Service Overview
- Quick Start
-
Elastic IP
- EIP Overview
- Assigning an EIP and Binding It to an ECS
- Assigning an EIP
- Binding an EIP to an Instance
- Unbinding an EIP from an Instance
- Releasing an EIP
- Changing Dedicated Bandwidth Size of an EIP
- Unbinding an EIP from an ECS and Releasing the EIP
- Modifying an EIP Bandwidth
- Exporting EIP Information
- Managing EIP Tags
- Shared Bandwidth
- Monitoring
-
FAQs
-
Product Consultation
- What Is a Quota?
- How Do I Assign or Retrieve a Specific EIP?
- Why Is an EIP Newly Assigned the Same as the One I Released?
- What Are the Differences Between EIP, Private IP Address, and Virtual IP Address?
- Can an EIP That Uses Dedicated Bandwidth Be Changed to Use Shared Bandwidth?
- Can I Bind an EIP to Multiple ECSs?
- What Are the Differences Between the Primary and Extension NICs of ECSs?
- What Is the EIP Assignment Policy?
- Can I Assign a Specific EIP?
- Can a Bandwidth Be Used by Multiple Accounts?
- How Do I Unbind an EIP from an Instance and Bind a New EIP to the Instance?
- Why Can't I Find My Assigned EIP on the Management Console?
- EIP Binding and Unbinding
-
Bandwidth
- What Is the Bandwidth Size Range?
- How Do I Increase a Bandwidth to Be More Than 300 Mbit/s?
- What Bandwidth Types Are Available?
- Is There a Limit to the Number of EIPs That Can Be Added to Each Shared Bandwidth?
- What Are the Differences Between a Dedicated Bandwidth and a Shared Bandwidth?
- What Are Inbound Bandwidth and Outbound Bandwidth?
- How Do I Know If My EIP Bandwidth Limit Has Been Exceeded?
- What Are the Differences Between Public Bandwidth and Private Bandwidth?
- What Is the Relationship Between Bandwidth and Upload/Download Rate?
- Connectivity
-
Product Consultation
- Change History
- API Reference (ME-Abu Dhabi Region)
-
User Guide (Kuala Lumpur Region)
- Service Overview
- Quick Start
- EIP
- Shared Bandwidth
- Monitoring
-
FAQs
- Product Consultation
- EIP Binding and Unbinding
-
Bandwidth
- What Is the Bandwidth Size Range?
- What Bandwidth Types Are Available?
- Is There a Limit to the Number of EIPs That Can Be Added to Each Shared Bandwidth?
- What Are the Differences Between a Dedicated Bandwidth and a Shared Bandwidth? Can a Dedicated Bandwidth Be Changed to a Shared Bandwidth or the Other Way Around?
- Connectivity
- Change History
- API Reference (Kuala Lumpur Region)
- User Guide (Ankara Region)
- API Reference (Ankara Region)
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Copied.
Binding an EIP to the Extended Network Interface of an ECS to Enable Internet Access
Scenarios
As shown in Figure 1, the ECS has two network interfaces, one primary network interface and one extended network interface. You can bind an EIP to the extended network interface of the ECS and configure policy-based routes to ensure that the ECS can access the Internet through the EIP.
This section uses a Linux ECS as an example.
Step 1: Create Cloud Resources and Attach an Extended Network Interface
- Create a VPC and two subnets in the VPC.
In this example, the primary and extended network interfaces of the ECS are in different subnets.
For details, see Creating a VPC and Subnet.
- Create an ECS in the VPC subnet.
For details, see Purchasing a Custom ECS.
- Create a network interface and attach it to the ECS as an extended network interface.
When creating a network interface, select a different subnet from where the primary network interface is created. For details, see Creating a Network Interface.
Attach the network interface to the ECS. For details, see Attaching a Network Interface to a Cloud Server.
- Assign an EIP and bind it to the extended network interface of the ECS.
For details, see Assigning an EIP.
Bind the EIP to the extended network interface of the ECS. For details, see Binding an EIP to a Network Interface.
Step 2: Obtain the ECS Network Information
- Obtain the private IP addresses of the ECS's network interfaces.
- Log in to the management console.
- Click
in the upper left corner and select the desired region and project.
- Obtain the gateway address of the subnet.
- Log in to the management console.
- Click
in the upper left corner and select the desired region and project.
- Click Service List and choose Compute > Elastic Cloud Server.
- In the ECS list, locate the target ECS and click its name.
- In the ECS Information area, click the VPC name.
The Virtual Private Cloud page is displayed.
- In the VPC list and click the number in the Subnets column.
The Subnets page is displayed.
- In the subnet list, click the subnet name.
- In the Gateway and DNS Information area, view the gateway address of the subnet.
Figure 2 Viewing the gateway address of the subnet
Step 3: Configure Policy-based Routes for the Extended Network Interface
- ECS Remotely log in to the ECS.
For details, see How Do I Log In to My ECS?
- Run the following command to query the route information of the network interface:
The following figure is displayed. In this figure:
- The destination of the route for the primary network interface is 192.168.11.0/24.
- The destination of the route for the extended network interface is 192.168.17.0/24.
- Run the following command to query the network interface names of the ECS:
The following figure is displayed. Search for the network interface name based on the network interface address. In this figure:
- 192.168.11.42 is the IP address of the primary network interface, and the network interface name is eth0.
- 192.168.17.191 is the IP address of the extended network interface, and the network interface name is eth1.
- Configure the default route for the ECS so that it can access the Internet through the extended network interface.
- Run the following command to delete the default route of the primary network interface:
route del -net 0.0.0.0 gw <subnet-gateway-IP-address> dev <network interface-name>
The parameters are described as follows:
- 0.0.0.0: destination IP address, indicating that multiple IP addresses are matched. Do not change the value.
- Subnet gateway IP address: Enter the subnet gateway address of the primary network interface collected in section Table 1.
- Network interface name: Enter the name of the primary network interface obtained in 3.
Example command:
route del -net 0.0.0.0 gw 192.168.11.1 dev eth0NOTE:
This operation will interrupt ECS traffic.
- Run the following command to configure the default route for the extended network interface:
route add default gw Subnet-gateway-IP-address
The parameters are described as follows:
Subnet gateway IP address: Enter the subnet gateway address of the extended network interface collected in section Table 1.
Example command:
route add default gw 192.168.17.1
- Run the following command to delete the default route of the primary network interface:
- Verify network connectivity.
Run the following command to check whether the ECS can access the Internet:
ping Public-IP-address-or-domain-name
Example command:
ping support.huaweicloud.com
If information similar to the following is displayed, the ECS can communicate with the Internet.[root@ecs-a01 ~]# ping support.huaweicloud.com PING hcdnw.cbg-notzj.c.cdnhwc2.com (203.193.226.103) 56(84) bytes of data. 64 bytes from 203.193.226.103 (203.193.226.103): icmp_seq=1 ttl=51 time=2.17 ms 64 bytes from 203.193.226.103 (203.193.226.103): icmp_seq=2 ttl=51 time=2.13 ms 64 bytes from 203.193.226.103 (203.193.226.103): icmp_seq=3 ttl=51 time=2.10 ms 64 bytes from 203.193.226.103 (203.193.226.103): icmp_seq=4 ttl=51 time=2.09 ms ... --- hcdnw.cbg-notzj.c.cdnhwc2.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 2.092/2.119/2.165/0.063 ms
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot