Sharing internet connection over a LAN

Do you want to share your ADSL internet connection with other computers on your LAN at home or office ? If your answer is yes, then read on to find out how.

Requirements
  1. Linux machine to act as server
  2. Two network cards for the server and one for every other computer
  3. A hub and cables to form a LAN if you don't have one already.
Steps
  1. Form your LAN - Assign private ip addresses to your computers so that they have identities over your LAN. In this process eth0 of your server gets a private ip address say 10.0.0.1 with netmask 255.0.0.0
  2. Other computers will get ip addresses like 10.0.0.x where x can be 2,3,4... and so on.
  3. Ping computers to test the set-up.
  4. Now, to configure the server for internet-connection on Red Hat, run /sbin/adsl-setup as root. Enter the appropriate values and choose MASQUERADE (option value is 2) for the set-up.
  5. Configure other computers on your LAN such that their default gateway is 10.0.0.1 (your server's private ip address).
  6. That's all you need to do ! You should be able to browse from any computer on your LAN.
Notes
  1. iptables needs to be compiled with your kernel if your kernel does not support it. However, most distributions come with a kernel having support for iptables, you don't have to worry about it.
  2. In older kernels, ipchains was used. It was later replaced by iptables which has more capability. iptables is used for creating firewalls to form a security policy for Local Area Networks.

Back to Linux Tips

More Info

Don't forget to see our Tools' page and linux resources page
For Linux commands see - Useful Linux Tips

gnuServices interests

gnuServices tools...

Report Generation

Open Source

Report Generation is an integral part of enterprise application. We write Shell scripts for automation and Perl scripts for Report Generation of various kinds. More…

Knowledge Base

Website Applications

With Perl, PHP - We use CSS layouts which is the latest trends in web-designing. This has many advantages over the old-school web-design practices. If you would like to learn more about what it is, please visit www.zeldman.com. More…