LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 01-04-2007, 08:49 PM   #1
rahmmandel
LQ Newbie
 
Registered: Jan 2007
Posts: 23

Rep: Reputation: 15
Talking howto get my linux box to use the internet connection of my windows box?


Hello first

And thanks for any ideas on this. I'm not a network pro but normally I know my way around. Anyway I can't get my linux box to use the same internet connection as my windows box.

The setup (no dhcp servers, all IPs are fixed):

linux (suse 10.0) box, 1 network card, connected to windows box via a LAN-cable (with a switch in between, though I'd like to use a direct connection (crosslink cable))
windows (XP prof.) box, 1 network card + 1 wireless device that connects to the router (and thus internet)

two Networks (c nets afaik:
linux box 192.168.0.70 (NM 255.255.255.0)
windows box nw card 192.168.0.66 (NM 255.255.255.0)

windows box wireless device 192.168.20.55 (NM 255.255.255.0)
Router 192.168.20.1 (NM 255.255.255.0)

Like this the boxes can communicate without probs. The win box has internet. But the linux box has not
what setup could I choose to get the wireless internet connection of the windows box working for the the linux box (preferably without the linux box beeing present in the same network as the windows box)?

Approaches that didn't work :

At first I tried to put them all in one network. Which won't work, because the win box will hand packets for the linux box via the wireless connection to the router and the router does not know of the linux box...
I tried the win xp network bridge. It binds the same IP (192.168.1.2) on both nw devices. Then put the linux box in the same network. Anyway either the connection between the boxes works, or the (wireless) internet connection of the win-box depeding on whether I enter the router as the default gateway on the win box.
In a weak moment I also tried the windows ICS (afaik the only way to make turn an xp box into a gateway) - Anyway it didn't work out. It wasn't able to set the win-box IP to 192.168.0.1, only Bill knows why...


If I connect both boxes to the switch by cable and the switch to the router and put them all in one net 192.168.0.xxx everything works fine. Both boxes can communicate and have internet access. Anyway, I need the wireless connection.
Btw none of the devices or cables is broken or incorrectly installed.

Thank you for any suggestions
 
Old 01-04-2007, 09:09 PM   #2
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 365
Blog Entries: 1

Rep: Reputation: 44
What you are looking for is called IP masquerading. There are several good howto's on it, just search for "IP masquerade" on google.

jrtayloriv

Last edited by jrtayloriv; 01-04-2007 at 09:10 PM.
 
Old 01-04-2007, 09:12 PM   #3
xjlittle
Member
 
Registered: Aug 2003
Location: Indiana
Distribution: fc6 sles9 & 10 kubuntu ubuntu-server
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
Quote:
what setup could I choose to get the wireless internet connection of the windows box working for the the linux box (preferably without the linux box beeing present in the same network as the windows box)?
The above is only going to happen with routing or bridging.

Quote:
Like this the boxes can communicate without probs. The win box has internet. But the linux box has not
OTOH with it setup like this you should be able to set the default gateway of the linux box to the same gateway the windows box uses and all should be well

Quote:
because the win box will hand packets for the linux box via the wireless connection to the router and the router does not know of the linux box...
It'll know of the linux box if you put the linux box on the same network as the router and windows box. BTW this is a standard configuration for a network. Unless you have a really good reason for wanting to put them on separate networks you're making a complicated network out of a configuration that is well documented all over the internet.
 
Old 01-04-2007, 09:34 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
I don't see how you can get this working without ICS. By default Windows is not going to forward packets, which needs to be enabled in order for this sort of thing to work.
 
Old 01-04-2007, 10:12 PM   #5
rahmmandel
LQ Newbie
 
Registered: Jan 2007
Posts: 23

Original Poster
Rep: Reputation: 15
@xjlittle: thanks for your answer, but it is not "the" all-in-one-net-with-the-gateway present standard setup, as the linux box (cable only) cannot be connected to the (wireless) router directly. It is only connected to the win box and if I set the gateway to the router IP on Linux the win box does not perform the NAT/ masquerading.
In the two network setup right now linux wouldn't even be able to reach the gateway (the router).
In a one network setup the win box would have two network devices connected top the same network, which cannot work afaik.


@chort: no offense, but I hope you're wrong...though I am afraid you're not...


So the question still is, is there a way to make the internet connection of the winbox available to the linux box behind it? One network, two networks, (win-XP)bridging, different netmasks...?
As a last resort I am rather sure, that the only way to make windows a gateway (and thus have it to do the NAT/masquerading)is ICS (if I get it running)


BTW, it is not possible to use the wireless adapter on the linux box. Though it would be quite easy to make linux act as a proper gateway for another network/the win box. The tidies solution is thus not an option
 
Old 01-05-2007, 05:08 AM   #6
ojnab
LQ Newbie
 
Registered: Jan 2004
Location: South Coast of England
Distribution: Solaris 7,10,11 Suse 9.3,10 WinXP
Posts: 24

Rep: Reputation: 15
Quote:
Originally Posted by chort
I don't see how you can get this working without ICS. By default Windows is not going to forward packets, which needs to be enabled in order for this sort of thing to work.
Chort is absolutely right. You must you ICS on the Windows box to make it act as a router for your Linux box.

Moving the wifi card to your linux box would be really easy, and Suse supports wifi. You'd still have the switch and the cables exactly the same as before, so why the big problem with it this way round?

Alternatively, you can buy an extra wifi device for your Suse box. I've used PCI wifi cards, USB adaptors, and I've even got a LAN to wifi 5-in-1 router/bridge/AP. All of these devices are very inexpensive these days.
 
Old 01-05-2007, 09:37 AM   #7
rahmmandel
LQ Newbie
 
Registered: Jan 2007
Posts: 23

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ojnab
Moving the wifi card to your linux box would be really easy, and Suse supports wifi. You'd still have the switch and the cables exactly the same as before, so why the big problem with it this way round?
Weeeelllll, I can get the wifi device running on the linux box. That was just a quick way to state that it is not an option.
Thing is, I use the linux box for testing server setups and as a local kind of mirror for a server on the internet. It is thus not always running when the windows box is running. But the win box is always on when the linux box is on. Thus ...
I am also looking for an energy efficient setup. I don't want the (noisy) linux box to run all day. Same goes for the switch or any additional devices (though they are cheap to buy).

Hell I love those emoticons


But I finally got ICS working.
Prob was you cannot set it up on the nw card (though it is meant to be the gateway for the othe network/linux box.
However you can set it up on the device that is connected to the internet. And tataaa it does not set the IP of the wifi device to 192.168.0.1 but the one of the NIC instead. Even more surprisingly windows then finally acts as a proper gateway and performs the NAT/masquerading.
Now isn't that a cute little OS? It does not tell you what it does, its error messages do neither you cant properly configure it, but it works. And it can even do more than it claims! After it has changed the NIC IP to 192.168.0.1 (because "that is the only address ICS will work on" you can change it again to at least another 192.168.0.xxx address and it will still work properly. Oh what a humble piece of software!!!
 
Old 01-05-2007, 10:18 AM   #8
siadam
LQ Newbie
 
Registered: Jan 2007
Location: WV
Distribution: Slackware/Centos4
Posts: 29

Rep: Reputation: 15
I didn't see what type of inet connection you were referring to, so I will assume broadband.

Just get a router to simplify the process.

Good luck.
 
Old 01-05-2007, 06:11 PM   #9
ojnab
LQ Newbie
 
Registered: Jan 2004
Location: South Coast of England
Distribution: Solaris 7,10,11 Suse 9.3,10 WinXP
Posts: 24

Rep: Reputation: 15
Quote:
Originally Posted by rahmmandel
Weeeelllll, I can get the wifi device running on the linux box.
Thing is, I use the linux box for testing server setups ...
I wondered if it was something like that, but wanted to be sure you knew the options
Quote:
But I finally got ICS working.
Prob was you cannot set it up on the nw card (though it is meant to be the gateway for the othe network/linux box.
However you can set it up on the device that is connected to the internet. And tataaa it does not set the IP of the wifi device to 192.168.0.1 but the one of the NIC instead. Even more surprisingly windows then finally acts as a proper gateway and performs the NAT/masquerading.
Now isn't that a cute little OS? It does not tell you what it does, its error messages do neither you cant properly configure it, but it works. And it can even do more than it claims! After it has changed the NIC IP to 192.168.0.1 (because "that is the only address ICS will work on" you can change it again to at least another 192.168.0.xxx address and it will still work properly. Oh what a humble piece of software!!!
Ah yes, I remember ICS working that way. First time I used it a Wintel experienced friend set it up, so second time I configured it I was familiar enough not to notice how difficult it is to interpret M$'s instructions.

Glad you got it working the way you want
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xp-box to share internet connection with linux-box CrazyHorse Linux - Networking 7 09-29-2006 12:05 AM
Inetrnet connection sharing between a Slackware box and windows box planetsheinker Slackware 10 09-24-2006 12:53 AM
Windows XP box losing connection to Linux box after 30 sec. NeoZeus Linux - Networking 3 07-21-2005 01:02 AM
How do get my linux box to use my windows internet connection cypher0002 Mandriva 3 05-18-2004 02:55 PM
can't see internet connection from linux box Peacedog Linux - Networking 15 11-01-2003 10:09 AM


All times are GMT -5. The time now is 10:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration