# DHCP server in Windows not recognised by Linux

## w0kKiD

The situation is as follows:

I had a bright idea to buy a USB wifi adapter so that when I find myself with my laptop at someone's internet-connected computer, but with no wireless router, I could plug the USB adapter into the internet computer and set up a nice ad-hoc connection between the two so my laptop could have internet as well.

I am currently at a friends apartment where I will be for nearly 2 weeks or so and he has a wifi-lacking laptop connected directly to a cable modem and the internet through an Ethernet cable. I installed the USB wifi adapter on his Windows laptop, then successfully created an ad-hoc link, complete with working WEP. 

I then set up Internet Connection Sharing on the LAN connection (that's the one connected to the modem) and that immediately installed a DHCP server on the wireless connection, setting its IP manually to 192.168.0.1 the way Windows does. I put the WEP key into the /etc/conf.d/net file and nothing else because I figured dhcp should do the rest, the way it has before for me at public hot spots. 

I start /etc/init.d/net.ra0 (ra0 is my wireless interface), it connects beautifully and the Windows machine notifies me a connection has been made as well then dhcpcd starts running  - and boom, timeout error, net.ra0 stops, failure. When I set the IP addresses manually in /etc/conf.d/net the way I believe Windows should assign them, net.ra0 connects and stays connected, but there's no working connection in that I can't even ping the windows laptop's IP.

I've tried everything I can thinks of, which isn't really much: I disabled the Windows Firewall on the wireless connection so it wouldn't block the DHCP server, I checked that the DHCP service is selected to run in Windows, and it is. Yet still no connection. Unfortunately, I don't have another Windows laptop to try and connect windows to windows, but I'm sure its my laptop and dhcpcd at fault.

Thanks in advance for any help, and I'm sorry that the post became so long, but I just wanted to get all the info in.

----------

## truc

I don't know how to achieve this in windows, but you could probably do a bridge between the ethernet interface and the USB keys WIFI interface on your friend laptop, then for the router it will be as if your two computers were connected to it (via a hub)

/me doesn't know how to do it your way

----------

## w0kKiD

Unfortunately, the network bridge didn't work out. The Internet stopped working on his laptop, and it didn't work on mine either. The fact is that there isn't really a router, but just this modem which behaves rather oddly, assigning my friends laptop the external IP: 66.something, can't remember now. That means that in effect, I'm turning his laptop into the router, that routes what I might call the 'raw' internet connection found on the LAN Ethernet port to the wireless interface. I hope some more ideas crop up  :Smile:  !

----------

## truc

oh, if the modem is not a router, then you can't really do it my with the bridge.

Your idea was the good one, although I'm not sure the ad-hoc connection was right type of connection to achieve what you want, Try to look if you can turn the laptop into an access point, I know it's possible to do similar things with osx, so there must be a way to do that with windows. Once you've set it up as an acces point, you should also have DHCPd running, and it should work!

Anyway, keep us informed  :Wink: 

----------

## w0kKiD

According to this site:

http://www.microsoft.com/windowsxp/using/networking/expert/bowman_02april08.mspx

An ad-hoc connection should work fine. I researched how to turn a windows xp computer into an access point, but it seems to be impossible. You're right about it being possible on a mac though, I found that site along the way  :Razz: 

The dhcp server is supposed to be run in the background by windows when you enable internet connection sharing, I read that somewhere when researching this but I can't remember exactly where now. It's true though because I saw the DHCP service enabled in some advanced settings dialog on the wireless connection, I think it was for the firewall.

I'll keep on trying stuff!

EDIT: Having tried to make the windows box into an access point, I had to recreate the old adhoc connection which now isn't functioning.... Wifi's a fickle beast, what can I say. I'll keep working!

----------

## Hu

Could you post the exact error message from dhcpcd, ideally with debugging output turned on?  Also, post the output of ip route; ip addr; ip link on the Linux laptop, and specify what version of dhcpcd you are using.

----------

## w0kKiD

Will do as soon as I get back to my friend's apartment, I'm currently on a weekend trip away and writing this in an Internet cafe. I remember that the error was a timeout error, after about 30 seconds I think. I'm not entirely sure how to turn debugging on, don't even think that that USE flag was on, so I'd appreciate a bit of help with that. The dhcpcd version is 3.0.16-r1. I'll get back with the rest in a day or two when I get back.

EDIT: I also just realised I don't have the ip command, and I'm not sure which package I'm supposed to emerge. Please excuse my ignorance.

----------

## augury

I don't think you can do that to a window computer.  That internet sharing shit is a bogus deal.  Can you fileshare?

----------

## augury

It's like $40 for a wifi-router.  If the window is routing then the easy way to find the problem is to see if the wifi works at all on the linux.  I've had wifi cards that would bug out in the driver after about 1mb transfer.

----------

## Hu

/sbin/ip is part of sys-apps/iproute2.  If you cannot emerge it, you can print roughly the same information by running route -n; ifconfig -a.  Both of those commands are part of sys-apps/net-tools, which is most likely already on your system.

----------

