Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Network Troublshooting => General Networking Support in Linux => Topic started by: kishoreadc on July 15, 2009, 10:56:45 AM

Title: internet sharing
Post by: kishoreadc on July 15, 2009, 10:56:45 AM
i have one LINUX server which is connected to broadband net connection,clients are in WIN-XP.i want to share internet, only some systems in my LAN. what can i do?
Title: Re: internet sharing
Post by: kaushalpatel1982 on September 23, 2009, 02:29:24 PM
You have mentioned your basic requirement of sharing internet only. I assume that you dont what to do content filtering or not want to use any proxy server.

You can use IPTables to do this.

Step 1 : Open your /etc/sysctl.conf. Change "net.ipv4.ip_forward = 0" to "net.ipv4.ip_forward = 1" and save.

Step 2 : make sure your iptables service should running using "service iptables status"

Step 3: Use following command repetitively for your host for internet access using root user :

# iptables -t nat -A POSTROUTING -s <IP Address of the host/32> -o <Out interface> -j MASQUERADE

after adding all your hosts, once check all host that added have internet access and other should not have. Then save the iptables you added using command "service iptables save"

that's it. Best of luck.