Description
This article describes how to use the REST API to add an IPv4 Range to the Network Domain SNAT Exclusion list. This can only be done on an Enterprise Network Domain.
Note that the REST client used for demonstration purposes in this article may differ somewhat from yours but the basic functions should be common. Please refer to REST API Client Requirements for the CloudControl API for an overview of the REST client requirements for CloudControl APIs.
Prerequisites:
- User must have Primary Administrator or Network role
- Network Domain id must be valid and belong to the organization
- Network Domain must be in a NORMAL state
- New IPv4 SNAT Exclusions can only be added to an Enterprise Network Domain
- On Essentials/Advanced, users can:
- View and Delete client SNAT Exclusions
- Restore the system default IPv4 SNAT Exclusion List to the Network Domain
- Cannot Add client SNAT Exclusions
- On Essentials/Advanced, users can:
- The Source IPv4 Network Address must be a valid IPv4 address in the form of x.x.x.x
- The Source IPv4 Prefix Size must be a range between /8 and /28 inclusive
- This includes all ranges from /8 to /28, i.e. /9, /10.../27, /28
- The Source IPv4 Network Address and Source IPv4 Prefix Size cannot match any other SNAT Exclusion
- Users can have a maximum of 100 IPv4 SNAT Exclusions per Network Domain, including the System SNAT Exclusions
- The description cannot exceed 255 characters.
Some Ranges are not allowed:
CIDR Block
Usage
Any destination base address of 0.0.0.0 except with destinationPrefixSize of 0 (i.e. 0.0.0.0/0 is ok) 0.0.0.0/0 is valid.
Other prefixes such as 0.0.0.0/1 or 0.0.0.0/10 or 0.0.0.0/24 are NOT allowed
127.0.0.0/8 Loopback 100.64.x.x/28 (the portion associated with the Network Domain) CGNAT Space 169.254.0.0/16 169.254.0.0–169.254.255.255 224.0.0.0/4 224.0.0.0–239.255.255.255 240.0.0.0/4 240.0.0.0–255.255.255.254
Other requirements to use this API function
- Must have a REST client installed on your computer
Network Domain must be Enterprise. See How to Manage a Network Domain Type using REST API
Content / Solution:
Open your desired REST client and Set the HTTP Request to the POST method:
Set the Authorization Type to Basic Auth:
Enter the Username and Password for the Cloud account:
Note: These are the same credentials you use to login to the Updated UI
Navigate to the Headers tab and set the following Headers:
Key: Authorization
Value: Basic
Key: Content-Type
Value: application/json
Enter the API Request URL in the address bar of the REST Client:
https://<Cloud API Host>/caas/2.9/{orgid}/network/addSnatExclusion
Note: The Cloud API Host address can be found in the Support and Additional URLs dashboard. See Support and Additional URLs
Replace "<Cloud API Host>" with the appropriate Cloud API URL, and replace "{orgid}" with your organization ID:
Note: Be sure to remove any brackets around the Cloud API URL and the ORG ID.Navigate to the Body portion of the REST Client, and select "raw":
Enter the body of the API request:
{ "networkDomainId": "043a31ca-3323-4c31-84de-074d69c024b7", "destinationIpv4NetworkAddress" : "10.16.1.0", "destinationIpv4PrefixSize" : "24", "description" : "A Customer SNAT Exclusion" }
Note: Paste the correct values for each input between the quotation marks. Be sure to remove the <angle brackets> from around the inputs
Click Send:
The response will be displayed in the Response section of the REST Client: