Lets Start..!!
SNAT - Source Network Address Translation, is the method used to change the Source IP address of the incoming packet and send it to the destination server.
Consider the scenario, where a load balancer is configured in between the client and server. and, there is a also a route avaliable for the Server to reach client witout the Loadbalancer say via a switch.
In this case, lets say the client sent a request for a web page that is hosted on the servers via the Load balancer. As the VIP(virtual IP) of the webpage is configured on the loadbalancer, the request reaches the load balancer and then sent to the server.
Now, if the connection speed between the Client-Switch-Server is faster than Client - Load Balancer- Server, then the server will send back the response to the client system via the switch.
If a firewall is configured in the system or before the system, the packet sent by the server to the client will appear as a "new request" instead to look like a response and will be dropped.
The client can never view the web-page.
To aovide this, we go for S-NAT. Now what happens is, when client sends request to VIP on load balancer, it forwards it to the server by changing the source ip in the header of the request packet. (The packet upon reaching the server will appear as it has originated from the Load Balancer.) Now the server sends its response to the load balancer as it never knew that the original requestor is the client system.
The Load balancer then assigns the original ip to the header and sends it to the client.
Good one!
ReplyDeleteGood one, buddy. But, I have one clarification here ie. when the Load Balancer alters the Source IP that it receives from the Client systems as per SNAT. Which source IP will that packet have to send the request to the server? Load Balancer's VIP or some other IP configured on the LB?
ReplyDeleteRegards,
Daniel
dany.integra@gmail.com
Hi Daniel, if the SNAT is set to capture the interface IP, the destination server will see interface IP of load balancer. Admins are also provided with the option to create a new pool of IP's and configure the Pool to be used.
DeleteHope this helps.
Thanks for your comments.
Thanks,
Santosh.
good one.. thanks
ReplyDelete