Load Balancing using NAT
Share this page:This is a configuration that I´ve never implemented in any production environment, but I see quite a few cases where it can be usefull.
Step 1: Create a POOL of all the INSIDE IPs, and define the pool type: “type rotary”:
(config)#ip nat pool TASK1 10.2.2.1 10.2.2.5 prefix-length 24 type rotary
Step 2: Define an ACL with the Inside Global IP (the one we´re NAT-ing into):
(config)#access-list 1 permit 200.2.2.2
Step 3: Do the inside NAT with the ACL 1 as the DESTINATION list, and the POOL or LOCAL IPs:
(config)#ip nat inside destination list 1 pool ?
WORD Pool name for local addresses
Step 4: Define the NAT inside and outside interfaces, exactly like in case of Static/Dynamic NAT:
(config)#int lo0
(config-if)#ip nat inside
(config-if)#
(config-if)#int s0/1/0.21
(config-subif)#ip nat outside
!!!Be sure that the routing is in place (both, go and return path towards the NAT-ed IP, 200.2.2.2)!!!
Step 5: Make sure that the IP NAT Translations are correct, and that the sources VARY:
#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
tcp 200.2.2.2:23 10.2.2.1:23 131.1.12.1:20186 131.1.12.1:20186
tcp 200.2.2.2:23 10.2.2.2:23 131.1.12.1:25096 131.1.12.1:25096
tcp 200.2.2.2:23 10.2.2.3:23 131.1.12.1:20389 131.1.12.1:20389