forked from docs/doc-exports
Reviewed-by: Kucerak, Kristian <kristian.kucerak@t-systems.com> Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com> Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
316 lines
24 KiB
HTML
316 lines
24 KiB
HTML
<a name="nat_api_0011"></a><a name="nat_api_0011"></a>
|
|
|
|
<h1 class="topictitle1">Creating a DNAT Rule</h1>
|
|
<div id="body1516089194257"><div class="section" id="nat_api_0011__section2213133217038"><h4 class="sectiontitle">Function</h4><p id="nat_api_0011__p558179021710">This API is used to create a DNAT rule.</p>
|
|
<div class="note" id="nat_api_0011__note106471540162018"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="nat_api_0011__p193818469203">You can create a DNAT rule only when <strong id="nat_api_0011__b9176115783712">status</strong> of the NAT gateway is set to <strong id="nat_api_0011__b1017745743712">ACTIVE</strong> and <strong id="nat_api_0011__b14177457133719">admin_state_up</strong> of the NAT gateway administrator to <strong id="nat_api_0011__b01781257173710">True</strong>. Either <strong id="nat_api_0011__b842352706164230">port_id</strong> or <strong id="nat_api_0011__b842352706164234">private_ip</strong> is used each time. If you create a rule that applies to all port types, set <strong id="nat_api_0011__b84235270685721">internal_service_port</strong> to <strong id="nat_api_0011__b84235270685730">0</strong>, <strong id="nat_api_0011__b84235270685734">external_service_port</strong> to <strong id="nat_api_0011__b84235270685741">0</strong>, and <strong id="nat_api_0011__b84235270685744">protocol</strong> to <strong id="nat_api_0011__b84235270685747">ANY</strong>.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="nat_api_0011__section2631225217131"><h4 class="sectiontitle">URI</h4><p id="nat_api_0011__p45381815102019">POST /v2.0/dnat_rules</p>
|
|
</div>
|
|
<div class="section" id="nat_api_0011__section1572764517510"><h4 class="sectiontitle">Request</h4><p id="nat_api_0011__p2047595911203"><a href="#nat_api_0011__table19385203615518">Table 1</a> lists the request parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0011__table19385203615518"></a><a name="table19385203615518"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0011__table19385203615518" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameter</caption><thead align="left"><tr id="nat_api_0011__row7697336175113"><th align="left" class="cellrowborder" valign="top" width="21.19%" id="mcps1.3.3.3.2.5.1.1"><p id="nat_api_0011__p969713363516">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.29%" id="mcps1.3.3.3.2.5.1.2"><p id="nat_api_0011__p1269717362514">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.02%" id="mcps1.3.3.3.2.5.1.3"><p id="nat_api_0011__p269717363519">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="49.5%" id="mcps1.3.3.3.2.5.1.4"><p id="nat_api_0011__p176971936105117">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0011__row4697436175118"><td class="cellrowborder" valign="top" width="21.19%" headers="mcps1.3.3.3.2.5.1.1 "><p id="nat_api_0011__p96971336105112">dnat_rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.29%" headers="mcps1.3.3.3.2.5.1.2 "><p id="nat_api_0011__p7697436175113">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.02%" headers="mcps1.3.3.3.2.5.1.3 "><p id="nat_api_0011__p1869713366514">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.5%" headers="mcps1.3.3.3.2.5.1.4 "><p id="nat_api_0011__p14697113614518">Specifies the DNAT rule object. For details, see <a href="#nat_api_0011__table132796437212">Table 2</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0011__table132796437212"></a><a name="table132796437212"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0011__table132796437212" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Description of the <strong>dnat_rule</strong> field</caption><thead align="left"><tr id="nat_api_0011__row184049431027"><th align="left" class="cellrowborder" valign="top" width="20.919999999999998%" id="mcps1.3.3.4.2.5.1.1"><p id="nat_api_0011__p14043431726">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="12.29%" id="mcps1.3.3.4.2.5.1.2"><p id="nat_api_0011__p154049430210">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.02%" id="mcps1.3.3.4.2.5.1.3"><p id="nat_api_0011__p1740416433219">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="49.769999999999996%" id="mcps1.3.3.4.2.5.1.4"><p id="nat_api_0011__p240420437215">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0011__row134041433214"><td class="cellrowborder" valign="top" width="20.919999999999998%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0011__p164043431129">nat_gateway_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.29%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0011__p1140424312213">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.02%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0011__p8404443921">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.769999999999996%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0011__p1440494313213">Specifies the NAT gateway ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row040412436218"><td class="cellrowborder" valign="top" width="20.919999999999998%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0011__p19404204314213">port_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.29%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0011__p154048432027">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.02%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0011__p540414431823">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.769999999999996%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0011__p86078310224">Specifies the port ID of an ECS or a BMS. This parameter and <strong id="nat_api_0011__b36401438161616">private_ip</strong> are alternative.</p>
|
|
<p id="nat_api_0011__p19185113282111">When the DNAT rule is used in the VPC scenario, use this parameter.</p>
|
|
<p id="nat_api_0011__p13404243429"></p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row14041643528"><td class="cellrowborder" valign="top" width="20.919999999999998%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0011__p740415432025">private_ip</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.29%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0011__p12404194314216">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.02%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0011__p184045434218">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.769999999999996%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0011__p84041843221">Specifies the private IP address, for example, the IP address of a Direct Connect connection. This parameter and <strong id="nat_api_0011__b1420810186186">port_id</strong> are alternative.</p>
|
|
<p id="nat_api_0011__p675545942210">When the DNAT rule is used in the Direct Connect scenario, use this parameter.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row16404204313220"><td class="cellrowborder" valign="top" width="20.919999999999998%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0011__p5404144313210">internal_service_port</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.29%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0011__p64041431726">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.02%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0011__p740413431823">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.769999999999996%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0011__p1740419431628">Specifies the port used by ECSs or BMSs to provide services that are accessible from external systems. In the VPC scenario, this parameter indicates the NIC port of the ECS or BMS associated with the DNAT rule. In the Direct Connect scenario, this parameter indicates the port of the private IP address of the DNAT rule.</p>
|
|
<p id="nat_api_0011__p223280102618">The value ranges from 0 to 65535.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row14404174310215"><td class="cellrowborder" valign="top" width="20.919999999999998%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0011__p19404343926">floating_ip_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.29%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0011__p144048432217">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.02%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0011__p240484314213">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.769999999999996%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0011__p1404343021">Specifies the EIP ID. </p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row74041243421"><td class="cellrowborder" valign="top" width="20.919999999999998%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0011__p1440444312219">external_service_port</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.29%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0011__p1740404311216">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.02%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0011__p64041430217">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.769999999999996%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0011__p1140419436216">Specifies the port for providing services that are accessible from external systems..</p>
|
|
<p id="nat_api_0011__p47430417266">The value ranges from 0 to 65535.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row1040494319212"><td class="cellrowborder" valign="top" width="20.919999999999998%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0011__p740414312213">protocol</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="12.29%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0011__p34041343627">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.02%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0011__p1440414314215">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="49.769999999999996%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0011__p1740415431329">Specifies the protocol type. Currently, TCP, UDP, and ANY are supported.</p>
|
|
<p id="nat_api_0011__p2404114317211">The protocol number of TCP, UDP, and ANY are 6, 17, and 0, respectively.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="note" id="nat_api_0011__note10119141914174"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="nat_api_0011__p1848314217198">To map all ports, set <strong id="nat_api_0011__b430725812556">internal_service_port</strong> and <strong id="nat_api_0011__b1717817435613">external_service_port</strong> to <strong id="nat_api_0011__b13993418165615">0</strong> and <strong id="nat_api_0011__b744142625612">protocol</strong> to <strong id="nat_api_0011__b480693385615">ANY</strong> or <strong id="nat_api_0011__b1737743714561">0</strong>.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="nat_api_0011__section4576293817529"><h4 class="sectiontitle">Response</h4><p id="nat_api_0011__p3983154015215"><a href="#nat_api_0011__table4946919917549">Table 3</a> lists response parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0011__table4946919917549"></a><a name="table4946919917549"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0011__table4946919917549" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameter</caption><thead align="left"><tr id="nat_api_0011__row3265693817549"><th align="left" class="cellrowborder" valign="top" width="24%" id="mcps1.3.4.3.2.4.1.1"><p id="nat_api_0011__p2796632617549">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="28.000000000000004%" id="mcps1.3.4.3.2.4.1.2"><p id="nat_api_0011__p5067993017549">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="48%" id="mcps1.3.4.3.2.4.1.3"><p id="nat_api_0011__p5371412517549">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0011__row5587684317549"><td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.4.3.2.4.1.1 "><p id="nat_api_0011__p2973040117549">dnat_rule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.000000000000004%" headers="mcps1.3.4.3.2.4.1.2 "><p id="nat_api_0011__p5935228017549">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="48%" headers="mcps1.3.4.3.2.4.1.3 "><p id="nat_api_0011__p4468272717549">Specifies the DNAT rule object. For details, see <a href="#nat_api_0011__table1730611321529">Table 4</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0011__table1730611321529"></a><a name="table1730611321529"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0011__table1730611321529" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Description of the <strong>dnat_rule</strong> field</caption><thead align="left"><tr id="nat_api_0011__row1530623213215"><th align="left" class="cellrowborder" valign="top" width="24.152415241524153%" id="mcps1.3.4.4.2.4.1.1"><p id="nat_api_0011__p78428281539">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="28.072807280728075%" id="mcps1.3.4.4.2.4.1.2"><p id="nat_api_0011__p6842132819314">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="47.774777477747776%" id="mcps1.3.4.4.2.4.1.3"><p id="nat_api_0011__p1384232814313">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0011__row183067321216"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p1684216281036">id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p1884242812310">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p08422281337">Specifies the DNAT rule ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row530610328215"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p10842228633">tenant_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p1284214286314">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p1842172811317">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row1230612322216"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p68422281533">nat_gateway_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p7842028439">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p188422286314">Specifies the NAT gateway ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row93061232920"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p18429281134">port_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p19842152810314">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p145561716582">Specifies the port ID of an ECS or a BMS. This parameter is used in the VPC scenario. This parameter and <strong id="nat_api_0011__b1597534911434">private_ip</strong> are alternative.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row93061325220"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p384216281635">private_ip</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p1384220280311">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p1247121916108">Specifies the IP address of a Direct Connect connection.</p>
|
|
<p id="nat_api_0011__p192471019141012">This parameter is used in the Direct Connect scenario. This parameter and <strong id="nat_api_0011__b8607127593">port_id</strong> are alternative.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row930619322026"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p1984218280319">internal_service_port</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p11842928334">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p284210281312">Specifies the port used by ECSs or BMSs to provide services for external systems.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row0306133219211"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p1184216281632">floating_ip_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p1484210288313">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p384214281237">Specifies the EIP ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row1530611323214"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p745117426320">floating_ip_address</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p545119422037">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p12451642538">Specifies the EIP.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row1130693214212"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p245164217314">external_service_port</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p134512421939">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p16451144211314">Specifies the port for providing external services.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row530618321326"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p12451342037">protocol</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p74515424310">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p74511242439">Specifies the protocol type. Currently, TCP, UDP, and ANY are supported.</p>
|
|
<p id="nat_api_0011__p1445110421435">The protocol number of TCP, UDP, and ANY are 6, 17, and 0, respectively.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row1630620322219"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p1445104217312">status</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p124515425318">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0011__ul2045134211310"><li id="nat_api_0011__li184511742731">Specifies the status of the DNAT rule.</li><li id="nat_api_0011__li64513421033">For details about all its values, see <a href="nat_api_0042.html#nat_api_0042__table1390614366107">Table 1</a>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row14306173212214"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p945116428311">admin_state_up</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p1764614265487">Boolean</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><ul id="nat_api_0011__ul71858556358"><li id="nat_api_0011__li132051838164415">Specifies whether the DNAT rule is enabled or disabled.</li><li id="nat_api_0011__li12205203804411">The value can be:<ul id="nat_api_0011__ul16205638124410"><li id="nat_api_0011__li16206163884415"><strong id="nat_api_0011__b2017512911216">true</strong>: The DNAT rule is enabled.</li><li id="nat_api_0011__li102063382449"><strong id="nat_api_0011__b8164810229">false</strong>: The DNAT rule is disabled.</li></ul>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0011__row143061032627"><td class="cellrowborder" valign="top" width="24.152415241524153%" headers="mcps1.3.4.4.2.4.1.1 "><p id="nat_api_0011__p184511342035">created_at</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.072807280728075%" headers="mcps1.3.4.4.2.4.1.2 "><p id="nat_api_0011__p145144217316">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="47.774777477747776%" headers="mcps1.3.4.4.2.4.1.3 "><p id="nat_api_0011__p0948172916015">Specifies when the DNAT rule is created (UTC time). Its value rounds to 6 decimal places for seconds. The format is yyyy-mm-dd hh:mm:ss.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="nat_api_0011__section956164017620"><h4 class="sectiontitle">Examples</h4><ul id="nat_api_0011__ul598011172223"><li id="nat_api_0011__li5980201713220">Example request<ol id="nat_api_0011__ol48611172310"><li id="nat_api_0011__li198611513230">Create a rule for a specified port.<pre class="screen" id="nat_api_0011__screen3571872317641">POST https://{Endpoint}/v2.0/dnat_rules
|
|
{
|
|
"dnat_rule": {
|
|
"floating_ip_id": "bf99c679-9f41-4dac-8513-9c9228e713e1",
|
|
"nat_gateway_id": "cda3a125-2406-456c-a11f-598e10578541",
|
|
"port_id": "9a469561-daac-4c94-88f5-39366e5ea193",
|
|
"internal_service_port": 993,
|
|
"protocol": "tcp",
|
|
"external_service_port": 242
|
|
}
|
|
}</pre>
|
|
</li></ol><ol start="2" id="nat_api_0011__ol1348418219246"><li id="nat_api_0011__li16484425249">Create a rule for all ports.<pre class="screen" id="nat_api_0011__screen15354175184">POST https://{Endpoint}/v2.0/dnat_rules
|
|
{
|
|
"dnat_rule": {
|
|
"floating_ip_id": "Cf99c679-9f41-4dac-8513-9c9228e713e1",
|
|
"nat_gateway_id": "Dda3a125-2406-456c-a11f-598e10578541",
|
|
"private_ip": "192.168.1.100",
|
|
"internal_service_port": 0,
|
|
"protocol": "any",
|
|
"external_service_port": 0
|
|
}
|
|
}</pre>
|
|
</li></ol>
|
|
</li></ul>
|
|
</div>
|
|
<ul id="nat_api_0011__ul1231205172517"><li id="nat_api_0011__li1323185152514">Example response<ol id="nat_api_0011__ol3908192452512"><li id="nat_api_0011__li8908324142511">Create a response for a specified port.<pre class="screen" id="nat_api_0011__screen17774184318255">{
|
|
"dnat_rule": {
|
|
"floating_ip_id": "bf99c679-9f41-4dac-8513-9c9228e713e1",
|
|
"status": "ACTIVE",
|
|
"nat_gateway_id": "cda3a125-2406-456c-a11f-598e10578541",
|
|
"admin_state_up": true,
|
|
"port_id": "9a469561-daac-4c94-88f5-39366e5ea193",
|
|
"internal_service_port": 993,
|
|
"protocol": "tcp",
|
|
"tenant_id": "abc",
|
|
"created_at": "2017-11-15 15:44:42.595173",
|
|
"id": "79195d50-0271-41f1-bded-4c089b2502ff",
|
|
"floating_ip_address": "5.21.11.226",
|
|
"external_service_port": 242,
|
|
"private_ip": ""
|
|
}
|
|
}</pre>
|
|
</li><li id="nat_api_0011__li420423362519">Create a response for all ports.<pre class="screen" id="nat_api_0011__screen1883114161712">{
|
|
"dnat_rule": {
|
|
"floating_ip_id": "cf99c679-9f41-4dac-8513-9c9228e713e1",
|
|
"status": "ACTIVE",
|
|
"nat_gateway_id": "dda3a125-2406-456c-a11f-598e10578541",
|
|
"admin_state_up": true,
|
|
"private_ip": "192.168.1.100",
|
|
"internal_service_port": 0,
|
|
"protocol": "any",
|
|
"tenant_id": "abc",
|
|
"created_at": "2017-11-15 15:44:42.595173",
|
|
"id": "79195d50-0271-41f1-bded-4c089b2502ff",
|
|
"floating_ip_address": "5.21.11.227",
|
|
"external_service_port": 0
|
|
}
|
|
}</pre>
|
|
</li></ol>
|
|
</li></ul>
|
|
<div class="section" id="nat_api_0011__section5446226317959"><h4 class="sectiontitle">Status Code</h4><p id="nat_api_0011__p56259000195850">See <a href="nat_api_0038.html">Status Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="nat_api_0010.html">DNAT Rules</a></div>
|
|
</div>
|
|
</div>
|
|
|