November 21, 2024, 04:36:43 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: internet sharing  (Read 5964 times)

Offline kishoreadc

  • New Member
  • Posts: 1
internet sharing
« 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?

Offline kaushalpatel1982

  • LST CareTaker
  • Linux Learner
  • *****
  • Posts: 87
Re: internet sharing
« Reply #1 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.