Using NAT for Server Load Distribution
Problem
You have several application servers and you want to use NAT so that users can connect to them by a single IP address, distributing the load across all of the servers.
Solution
The rotary keyword allows you to do simple NAT-based load balancing of servers:
Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#interfaceRouter(config-if)#FastEthernet0/0ip addressRouter(config-if)#192.168.1.1 255.255.255.0ip nat insideRouter(config-if)#exitRouter(config)#interfaceRouter(config-if)#FastEthernet0/1ip addressRouter(config-if)#192.168.2.1 255.255.255.0ip nat outsideRouter(config-if)#exitRouter(config)#ip nat poolWEBSERVERS 192.168.1.101 192.168.1.105netmask255.255.255.0type rotaryRouter(config)#access-list20permit hostRouter(config)#192.168.1.100ip nat inside destination list20poolRouter(config)#WEBSERVERSendRouter#
Discussion
This example is more applicable to an Intranet than to the public Internet. It shows a simple way of doing load balancing among a group of application servers that all perform the same function. We would like to stress that this load balancing is extremely limited, and if you want a fully featured load-balancing device, you would be much better off with one of Cisco’s Content Services Switches, such as the CSS 11500 series. However, we understand that these devices are expensive, so if your requirements are fairly basic, this recipe provides a simpler ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access