LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Sharing Internet Connection from Windows Machine (https://www.linuxquestions.org/questions/debian-26/sharing-internet-connection-from-windows-machine-368190/)

Eux 09-29-2005 01:35 PM

Sharing Internet Connection from Windows Machine
 
Hi guys,

my question is very simple.......recently I have acquired an 6Mbit ADSL connection at home, the problem is that I have the Kit USB thingy....not Router........yet"!

How can I share an internet connection from an Windows XP PRO SP2 machine so I can connect from my Debian box?

I would kindly request for a detailed - step-by-step guide.

Thanks in advance"!



Eux

zuessh 09-29-2005 01:52 PM

You could use squid. It has very good documentation and is pretty easy to set up. then point the windows box to it as it's proxy and you are good to go. I'm sure there are other solutions.

yanik 09-29-2005 03:23 PM

err, the adsl modem is connected to the winblows or debian box?

Eux 10-01-2005 11:40 AM

Hi,

the adsl is connected to Windows XP Pro SP2...........


Thnx again,


Eux

Coldfish 10-01-2005 01:09 PM

The Usb connection have to be like this:

All the settings is valid for the default gateway ip 10.0.0.2. If your default gw ip is 192.168.1.1 blabla , u have to use that ip for the default gw.

Tcp/ip configuration of USB device for windowsXP :
--------
10.0.0.3
255.255.255.0
10.0.0.2 ----> default gateway.
--------
Dns1
Dns2

Tcp/ip configuration of ethernet device for windowsXP :

Auto(DCHP) is the best or

--------
10.0.0.3
255.255.255.0
empty---->(default gateway)
--------
empty(DNS)

Tcp/ip configuration of ethernet device for windowsXP :

Auto(DCHP) is the best or

--------
10.0.0.4
255.255.255.0
10.0.0.2---->(default gateway)
--------
10.0.0.2(DNS)

I hope it helps ...

farpoint 10-02-2005 11:46 AM

Hi. I'm presuming that you have you're windows machine online now with you're new ADSL USB modem. You will obviously need an NIC (an ethernet pci card) in both your windows machine and the Debian box, unless there already built in on the mobo's of both machines. If you only have 2 machines you can use an ethernet crossover cable to directly connect the two machines. The XP machine is the only one recognisez by you're isp, so you need to trick the isp into thinking that your Debian box is the XP one. For this you will need to use NAT (IP Masquerading) The 2 best tools I have found for this are Guarddog (a GUI firewall config app) and Guidedog (the IP Masqwuerading app) Both available using apt-get install or aptitude install on Debian. As an alternative you can get Firestarter from sourceforge.net, which does the same sort of thing. Guardedog allows you to configure the firewall on the Debian box (which ports to open which ones to leave closed) Read the docs as they explain very clearly how to get onto the net without compromising your machine. Guidedog is really easy for the IP Masquerading, and this just needs to be enabled. I'm only using static IP addresses for my machines (no dhcp) , and am on dialup, so am not too familiar with with ADSL. Right. I havn't been in XP for a while, but have just booted it up. You need local area connection, then Internet protocol (TCP/IP) properties. You should have a DNS server showing here. Write it down so that you can put it on your Debian box. Now I'm not sure what you'll see for the IP address, but if it's the machine thats directly connected to the Internet set it to 192.168.0.1 subnet mask 255.255.255.0 and gateway left empty, as this machine is the gateway. I've got the network connections on my desktop, but the path to it is, Start/Accessories/Communications/Network connections/Local area connection. We'll now go back to the Debian box. You have an ethernet crossover cable connecting form Debians NIC to XP's NIC. I set up my network when I installed Debian and can't find anything to configure it after the install. So we'll go for the under the bonnet way. Open a Konsole, su to root and open a text editor. Gedit,Kwrite, Kate, whatever. Go to /etc/network/interfaces . This is my /etc/network/interfaces for a client machine connected to a Smoothwall Express2 firewall acting as a gateway to the internet with a serial modem using IP 192.168.0.1 as an IP address. See below.

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
address 192.168.0.7
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

iface dsl-provider inet ppp
provider dsl-provider
# please do not modify the following line
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider dsl-provider
# please do not modify the following line
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf

If you've decided to use 192.168.0.1 as your IP address on the XP machine, you need to enter that under Gateway in this file. The IP address of the Debian box is up to you. Anything from 192.168.0.2 to 192.168.0.254 . Mine is 192.168.0.7. Save the changes and exit the editor. Next we need to set the DNS address on the Debian box. Open a Konsole and su to root. Open gedit or another text editor. Go to /etc/resolv.conf. See below for mine.

nameserver 213.36.80.1

There is only one line here, which is my ISP's DNS server. You should have found your's from you're network info from the XP machine. Create the line with your ISP's DNS address, then save and exit the file.
You may find that you have to reboot the machine "windows style" for the network changes to be made.

I can't think of anything else at the moment. Let me know how it goes. Nigel. aka farpoint

Eux 10-04-2005 05:58 AM

Excellent "! Thank you both, Farpoint and Coldfish,...........REALLY thanks a lot.

One minor question, what if my idea was to set up my Linux box to share coonectivity to other computers on my network? How would I do it?


Thnx,


Eux

farpoint 10-04-2005 04:07 PM

Hi. I do need to correct an error I made. If you are using XP for instance as your gateway machine connected to the Internet, IP masquerading is setup using (if I remember correctly) an option regarding Internet connection sharing when configuring the network. You need to check this option, and then other machines will be able to access the Internet through you're XP machine. Guarddog (the firewall GUI interface) and Guidedog (The IP masquerading app) are only needed if you are you are using a Linux machine connected to the Internet, and want to connect other machines to this one, so as to be able to access the net. Back to your question. If your machine connected to the Internet is the XP one, and the other machine is a Debian box, just connect the two machines together with a crossover ethernet cable, making sure that the XP machine has Internet sharing enabled. To connect more machines to you're XP machine that is connected to the Internet, you will have to obtain a hub or switch. Personally I'd suggest a switch (layer 2) . Then you simply use straight ethernet cables to connect the gateway machine to the switch, and from the switch to the different machines that you want to access the \\\\internet through the gateway machine. Using static IP addresses you will have to asign each machine a different address, anything within the range 192.168.0.2 to 192.168.0.254. The gateway address will remain the same as 192.168.0.1 which is the address of the machine connected to the Internet. You also need to set the DNS address on the individual machines accessing the net through the gateway machine. You should have the DNS server address from you're ISP, and in Debian ,for instance, you create in /etc/resolv.conf the line.
nameserver 213.36.80.1 (this is my ISP's nameserver, don't use this one, it won;t work) I'm not saying networking is easy. It isn't. Post back if you have problems, and I;ll try ,if I can, to help. Nigel..


All times are GMT -5. The time now is 04:30 PM.