Internet Connection Sharing through Linux 9
I have three computers in my College Computer Lab. I have installed Linux 9 in one computer and attached the modem to this computer. I want to share Internet connection through it in my LAN.
The details of my LAN setup are as follows :- Workgroup : workgroup Computer 1:- ( Modem Installed In this Computer) Name : comp1 IP Address : 192.168.0.1 OS : Linux 9 Computer 2 :- Name : comp2 IP Address : 192.168.0.2 OS : Linux 7.2 Computer 3 :- Name : comp3 IP Address : 192.168.0.3 OS : Windows 98 / 2000 How can I Configure my Machines? Or What setting I have to Do in My Computers. So that, I can Access Internet Connection in my LAN.:confused: |
The simplest method of sharing an internet connection is to use the kernel to do all the work. First edit /etc/sysctl.conf and make sure that net.ipv4.ip_forward = 1. Next "echo 1 >/proc/sys/net/ipv4/ip_forward".
The firewall rule you need to use is "iptables -t nat -o ppp0 -j MASQUERADE" assuming that you have a dialup connection. If you use an always-on connection where your IP is fixed then use "iptables -t nat -o <internet-side_interface> -j SNAT --to <interface_ip_address>". Then set 192.168.0.1 as the default gateway of your other two machines. To handle DNS, use dnsmasq. This sets up a DNS server which relays all requests to your internet DNS servers and will notice if their addresses change. It is very simple to compile and install. Then set 192.168.0.1 as the primary DNS server for the other two machines and you should be able to connect to the internet from all of your machines. |
All times are GMT -5. The time now is 09:19 PM. |