First, let's talk about the server architecture I deployed:
One LVs, one tomcat, one MySQL (pre-deployment).
1, the company gave me a public network IP, in the LVS used this IP, but Tomcat Internet has become a
Problem, here's a solution, hopefully to help you:
The first step: the LVS on a network card is set to public IP, the other piece is set to private network IP (for example, 192.168.1.100).
The second step: the LVS need to turn on the Ip_forward forwarding function. (Note: IP forwarding is to enable multi-host Internet access in the location)
Step three: Tomcat needs to set the gateway to 192.168.1.100 so you can ping the LVS on
The public network IP address, if not, first resolved.
Fourth step: Use Iptables to do Snat on LVS:
Iptables-t nat-a postrouting-s 192.168.1.0/24-o eth0-j SNAT--to-source public network IP
Fifth step: Finally, you need to do a DNS configuration on the machine you need to surf the internet, just add the/etc/resolve.conf
NameServer 8.8.8.8 will be all right.
This article is from the Linux shell blog, so be sure to keep this source http://madaqiang.blog.51cto.com/7955196/1663660
Multi-host internet based on a public network IP