Re: modem internet sharing

From: Dolphin (usenet-Sep+lr_at_2003.dolphinwave.org)
Date: 09/28/03


Date: 28 Sep 2003 11:20:11 GMT


#begin johhnybravo@in.com.au.exe (or was it Rae Rosetta.com)
 message <a6rdb.1663$U74.94879@news.optus.net.au> reply:
> I have two linux PCs running Red Hat 9 both connect to each other via a hub
> and one
> PC connects to the internet via an external modem.
>
> I set up my PC and modem with Kppp to access the net which does so
> fine but now how do I set up the other PC to access the net sharing the
> other PC's modem.

It's quite simply. All you need is to activate the masquerading on the PC
which is connected to the Internet, and point any other PCs' gateway to
that one.

> The modem PC's settings are:
>
> IP : 192.168.0.1
> SUB : 255.255.255.0
> Should I set the gateway settings to point to itself (ie 192.168.0.1) for
> leave this feild blank?

Leave it blank, it's directly connected to the Internet - no need for
it to be gatewayed through itself.

> The other PC settings are
>
> IP : 192.168.0.12
> SUB : 255.255.255.0
> GATE: 192.168.0.1

Just what you need.

> Both PC's have DNS servers running, do I need these running?

You might want to have it running on the connected to the Internet PC,
and use it as a caching DNS, which will increase the speed of accessing
recently visited sites. You definitely don't need it to be running on
every PC. Just add 192.168.0.1 to the list of nameservers used on your
PCs, and keep the DNS running on your 192.168.0.1 machine.

Now, when your PCs are set, su - on the Internet-connected computer, and
do these commands (I assume you run iptables and that service is up):

modprobe iptable_nat
iptables -t nat -A POSTROUTING -o ppp+ -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward

Now, go to the another PC and watch it being able to access Internet. :)
You can add the commands above to your /etc/rc.local on the 192.168.0.1
PC and they will be executed automatically on every boot.

Keep in mind, that your PCs that will be connected to the internet through
the 192.168.0.1 one, are behind the NAT and can't be directly accessed
from the Internet, without you starting the connection (for example, it is
important for IRC DCC connections coming to you from other people).

> Is there a link that explains how to do this in newbie speak?

There is a "Linux IP Masquerade HOWTO" doc on "The Linux Documentation
Project" (http://en.tldp.org/HOWTO/IP-Masquerade-HOWTO/index.html), if
you want to dive deeper. But it is definitely not an easy reading for a
newbie.

> Thanking all

You are welcome.

Dolphin.

-- 
 URL: http://www.DolphinWave.org
Mail: on the web page (no spam)
 ICQ: 6615461


Relevant Pages

  • Re: Win2k server workgroup problem
    ... This gives you firewall and NAT protection, the PCs will be ... > I am not sure what it is, when I bought it, I was told it is a Hub. ... > I'll stop the firewall and internet. ... > internet connection. ...
    (microsoft.public.win2000.networking)
  • Re: gforth dos/win
    ... I use a dial-up connection, there is no internet connection ... a version of Linux on a laptop, ...
    (comp.lang.forth)
  • Re: Beginner Network Problems
    ... One Linksys Hub - Cable for internet connection. ... All PCs connected to the internet just fine. ... where you can't run the NSW. ...
    (microsoft.public.windowsxp.network_web)
  • RE: Cannot Access Internet from Client PC
    ... I have 2 PCs and I'm trying to access Internet from both.. ... I'm connection to Internet using a Dialup DSL ... Modem and I have a NIC in the Host.. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: file/printer are not shared ....
    ... Both PCs accesses internet well. ... >the PCs, previously set as a host for ICS (internet connection sharing), ...
    (microsoft.public.windowsxp.network_web)

Loading