I have finally finished what I set out to do: Share a DSL connection
on all of my home PCs. I will outline the steps here so that others
can replicate it if required. (Experts, please feel free to point out
errors):

Problem statement: You have a Linux machine connected to the internet
via a DSL  connection. You also have another PC at home (a WinXP PC
for the purpose of this cheatsheet). You want that PC to share the
internet connection with your Linux machine. Please note that whenever
I say "Linux", I really mean Fedora Core 3 and I have tried these
steps with Fedora Core 3. The steps should work with other distros as
well.

Solution:
Step 1: Buy (or otherwise acquire) a network card and fit it into the
PCI slot of your Linux Machine.

Step 2: Boot your Linux machine and let the hardware detection program
(Kudzu) detect your card and install the drivers for it.

Step 3: Buy a 'switch' or a 'hub'. Connect the new network card on
your Linux machine to the hub. Also connect your other computer to the
hub.

Alternative Step 3: Don't use a switch. Instead, use a 'crossover
cable' to connect the new network card on your Linux machine with the
network card on your WinXP machine. This is useful if you only have
one other computer that you want to connect to the internet. I have
not tried this, but I believe this will work. I still recommend going
with a switch.

Step 4: FC3 will have configured your new network card as 'eth1'. Use
the following command to configure eth1:
ifconfig eth1 192.168.0.1 netmask 255.255.255.0

Step 5: Configure your windows machine as follows:
IP Address: 192.168.0.2 
NetMask: 255.255.255.0
Gateway: 192.168.0.1 (your Linux Machine)

If you add another machine to the hub/switch, you can assign it the IP
address 192.168.0.3 and so on.

Step 6: Make sure you can 'ping' from one machine to the other.

Step 7: Configure IP forwarding on your Linux Machine using the
following commands:
   iptables --flush                                   
            
   iptables --table nat --flush
   iptables --delete-chain                            
            
   iptables --table nat --delete-chain

   # Set up IP FORWARDing and Masquerading
   iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
   iptables --append FORWARD --in-interface eth1 -j ACCEPT         -
Assuming one NIC to local LAN

   echo 1 > /proc/sys/net/ipv4/ip_forward

(Please 
refer:http://www.yolinux.com/TUTORIALS/LinuxTutorialIptablesNetworkGateway.html)

Step 8: Configure DNS on your Windows machine. Run the following
command on your Linux machine:
   cat /etc/resolv.conf
>From the output of the entries, pick out the 'nameserver' entries and
specify these entries in the network configuration box on your windows
machine.

Step 9: Run internet explore on your windows machine and browse the web :-)

Thanks to everyone on the list for all the help,

Prashant Verma
-- 
http://www.saltlakesoft.com
[EMAIL PROTECTED]


--
To unsubscribe, send mail to [EMAIL PROTECTED] with the body
"unsubscribe ilug-cal" and an empty subject line.
FAQ: http://www.ilug-cal.org/node.php?id=3

Reply via email to