TCP 负载均衡配置
实验环境:
一台windows server 2003,启用三个IP,配置三个虚拟主机且启用DNS功能。
客户机为windows xp ,DNS指向2003地址。
实验目的:
访问相同域名,使用不同服务器回应,实现负载均衡。
配置:
- R1:
en conf t ip classless ip subnet-zero no ip domain-loo hostname R1TCP int f0/0 ip add 200.0.0.1 255.255.255.0 no sh int f0/1 ip add 192.168.10.1 255.255.255.0 no sh exit access-list 1 permit 192.168.10.10 ip nat pool web 192.168.10.2 192.168.10.4 netmask 255.255.255.0 type rotary ip nat inside destination list 1 pool web int f0/1 ip nat inside int f0/0 ip nat outside end show ip nat trans
- R2:
en conf t ip classless ip subnet-zero no ip domain-lookup hostname R2TCP int f0/0 ip add 200.0.0.2 255.255.255.0 no sh int f0/1 ip add 192.168.1.1 255.255.255.0 no sh exit access-list 10 permit 192.168.1.0 0.0.0.255 ip nat inside source list 10 int f0/0 overload int f0/0 ip nat outside int f0/1 ip nat inside exit ip route 0.0.0.0 0.0.0.0 200.0.0.1 end show ip nat translations
- 测试:
访问相同域名,实现从不同服务器响应,做到负载均衡。
温馨提示:如无特殊说明,本站文章均为作者原创,转载请注明出处!