# Sharing connection from Windows to Linux



## MannDude (Mar 17, 2014)

I've got a Windows PC that I literally only use for Netflix. That's it. Well, today my USB wifi adapter for my Linux workstation decided to die, and the wireless device I use for my Windows PC, while it works on my linux desktop, drops the connection from time to time and is too unreliable, especially for work.

Lightbulb comes on in my mind, "Oh, I'll just share the Windows connection with my Linux desktop!"

Did I mention that I absolutely get frustrated everytime I have to use Windows? 

So, here's my setup and how I connect to the net:

I've got a relative next door and with his permission we share a internet connection. Everything is wireless. I don't download or play games, at most I'll stream Netflix in the off hours and the arrangement works quite nice. I do not have direct access to anything.

I've got this Windows 7 PC here, it only exists because I got a good deal on it and the monitor that it came with is far better than my ancient box TV. Buying this instead of a Roku just so I can watch Netflix was preferable to me.

Windows PC connects to the internet next door via wifi.

I want to share that connection with my Linux desktop. I've got a ethernet cable coming from the Windows PC to a Netgear switch, and for sake of testing I then also have my wireless disabled on my linux laptop (not desktop/workstation) and am trying to network these two things together. This way I don't have to keep walking from one side of the room to the other. All the gear and laptop is on my Windows PC desk.

I've read some guides, none of which have been very clear. I only want to share my connection that I get wirelessly, to the devices in my house via ethernet. I don't want to broadcast my wireless signal and have it available to the block. The whole networking sharing setup in Windows is confusing and foreign to me.

Using nmap on laptop to discover the local devices yield zero hosts up.

Any tips and/or advice?


----------



## mojeda (Mar 17, 2014)

Go to network and sharing center
Select your wifi connection
Click Properties
Go to the sharing tab
Check "Allow other network users to...."
In the drop down select your ethernet port
Profit???


----------



## MannDude (Mar 17, 2014)

mojeda said:


> Go to network and sharing center
> Select your wifi connection
> Click Properties
> Go to the sharing tab
> ...


Step 4 doesn't exist.


----------



## mojeda (Mar 17, 2014)

MannDude said:


> Step 4 doesn't exist.


http://windows.microsoft.com/en-us/windows/using-internet-connection-sharing#1TC=windows-7



> The Sharing tab won't be available if you have only one network connection.



Does your ethernet not show up??

Edit:

You can also try stopping and starting the Internet Connection Sharing service.

net stop SharedAccess

net start SharedAccess

In elevated command prompt (start menu type CMD and then press CTRL+SHIFT+ENTER)


----------



## MannDude (Mar 17, 2014)

Apparently not... I'm not sure what I should be looking for. I literally never use Windows so all of this is foreign to me... It "shows" the wireless connection, should it show the Ethernet device in the same panel that it shows that?

I can't ping my laptop and my laptop can't ping my Windows machine.


----------



## nunim (Mar 17, 2014)

If I'm understanding this correctly you just want to bridge your Wireless connection to provide internet via Ethernet. 

Select both connections, right click Bridge Connections. If you're doing this on a long term basis you should look at a dedicated bridge, any DD-WRT router would work.  I actually found a TP-Link that works great for this, I only have WIFI and needed to plug-in a VOIP phone, it was about $12 locally brand new.


----------



## MannDude (Mar 17, 2014)

nunim said:


> If I'm understanding this correctly you just want to bridge your Wireless connection to provide internet via Ethernet.
> 
> Select both connections, right click Bridge Connections. If you're doing this on a long term basis you should look at a dedicated bridge, any DD-WRT router would work.  I actually found a TP-Link that works great for this, I only have WIFI and needed to plug-in a VOIP phone, it was about $12 locally brand new.


"Select both connections"

What do you mean? Can you provide a screenshot by chance?

Like I said, pretend I'm your mother and I know nothing about a computer. This Windows shit is seriously frustrating for me.


----------



## mojeda (Mar 17, 2014)

MannDude said:


> Apparently not... I'm not sure what I should be looking for. I literally never use Windows so all of this is foreign to me... It "shows" the wireless connection, should it show the Ethernet device in the same panel that it shows that?
> 
> I can't ping my laptop and my laptop can't ping my Windows machine.


It should look something like: 



The first one is my wireless card and the second one is my network port on my desktop.

Click the start button, right click "My Computer" and click manage. Go into Device manager and then network adapters. You should see your USB Wifi Adapter, and something "Ethernet Connection" or along those lines. If you don't see the ethernet port then it might be disabled in BIOS??? Otherwise make sure it's enabled by right clicking it and selecting Enable.


----------



## MannDude (Mar 17, 2014)

Ok, I had to reinstall the ethernet card drivers and now Windows knows it exists. Connections bridged.

Still not seeing where I can 'share' the net, though.

Windows PC = 192.168.2.113

Laptop that I am testing = 192.168.2.100

Each device can ping each other. There is a netgear switch between the two.


----------



## mojeda (Mar 17, 2014)

Have you tried doing the commands in one of my previous posts?

Sent from my Nexus 7 using Tapatalk


----------



## MannDude (Mar 17, 2014)

mojeda said:


> Have you tried doing the commands in one of my previous posts? Sent from my Nexus 7 using Tapatalk


Just saw the edit.


```
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>net start sharedaccess
System error 1058 has occurred.

The service cannot be started, either because it is disabled or because it has n
o enabled devices associated with it.


C:\Windows\system32>
```


----------



## MannDude (Mar 17, 2014)

Also, I have my Windows PC, linux laptop (wifi purposely disabled) and my linux workstation all conencted via ethernet now. Each device can ping the other.

Windows has internet, the others do not.

Just posting this for frame of reference so we all know where I am right now.


----------



## nunim (Mar 17, 2014)

MannDude said:


> Also, I have my Windows PC, linux laptop (wifi purposely disabled) and my linux workstation all conencted via ethernet now. Each device can ping the other.
> 
> Windows has internet, the others do not.
> 
> Just posting this for frame of reference so we all know where I am right now.


Bridging the 2 devices should share the net, if they can ping each other than they should have internet.  I'm assuming they're on the same subnet since you're able to ping each other.

Are you using DHCP?  Are you using any kind of Firewall on your Windows box?

Is your switch doing any kind of processing or is truly just a switch?

Post the results of ipconfig /all


----------



## peterw (Mar 17, 2014)

MannDude said:


> Ok, I had to reinstall the ethernet card drivers and now Windows knows it exists. Connections bridged.
> 
> Still not seeing where I can 'share' the net, though.
> 
> ...


Did you changed the default route on the linux pc?


```
route add -net default gw 192.168.2.113
```


----------



## MannDude (Mar 17, 2014)

```
C:\Users\g>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : g-PC
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Network Bridge:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : MAC Bridge Miniport
   Physical Address. . . . . . . . . : 7A-2B-CB-9E-A8-29
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::f8c9:cf00:dfc9:1bc8%28(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.2.113(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Lease Obtained. . . . . . . . . . : Monday, March 17, 2014 2:47:53 AM
   Lease Expires . . . . . . . . . . : Tuesday, March 18, 2014 2:47:53 AM
   Default Gateway . . . . . . . . . : 192.168.2.1
   DHCP Server . . . . . . . . . . . : 192.168.2.1
   DHCPv6 IAID . . . . . . . . . . . : 477768651
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-15-A2-C8-0C-00-1E-2A-36-D6-9D

   DNS Servers . . . . . . . . . . . : 192.168.2.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2001:0:9d38:6abd:14b0:fbff:5d2c:d8f2(Pref
erred)
   Link-local IPv6 Address . . . . . : fe80::14b0:fbff:5d2c:d8f2%13(Preferred)
   Default Gateway . . . . . . . . . : ::
   NetBIOS over Tcpip. . . . . . . . : Disabled

Tunnel adapter isatap.{50135F2D-2808-4A59-B10C-23D10B5BFD08}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

C:\Users\g>
```


----------



## nunim (Mar 17, 2014)

Are the other PC's getting a DHCP IP ?  I would assume so if you can ping them which would make me suspect firewall/something with the Windows box or bad DNS servers.


----------



## eva2000 (Mar 17, 2014)

scratches head... buy a new usb wifi adaptor ???


----------



## MannDude (Mar 17, 2014)

Windows PC can ping the gateway.

Linux PC can not ping the gateway

Linux PC can pings Windows PC

Windows PC can ping Linux PC


----------



## MannDude (Mar 17, 2014)

eva2000 said:


> scratches head... buy a new usb wifi adaptor ???


The one I have works on Linux but I literally get 1/10th the speed and it drops the connection often. I work a regular job remotely and can't have an unstable internet during my shift. I'm ordering a new adapter, but for now I need to get something rigged up.


Alternatively I could perhaps bridge the connection from my Linux laptop direct to my Linux PC... but that negates the point of having the laptop as I'd have to keep it on my desk so I can connect it via ethernet to my PC... Though I'd probably have to start a new thread for that too.


----------



## nunim (Mar 17, 2014)

MannDude said:


> Windows PC can ping the gateway.
> 
> Linux PC can not ping the gateway
> 
> ...


Have you tried removing the switch and plugging the Linux PC directly into the Winblows one?  It's unlikely that it's the problem but lowering the number of variables involved is always useful.


----------



## MannDude (Mar 17, 2014)

Firewall disabled completely... I know nothing about Windows and unsure if this is a very bad idea or not... I don't want the PC to be accessible to those in the neighborhood....

Removed the switch, ethernet cable barely long enough to connect the two without it in the middle. Was worried I was going to have to re-arrange and since it's 5AM that would have been me just going to bed instead.

Any ideas now? Linux PC can't ping the gateway but it can ping the Windows PC. Windows PC can ping the gateway. And the Windows PC and Linux PC can ping each other. Still no net on the Linux PC though. I'm still looking into it as well.


----------



## peterw (Mar 17, 2014)

MannDude said:


> Firewall disabled completely... I know nothing about Windows and unsure if this is a very bad idea or not... I don't want the PC to be accessible to those in the neighborhood....


My assumption would be that it is a routing issue. The connection sharing should be using a different subnet for the link from the pc to the linux machine.


----------



## MannDude (Mar 17, 2014)

I wouldn't even know where to begin with diagnosing a routing issue. Networking is one of my major weaknesses, throw a Windows box in the mix and that's just a recipe for hearing me cuss 

If it was just a basic setup with my raspberry pi and my linux desktop and laptop, I'd be good to go.  This is just frustrating though


----------



## eva2000 (Mar 17, 2014)

MannDude said:


> The one I have works on Linux but I literally get 1/10th the speed and it drops the connection often. I work a regular job remotely and can't have an unstable internet during my shift. I'm ordering a new adapter, but for now I need to get something rigged up.
> 
> Alternatively I could perhaps bridge the connection from my Linux laptop direct to my Linux PC... but that negates the point of having the laptop as I'd have to keep it on my desk so I can connect it via ethernet to my PC... Though I'd probably have to start a new thread for that too.


know how you feel considering i work 100% remotely too. I've gone as far as to have a spare router/switches and hdds on hand + mobile wifi router (prepaid sim) and local Brisbane VPS for VPN connections over wifi in case anything fails. Plan for the worse I say 

Can't help with your networking issues, maybe just loan a usb wifi adaptor off a friend or if you have other pcs in the house, cannibalise one even if it's pci-e based from such a rig ?

Or just tell it like it is, and tell work you're having internet/pc problems you need to sort out.

edit: oh you can also just try virtualising your Windows PC and have a linux guest OS on it as backup


----------



## mikho (Mar 17, 2014)

You don't bridge the connection on your windows if you want the linux to use internet over the Windows machine.


In windows it's called ICS or Internet Connnection Sharing. first of the Micrsoft explanation http://windows.microsoft.com/en-us/windows/using-internet-connection-sharing#1TC=windows-7


Here are 4 images how to set it up, http://imgur.com/a/sdsNK the 4tyh image should show a second tab "Sharing" but I only have one NIC in that machine so it is not visible.


You should ofcourse share the wireless connection from your neighbour  not the wired connection.


Using ICS will create a small DHCP server and give your other machines a dynamic IP with gateway and DNS settings to be used internally.


----------



## splitice (Mar 17, 2014)

1. Install VirtualBox & Debian VM

2. Add Bridged network connection with wlan0

3. Add Bridged network connection with eth0

4. Setup VM as a linux gateway

5. Prosper


----------



## MCH-Phil (Mar 17, 2014)

Umm just use ICS 

No need to fool with other crap.

All network connections should be plugged in before completing these steps, wifi on and authenticated + cable to other machine, be it linux/windows/mac/etc.

1.  Go to control panel.

2.  Click Network and Internet

3.  Click Network and Sharing Center

4.  Click Change adapter settings

5.  Right click on the connection you want to share and select properties.

6.  Click sharing tab

7.  Click allow other network users to connect through this computers internet connection.

You should be able to select what network connection to share the original with and should be good from here.  No command line bs or route management.  I personally use this on many machines across many OS and there are no issues etc.

For those who said to create a bridge, that will work but he would need to setup a static IP on the machine being shared too and the gateway should be the windows PC IP.  Should not need to set a route, with proper gateway, it's all automagic since god knows when.  Windows does not send DHCP over the bridge etc.  ICS handles DHCP and etc all by itself.

Edit:  If you want to drop me a PM sometime I can set it up for you over remote.  If you're comfortable.  OR if these steps do not work, let me know what version of windows and I will provide you new instructions.


----------



## mojeda (Mar 17, 2014)

@MannDude

Right click My Computer again, go to manage -> Services and Applications -> Services. Find "Internet Connection Sharing," right click and go to properties.

It should look like:


----------



## MannDude (Mar 17, 2014)

mikho said:


> You don't bridge the connection on your windows if you want the linux to use internet over the Windows machine.
> 
> 
> In windows it's called ICS or Internet Connnection Sharing. first of the Micrsoft explanation http://windows.microsoft.com/en-us/windows/using-internet-connection-sharing#1TC=windows-7
> ...





MCH-Phil said:


> Umm just use ICS
> 
> No need to fool with other crap.
> 
> ...


"Sharing" tab doesn't exist, despite the fact but the wireless and wired network adapters appear. I checked both, and the bridged connection, none of which have this option.



mojeda said:


> @MannDude
> 
> Right click My Computer again, go to manage -> Services and Applications -> Services. Find "Internet Connection Sharing," right click and go to properties.
> 
> It should look like:


Thanks, I've located that but it fails to start 


The Internet Connection Sharing (ICS) service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs

Elsewhere I read:


Start Orb > Computer > right-click and choose Manage
Double click "Services and Applications"
Double click "Services"
Scroll down to "Internet Connection Sharing" and double-click on it
On the "General" tab, set the Startup Type to "Automatic"
Click "Apply"
Click the "Recovery" tab
Click the "Subsequent Failures" button and select "Restart the Service"
Ensure that "Restart service after" is set to 0 minutes
OK out and close Computer Management
You should have the sharing tab now on the Properties of your Wireless
Connection

That doesn't work, either. 

At this point any article I locate on the subject is just re-written or the same information as other articles as well.


----------



## tonyg (Mar 17, 2014)

Instead of sharing the windows connection, why don't you just connect directly to your relative's router with each device.

It will certainly be easier and less cluttered.


----------



## MannDude (Mar 17, 2014)

tonyg said:


> Instead of sharing the windows connection, why don't you just connect directly to your relative's router with each device.
> 
> It will certainly be easier and less cluttered.


For a number of reasons. I don't have an ethernet cable that long, and the house I live in is ancient, being built in the 1860s~. When electricty was added only 2/4 walls in my living space has outlets. If I were to move everything to the other side of the room to be closer to his house to run a direct wire, that'd mean I'd have extension cords running across the room to the other side.

I've ordered another of these: http://www.amazon.com/dp/B0009N544A/ref=pe_385040_30332200_pe_309540_26725410_item which is exactly what I had before that worked without issue. It'll be here tomorrow.

I'm at my desk now on my Linux PC... the net works, but it just keeps dropping. I've downloaded/installed the drivers for this TP-Link  tl-wn822n usb wifi adapter, the internet "works" but at 1/10th the speed and 1/10th the reliability. It's extremely frustrating. Mondays are always super busy and I'm not looking forward to having this disconnecting me several times an hour.

I'd work from the Windows machine if I didn't hate Windows so much. I'd have to find some alternative programs to use for it, and anytime I do that I always find my homepage in my browsers have changed and everything wants to install some 3rd party misc. BS that would never come pre-packaged in a Linux version.

Oh, and while my network is in shambles my PC is apparently dying. Listen to the sound it consistently makes as of yesterday:

https://www.youtube.com/watch?v=QSPnIxT73tg

When it rains, it pours. Either a drive or fan or something is crawling to it's death in there.


----------



## tonyg (Mar 17, 2014)

I meant connect via wireless directly to the router.


----------



## MannDude (Mar 17, 2014)

tonyg said:


> I meant connect via wireless directly to the router.


Well, that's what I have been doing. Wireless card on Linux PC died. I've had it for... gosh, probably 8 years now.

And since I have a wireless card for the Windows box, I yanked it and am trying to use it on my Linux desktop. I'm posting form my Linux desktop now, connected directly to the nextdoor router... but I'm not sure why, it's getting 1/10th the download speed (about 1Mb/s) from the net and drops my connecting 2 or 3 times an hour. I've tried reinstalling the drivers for it with no real luck. At one point I ran a speed test and got my normal speeds, but that was once... and perhaps it was only during an alignment of particular planets as it's not happened since and i'm back to the instability and poor speeds.

I've ordered a replacement USB stick wifi device for my Linux workstation, the one I had before worked just fine and without any issue for many years on many different Linux distros. The frustration will hopefully stop tomorrow.

Unsure why I am unable to obtain the 'Sharing' tab in Windows for the network devices. Though hopefully after tomorrow I can just go back to using that PC for Netflix.

Also started to try to ssh tunnel my Linux PC connection via ethernet, connected to my Linux Laptop that connects to the net wirelessly... but no go on that. I know it can be done, because I had a similar setup for my non-wireless Raspberry Pi... but I ran out of time before I had to clock into work.


----------



## mojeda (Mar 17, 2014)

> Start Orb > Computer > right-click and choose Manage
> 
> Double click "Services and Applications"
> 
> ...


 

or

 




> I solved this problem with these steps:
> - create a bridge between your LAN connection and your Wireless connection
> 
> - remove the bridge
> ...


You can create a bridge by going back to network and sharing center, on the left click change adapter settings.

Select both of your adapters (wifi and ethernet), right click one of them and click create bridge. After it makes the bridge select both adapters again, right click and click remove bridge.'

OTHERWISE...

No idea, welcome to Winblows!


----------



## mikho (Mar 17, 2014)

Do you have a static IP on the LAN connection?


Firewall disabled on both NICS?


Is it the built in wifi NIC you are using? whats the brand of the NIC or laptop(?)


You need two enabled AND connected network connections, none of them should be bridged.


----------



## MCH-Phil (Mar 17, 2014)

ICS is broke, there is a fixit IIRC out there for ICS issues.  ICS won't work if service can't / won't start.  Sorry I couldn't be of more help.

Just a thought, I'm too lazy to type.  C&P inbound.

Have you checked the dependency services for the ICS service to make sure they are running?

To resolve this issue, make sure that all dependant services have been started. To do this, follow these steps: 

Click Start, Computer, Administrative Tools, Services.

Make sure all the following services are started.


----------



## MannDude (Mar 22, 2014)

By the way, I got this fixed.

Had some time today after work to mess with it, and turns out all I had to do (as suggested) was disable the bridge, which that allowed me to select sharing options for the wireless device.

Thanks everyone!


----------



## eva2000 (Mar 22, 2014)

glad that worked out ! now just have backup hardware for the future hehe


----------



## mikho (Mar 22, 2014)

MannDude said:


> By the way, I got this fixed.
> 
> 
> Had some time today after work to mess with it, and turns out all I had to do (as suggested) was disable the bridge, which that allowed me to select sharing options for the wireless device.
> ...


Nice


----------



## MannDude (Mar 22, 2014)

eva2000 said:


> glad that worked out ! now just have backup hardware for the future hehe


Well, I ordered a replacement Netgear WG111v2 adapter the day I started this thread and had it show up the next day. That's the wireless device I had on my linux box and it served me well for many many years. Though eventually the USB plug got disconnected from the actual device. Sadly the new one either needs to be replaced or I've got other issues, as it doesn't perform as the old one did. Reliability on it is the same using the other wireless device that the Windows PC uses. Unsure what's up with my workstation PC and wireless, it seems that out of nowhere it wants to function very poorly whereas before it worked fine. I've not ran any updates in a long time, so nothing on my end has changed and everything worked without issue up until the old one became physical broke.

<shrugs>


----------



## mikho (Mar 22, 2014)

Perhaps it wasn't the old one that broke? And the issue is with the box itself and this is as "good as it gets" with that brand because of drivers etc....


----------



## MannDude (Mar 22, 2014)

mikho said:


> Perhaps it wasn't the old one that broke? And the issue is with the box itself and this is as "good as it gets" with that brand because of drivers etc....


Nah, the old one physically broke. It's about 5 or 6 years old, and I have these slanted USB ports on top of my PC that are at like a 45 degree angle... So the device sticks up at that angle. A number of times my cat had jumped on top of my PC. It's been bending the USB plug for years, though it still stayed soldered to internals of the USB wifi adapter until recently. The one I ordered was the exact same model, so technically I'd imagine it'd work just as the previous one did prior to it breaking. I've not really had time to diagnose it yet. I'll reinstall the drivers, I'm thinking maybe I goofed something up when trying to get the wifi-adapter from the Windows PC to work properly on my Linux box and likely did... something. <shrugs>


----------



## mikho (Mar 22, 2014)

Good luck  theres always something to do.


----------

