Hey guys, I've written a short tutorial on how to connect a linux computer (Debian) to the internet with only one internet connection available on a windows box.
In this article I'm going to explain how to connect two computers to the internet with one internet connection. I needed to do this because I have one Linux box on my room and one Windows XP computer. The problem is that I have only one network cable leading to my room. Luckily Windows XP has a nifty feature called Internet Connection Sharing.
I had to install a second network card first to get a connection between the linux and windows computer. I used a cross bridged cable to connect them. Once the physical connections were made, I booted into my windows XP computer and opened the Network Connections window. I double clicked on the card I want to use for the actual internet connection and activated ICS in the advanced tab. Make sure the TCP/IP settings are set to "obtain an IP address automatically". This makes sure it uses the DHCP server to get the IP address.
This is what you should see:
Next I double clicked the card I want to use for the connection between the windows and linux computer and made the IP address 192.168.0.1. Make sure this address doesn't exist on your network otherwise you'll get problems.
Then on the linux box, open "/etc/network/interfaces" in your favourite text editor. This is what you should see (nevermind the loopback connection):
auto lo eth0
iface eth0 inet dhcp
Change this to:
auto lo eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
So this is what you should see now:
Save everything and now open "/etc/resolv.conf" in the text editor. Comment out all the lines and add this line "nameserver 192.168.0.1". Now it should like something like this:
Save the changes and exit the text editor. Back in the shell reboot the network by typing "/etc/init.d/networking restart". When the network has been rebooted, try ifconfig to check your settings:
Now "ping 192.168.0.2". If you are getting results your loopback connection is good. Press CTRL-C to stop the pinging. Now "ping 192.168.0.1". If this works your connection between the linux and windows box is established. And as for the last test, "ping www.google.com". If this gives results your internet connection has been shared and you can now access the internet with two computers!