GET'>
PUT'>
POST'>
DELETE'>
'>
'>
]>
Configurable external gateway modes extensionBy default, when a gateway is attached to a router using the
Neutron L3 extension, Network Address Translation (NAT) is
enabled for traffic generated by subnets attached to the
router. With this extension, the user will have the option of
choosing whether SNAT should be enabled or not on a router
basis.This is achieved simply by specifying a boolean attribute,
enable_snat, in the
external_gateway_info attribute of the
router resource.This extension redefines the external_gateway_info attribute
as depicted in the following table.
external_gateway_info attributes
Attribute
Type
Required
Default Value
Validation Constraints
Notes
network_id
UUID
Yes
N/A
Must be a valid uuid representative of an external
network.
enable_snat
Boolean
No
True
{True|False}
The default setting is True to
ensure backward compatibility for plugins
supporting this extension.
SNAT can be enabled or disabled at any time on a Neutron
router regardless of the current status of floating IPs.
Floating IPs will continue working even when SNAT is
disabled.List Routers
Verb
URI
Description
&GET;
/routers
Retrieve Neutron routers
Success and error response codes are not changed with
regards to the operation as introduced by the L3 API
extension.When this extension is enabled, this operation will
also return the current Source NAT status for configured
routers, as shown in the sample below.The response for the show router
operation is the same, with the obvious exception that a
single router is returned.Router list with configurable external gateway
modes enabledCreate Router with external gateway
Verb
URI
Description
&POST;
/routers
Create a new Neutron router
Success and error response codes are not changed with
regards to the operation as introduced by the L3 API
extension.Neutron API users can specify whether SNAT should be
performed on the network specified as the router's
external gateway by setting enable_snat
in external_gateway_info to either
True or False;
the default value is True.Create router with SNAT disabledUpdate Router's external gateway info
Verb
URI
Description
&PUT;
/routers/router_id
Create a new Neutron router
Success and error response codes are not changed with
regards to the operation as introduced by the L3 API
extension.Neutron API users can enable or disable SNAT on a router
specifying the enable_snat attribute in
the external_gateway_info attribute for
the router resource. This operation can be either used for
updating the SNAT status only, the external network, or
both attributes at the same time. In any case, if the
enable_snat attribute is not
specified, it will default to True. For
instance, if the current SNAT status is disabled, and the
router's gateway is updated to a different external
network without specifying enable_snat,
SNAT will be enabled for the new network.It is important to note that whenever updating a
router's external gateway information, the
network_idparameter must be
specified always, even if the final goal is just to enable
or disable SNAT for the router on the same external
network.The rest of this section provides some samples for
updating a router's external gateway info with SNAT
mode.Disable SNAT for the current external
networkChange external network and enable SNATChange external network and keep SNAT
disabled