检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
(Recommended) Using NAT Gateway Prerequisites for this solution: You have purchased an EIP and a public NAT gateway. The public NAT gateway and the ECSs that need to access the Internet are in the same VPC.
If not, create one and add the following content to the file: <network/prefix> via <gateway> where <network/prefix> is a remote network with prefix, and <gateway> is the next-hop IP address.
Ensure that the default route of 0.0.0.0 is destined for the gateway and that the IP address and the gateway are in the same network segment, as shown in the first and third lines in the following figure. Run the ifconfig or ip addr command to obtain the ECS IP address.
Ensure that the default route of 0.0.0.0 is destined for the gateway and that the IP address and the gateway are in the same network segment, as shown in the first and third lines in the following figure. Run the ifconfig or ip addr command to obtain the ECS IP address.
The system is currently unavailable. 504 Gateway Timeout A gateway timeout error occurs. Parent topic: Task Request Result
The system is currently unavailable. 504 Gateway Timeout A gateway timeout error occurs. Parent topic: Common Parameters
After the VPC is changed, you are required to reconfigure network-related application software and services, such as ELB, VPN, NAT, and DNS. During the change process, do not perform operations on the ECS, including its EIP.
GET https://{endpoint}/v2.1/{project_id}/os-networks Example Response { "networks": [ { "id": "04468f37-500a-4a80-88da-af823e7a1d6c", "cidr_v6": null, "gateway": null, "label": "network_demo1", "broadcast": null
Solution The EIP must be associated with the private IP address using NAT, so the server must be configured accordingly. Set the public IP address of the server. Choose Edit > Settings.
EIPs can be bound to or unbound from ECSs, BMSs, virtual IP addresses, NAT gateways or load balancers. Various billing modes are provided to meet different service requirements. Each EIP can be used by only one cloud resource at a time.
Run the following command to complete the modification: sysctl -p /etc/sysctl.conf Run the following commands to add rules to the nat table in iptables so that the access to port 1080 on ECS 1 can be redirected to port 22 on ECS 2: iptables -t nat -A PREROUTING -d 192.168.72.10 -p
Binding an EIP Network address translation using NAT Gateway Suitable for scenarios where an EIP is shared by multiple ECSs The SNAT function provided by the NAT Gateway service allows the ECSs in a VPC to access the Internet without requiring an EIP.
As a result, the instance may fail to be remotely logged in. guestos.network.wrong_nat_config Checking the Kernel Parameters of the NAT Gateway Environment The kernel parameters related to NAT gateway access are incorrectly configured for the current instance.
EIPs can be bound to or unbound from ECSs, BMSs, virtual IP addresses, NAT gateways or load balancers. Various billing modes are provided to meet different service requirements. Each EIP can be used by only one cloud resource at a time.
The gateway is inaccessible. Run the ping command to check whether the DNS server is running properly. For details, see Checking Whether the Gateway Is Accessible. The ECS performance cannot meet service requirements.
For more information about NAT Gateway, see NAT Gateway Service Overview. Parent topic: EIP
After the VPC is changed, you are required to reconfigure network-related application software and services, suc h as ELB, VPN, NAT, traffic mirroring, and DNS. Prerequisites The target VPC, subnet, private IP address, and security group are available.
In the NAT environment, multiple terminals use the same public IP address, and one-to-one connection between the server and client cannot be implemented.
This parameter cannot be set to 1 if NAT is enabled. Otherwise, an error will occur in remote ECS logins. For details, see Why Are Connections to a Linux ECS Using SSH or to Applications on the ECS Interrupted Occasionally?
Figure 5 Number in the Subnets column Click the target subnet name to go to the subnet details page and view the gateway address. Figure 6 Gateway address Parent topic: ECS Failure