Posts

Showing posts with the label internet sharing

IP Masquerading - To share internet connection within a private network

So I have this setup, SERVER1 - This connects to the LAN/Internet connection SERVER2 and SERVER3 is connected to SERVER1, where SERVER1 is acting their gateway. So SERVER1 is using CLASS A IP Address, using 10.0.2.45 while SERVER2 and SERVER3 is using CLASS C, having SERVER2 as 192.168.10.2 and SERVER3 as 192.168.10.3 and SERVER1 as their gateway using 192.168.10.1 IP. Server3 has 2 interfaces, one connects to the LAN and one connects to the private network of SERVER2 and SERVER3. So to achieve SERVER2 and SERVER3 must have internet connection, first in SERVER1, login as root and then check if the ip forwarding is enabled by, $> cat /proc/sys/net/ipv4/ip_forward if the result is 1, leave it behind, else, $> echo "1" > /proc/sys/net/ipv4/ip_forward then, do $> iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE I'm not going to explain fully what does the command do, you can check this by doing "man iptables". So the "...