View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-25-2003, 01:32 AM   #1
unmesh vaidya
LQ Newbie
Registered: Nov 2003
Location: Mumbai-maharashtra (india)
Posts: 3

Rep: Reputation: 0
Question 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 :
OS : Linux 9

Computer 2 :-
Name : comp2
IP Address :
OS : Linux 7.2

Computer 3 :-
Name : comp3
IP Address :
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:
Old 11-25-2003, 08:32 AM   #2
Registered: Aug 2003
Location: Edinburgh, Scotland
Distribution: Gentoo
Posts: 246

Rep: Reputation: 30
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 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 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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux internet sharing connection with XP des33 Linux - Networking 2 03-10-2005 08:05 AM
linux internet connection sharing usa1234 Linux - Networking 3 10-29-2004 12:27 PM
Sharing Internet connection via Linux 8.0 troyzeng Linux - Networking 1 09-20-2003 03:41 PM
Internet connection sharing between XP and linux kidicarus Linux - Networking 16 09-16-2003 08:05 PM
internet connection sharing in linux anwar_lpk Linux - Networking 2 05-06-2003 02:10 PM

All times are GMT -5. The time now is 10:19 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration