On izCloud, SNAT is turned on in the "NAT and Logging" step of the firewall rule. As the outgoing address you choose the outgoing interface address or an IP pool you defined.
Before you start
- An izCloud service with a firewall
- An active private network (10.1.0.0/24 in this guide) and a server connected to it
- The server's default gateway is the first IP of the network (10.1.0.1)
- A public IP assigned to your service, if you will use the IP pool path
What is SNAT?
SNAT (source address translation) replaces the source address of the outgoing packets of a server on the internal network with the public IP of the firewall. A private address such as 10.1.0.10 cannot be routed on the internet. Without SNAT, the server cannot reach the internet.
Reply packets come back to the public IP. The firewall checks its session table and passes the reply to the right server.
How do you set up SNAT on izCloud?
SNAT is turned on in the "NAT and Logging" step of the firewall rule. There are two options for the outgoing address.
| Option | Outgoing address | When to use it |
|---|---|---|
| Outgoing interface address | The address of the outgoing interface (WAN) | This is the default option. Use it when you do not need a specific outgoing IP |
| IP pool | The public IP or IP range you define | Use it when outgoing traffic must come from specific public IPs |
How do you turn on SNAT with the outgoing interface address?
You write a new rule and turn NAT on. The source is the subnet of your private network. The direction is from your network to WAN.
- On the "Infrastructure → Firewall → Addresses" page, create an address object of the "Subnet" type for 10.1.0.0/24. Example name: web-ag-adres.
- On the "Infrastructure → Firewall → Firewall Policy" page, click the "New Rule" button.
- Type web-cikis in the "Rule Name" field.
- Select "ACCEPT" as the "Action".
- Select your network as the "Incoming Interface (From)" and WAN as the "Outgoing Interface (To)".
- Select web-ag-adres for the source and all for the destination.
- In the "Services and Applications" step, select "ALL" or only the services you need.
- In the "NAT and Logging" step, turn on the "NAT (source address translation)" option.
- Select the "Outgoing interface address" option.
- In the "Summary" step, click the "Save" button.
How do you create an IP pool?
An IP pool is the public IP or IP range that SNAT will use. You create it on the "Infrastructure → Firewall → IP Pools" page.
Only IP addresses assigned to you can be used in the pool. If you have no assigned IP, the panel shows the warning "You have no assigned IP addresses yet".
- Open the "Infrastructure → Firewall → IP Pools" page.
- Click the button to add a new pool; the "New Dynamic IP Pool" window opens.
- Type cikis-havuzu in the "Name" field.
- Select "Overload" as the "Type".
- For the "External IP Range", select 203.0.113.10 as the "Start IP".
- Select the same address as the "End IP".
- Click the "OK" button.
| Field | What to enter | Rule |
|---|---|---|
| Name | cikis-havuzu | Required, up to 100 characters |
| Type | Overload | "Overload", "One to One", "Fixed Port Range" or "Port Block Allocation" |
| External IP Range | 203.0.113.10 – 203.0.113.10 | The Start IP and End IP are chosen from the addresses assigned to you |
| Description | Outgoing traffic of the web network | Optional, up to 255 characters |
How do you use the IP pool in a rule?
After you create the pool, you select it in the NAT setting of the rule. If there is no pool, the rule screen says "No IP pools defined".
- When you write the rule, go to the "NAT and Logging" step.
- Turn on the "NAT (source address translation)" option.
- Select the "IP pool" option.
- Choose the cikis-havuzu pool from the list.
- Finish the rule with the "Save" button.
Example scenario: internet access for the 10.1.0.0/24 network
Your web server is at 10.1.0.10. It needs to download package updates and connect to external services. The single rule below gives all servers on the 10.1.0.0/24 network internet access.
| Field | Value |
|---|---|
| Rule Name | web-cikis |
| Action | ACCEPT |
| Incoming Interface (From) | web-ag (LAN) |
| Outgoing Interface (To) | WAN |
| Source | web-ag-adres (Subnet, 10.1.0.0/24) |
| Destination | all |
| Service | ALL |
| NAT | On, Outgoing interface address |
| Logging | All sessions |
How do you know it works?
The server can reach the internet, and an external service shows the server's public IP address. Run the test from inside the 10.1.0.10 server.
- The rule is "Active" in the Firewall Rules list
- The server can resolve a domain name
- An HTTPS request from the server to an external address gets a reply
- The IP shown by the external service matches the outgoing address you chose
ping -c 4 8.8.8.8
curl -4 https://ifconfig.me
Common problems
If the server cannot reach the internet, first check the default gateway. The gateway must be the first IP of the network (10.1.0.1).
If you see "Incoming and outgoing interfaces cannot be the same.", make sure you selected your network as From and WAN as To.
If you see "Select an IP pool.", choose a pool for "IP pool" in the NAT setting. If there is no pool, first create one on the "IP Pools" page.
The pool form shows the note "Only the ... IP addresses assigned to you can be used." You can select only the addresses assigned to your service.
If ping works but the domain name does not resolve, add DNS (53/UDP) to the service list of the rule or select "ALL".
The NAT option does not appear on a DENY rule. NAT exists only on ACCEPT rules.
Internet access on a service without a firewall
On a service without a firewall, the network works as layer 2 only and servers on this network cannot reach the internet. For internet access, you set up your own firewall or router server and connect its WAN leg to "LAN-Shared" with a public IP.
Frequently asked questions
What is the difference between SNAT and DNAT?
SNAT changes the source address of outgoing traffic and gives a server on the internal network access to the internet. DNAT changes the destination address of incoming traffic and lets an outside user reach a server on the internal network.
Is there a separate page for SNAT?
No. SNAT is turned on in the "NAT and Logging" step of the firewall rule. You go to the "Firewall → IP Pools" page only when you want a specific outgoing IP.
What is the difference between an "Overload" and a "One to One" pool?
With the "Overload" type, many internal addresses share the same public IP using port numbers. With the "One to One" type, each internal address gets its own public IP.
Can I use NAT on a DENY rule?
No. The NAT option exists only on ACCEPT rules.
How do I choose between the outgoing interface address and an IP pool?
If you do not need a specific outgoing IP, the default "Outgoing interface address" is enough. Use an IP pool if outgoing traffic must come from specific public IPs.
How do I test that my server can reach the internet?
Inside the server, try a ping and an HTTPS request to a domain name. An external IP lookup service tells you your outgoing address.