Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Linux and Unix
Tag Cloud
access audio blue screen boot bsod connection crash dell desktop driver drivers dvd email error excel excel 2003 firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor recovery router screen slow sound spyware tdlwsp.dll trojan upgrade vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Tutorial: Connecting linux box to the internet through windows ICS

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
Supernoobs's Avatar
Junior Member with 20 posts.
 
Join Date: Aug 2002
31-Jul-2005, 09:16 AM #1
Tutorial: Connecting linux box to the internet through windows ICS
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!

I Fix 4 U's Avatar
Computer Specs
Distinguished Member with 6,458 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
31-Jul-2005, 09:32 AM #2
Thanx for the info, lotsa people may use it. maybe you will get a sticky or a link to this post mentioned in the linux faq sticky.
lynch's Avatar
Senior Member with 1,962 posts.
 
Join Date: Aug 2002
Location: Back East,Way Back East
31-Jul-2005, 09:50 AM #3
Maybe you could scale down the 1st image so everybody does'nt have scroll sideways to read this thread.
lynch
Supernoobs's Avatar
Junior Member with 20 posts.
 
Join Date: Aug 2002
31-Jul-2005, 11:51 AM #4
ok, sorry, I scaled the first image down.
I Fix 4 U's Avatar
Computer Specs
Distinguished Member with 6,458 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
31-Jul-2005, 11:57 AM #5
Nice now it's perfect.
Supernoobs's Avatar
Junior Member with 20 posts.
 
Join Date: Aug 2002
31-Jul-2005, 12:11 PM #6
thanks for the kind replies iXneonXi, it always feel good to get a positive feedback
lynch's Avatar
Senior Member with 1,962 posts.
 
Join Date: Aug 2002
Location: Back East,Way Back East
31-Jul-2005, 12:20 PM #7
Looking good, supernoobs.
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
31-Jul-2005, 02:08 PM #8
Why not just let the Linux box get an IP address from the Windows Box. When you run ICS, it acts as a DHCP server as well. Are you sharing a Broadband connection? Why not just buy a router?
I Fix 4 U's Avatar
Computer Specs
Distinguished Member with 6,458 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
31-Jul-2005, 02:11 PM #9
Why buy a router when u can save money and do it this way?
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
31-Jul-2005, 02:16 PM #10
Speed and Stability.
1) You are slowing down the computer that is running ICS.
2) We all know ICS is a pain in the @$$ and tends to crap out alot.
3) A less than $20 router is well worth my time.
I Fix 4 U's Avatar
Computer Specs
Distinguished Member with 6,458 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
31-Jul-2005, 02:16 PM #11
Most decent routers I find are over $40.
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
31-Jul-2005, 02:27 PM #12
Quote:
Originally Posted by iXneonXi
Most decent routers I find are over $40.
More power to you then. I am cheap and none of my routers have failed me in over two years. Maybe I am just lucky.
I Fix 4 U's Avatar
Computer Specs
Distinguished Member with 6,458 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
31-Jul-2005, 02:27 PM #13
I like to go with popular names like dlink and linksys.
Supernoobs's Avatar
Junior Member with 20 posts.
 
Join Date: Aug 2002
31-Jul-2005, 07:21 PM #14
Quote:
Originally Posted by Squashman
Why not just let the Linux box get an IP address from the Windows Box. When you run ICS, it acts as a DHCP server as well. Are you sharing a Broadband connection? Why not just buy a router?
I am sharing a broadband connection, but i already got it hooked on a router. What I am doing now is splitting an internet connection once at router level and then a second time in my room using ICS.
I have a spare router lying around but I didn't want to use it because of the instability of the router. It's a dlink but it tends to overheat. I have had nothing but problems with routers and if I would have the room and extra computer I would replace the router with a linux box that acts as a router.

I'm using a static ip address simply because I can. It's easier to remember the static ip address then having to look it up first. Certainly when you plan on connection multiple computers using ICS. But you are correct, I should include the option to use DHCP, I haven't tried this yet though.

Quote:
Originally Posted by Squashman
Speed and Stability.
1) You are slowing down the computer that is running ICS.
2) We all know ICS is a pain in the @$$ and tends to crap out alot.
3) A less than $20 router is well worth my time.
I don't agree with you that a router brings more stability and speed, at least not for the routers i have tried (a dlink and a linksys, so they should be good?). I believe a well configure linux box can bring more stability and speed then most of the routers can, not to mention the extra options.
I haven't had any problems with ICS yet, but I agree with you that the ICS function included in windows XP is not very configurable and could, sooner or later, lead to problems when trying more advanced things.

I haven't noticed a slow down on my windows box yet, but my main purpose is to give the debian computer internet access to download updates and sometimes browse the web. I don't intend to use it for heavy downloading tasks, but I'll let you know if I find a slow down.
I Fix 4 U's Avatar
Computer Specs
Distinguished Member with 6,458 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
31-Jul-2005, 08:11 PM #15
No, a linux box as a router should be great and due to the OS and GUI given, should have much more features than a standard router, which is good and is why companies use linux servers over the choice of using a large router box. My school once had one giant router box but the server now sits there and has many ethernet cables connected to it and the network experiences no slowdowns unless the principal happens to be downloading something.

I just say I've never had problems with my D-Link router, it does get warm, as does my friend's d-link, but we have never had any problems with them.
__________________
My New Year's Resolution is 1280x1024, as my eyes do not support high-def.

"There's no place like 127.0.0.1"
Closed Thread Bookmark and Share

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:57 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.