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- Linux machine to act as server
- Two network cards for the server and one for every other computer
- A hub and cables to form a LAN if you don't have one already.
- 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
- Other computers will get ip addresses like 10.0.0.x where x can be 2,3,4... and so on.
- Ping computers to test the set-up.
- 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.
- Configure other computers on your LAN such that their default gateway is 10.0.0.1 (your server's private ip address).
- That's all you need to do ! You should be able to browse from any computer on your LAN.
- 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.
- 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.