SNAT stands for Source Network Address Translation, which is a technique used to translate the private IP address of a source host to a public IP address when the host needs to initiate a connection to an external/public host. SNAT is typically used when traffic from a private network needs to go out to the internet. SNAT can be enabled on routers and devices performing NAT, and it can translate the IP addresses of source traffic leaving the fabric.
Here are some key differences between SNAT and DNAT:
- SNAT changes the private IP address of the source host to a public IP address, while DNAT changes the destination address.
- SNAT is used when an internal/private host needs to initiate a connection to an external/public host, while DNAT is used to redirect incoming packets with a destination of public address or port to a private IP address or port inside the network.
- SNAT is performed after the routing decision has been made, while DNAT is performed before the routing decision.
SNAT is commonly used in cloud computing environments, such as Alibaba Cloud and Azure Load Balancer, to map the IP address of the backend to the public IP address of the load balancer and prevent outside sources from having a direct connection to the backend.