检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 1 2
"floating_ip_id" : "6e496fba-abe9-4f5e-9406-2ad8c809ac8c", "status" : "ACTIVE", "nat_gateway_id" : "e824f1b4-4290-4ebc-8322-cfff370dbd1e", "admin_state_up"
请求示例 GET https://{NAT_endpoint}/v2/d199ba7e0ba64899b2e81518104b1526d/dnat_rules?limit=2 响应示例 状态码: 200 查询DNAT规则列表成功。 { "dnat_rules" : [ {
ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 创建公网NAT网关
"b1d81744-5165-48b8-916e-e56626feb88f", "status" : "ACTIVE", "description" : "nat01", "admin_state_up" : true, "tenant_id" : "27e25061336f
ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 1 2
步骤4:结果验证 操作场景 DNAT规则添加完成后,分为以下两步验证: 验证是否成功为目标公网NAT网关添加DNAT规则; 验证私网服务器ECS01是否可以被外部公网服务器ECS02通过NAT网关(DNAT规则绑定的EIP为:120.46.131.153)访问到。 操作前提 DNAT规则已经添加。
ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 1 2
ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 1 2
ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 1 2
管理控制台方式 管理控制台是网页形式的,您可以使用直观的界面进行相应的操作。登录管理控制台,从主页选择“NAT网关”。 API方式 如果您需要将云平台上的NAT网关集成到您自己的系统,请使用API方式访问NAT网关。具体操作请参见《NAT网关API参考》。
0/snat_rules/a78fb3eb-1654-4710-8742-3fc49d5f04f8 响应样例 无(STATUS CODE 204) 状态码 请参考状态码。 父主题: SNAT规则
0/nat_gateways/a78fb3eb-1654-4710-8742-3fc49d5f04f8 响应样例 无(STATUS CODE 204) 状态码 请参考状态码。 父主题: 公网NAT网关
bfff-e37b14d23ad2", "virsubnet_id" : "373979ee-f4f0-46c5-80e3-0fbf72646b70" } ] }, "request_id" : "e7e3323e95b348708d26e68a0ddece71"
0/dnat_rules/a78fb3eb-1654-4710-8742-3fc49d5f04f8 响应样例 无(STATUS CODE 204) 状态码 请参考状态码。 父主题: DNAT规则
https://{NAT_endpoint}/v2/d199ba7e0ba64899b2e81518104b1526d/nat_gateways/a78fb3eb-1654-4710-8742-3fc49d5f04f8 响应示例 无 状态码 状态码 描述 204 删除公网NAT网关实例成功。 错误码
ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) 创建SNAT
"tenant_id": "27e25061336f4af590faeabeb7fcd9a3", "created_at": "2017-11-18 07:54:21.665430", "id": "5b95c675-69c2-4656-ba06-58ff72e1d338"
-4656-ba06-58ff72e1d338 响应样例 { "dnat_rule": { "floating_ip_id": "bf99c679-9f41-4dac-8513-9c9228e713e1", "status":
的值即为Token值。 响应参数 无 请求示例 DELETE https://{NAT_endpoint}/v2/d199ba7e0ba64899b2e81518104b1526/nat_gateways/f4dfea98-874a-46f7-aa2a-fb348d0ceb02/