Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I apologise if this question has been asked before, but I am not exactly sure what I should be looking for, hence my reason for posting a new question.

I am a newbie to Linux and have been using Linux Mint 11 for the past few days on a 2GB USB pen drive to test it out

My problem is to do with connecting to a Windows 7 wireless ad hoc network.

The reason for setting up a wireless ad hoc network in windows 7 is because to connect to the internet we have to use a Softbank 3G mobile USB dongle (Sorry I don't know the proper word for it), but we only have one of them, so our other laptops/devices need to use the main laptop, which is running Windows 7, as a kind of internet access point.

I have setup the the windows 7 wireless ad hoc network and devices like the iPod touch connect to the network and can use the internet without any problem.

But the laptop which is running Linux Mint 11 from a USB pen drive (The HDD is dead) can't connect.

I can see the ad hoc connection in the wireless connections menu and I can click on it and provide a password, but it always fails to connect asking for the password each time it fails.

Does anybody know what the problem could be? Is there any solution to this?

Any help would be greatly appreciated!

And of course if more information is needed please let me know.

share|improve this question

1 Answer 1

up vote 1 down vote accepted
+50

Probably the most common cause for not being able to connect to an ad-hoc network is the capabilities of network driver (or of the card itself). To check if your card+driver configuration does support such connection, follow these steps:

  1. Open up a terminal.

  2. Check, what is the name of your wireless interface by running iwconfig (if you see a message like "not found" or "permission denied", run sudo iwconfig). You will see a list of interfaces, among which at least one will have a longer description (instead of "no wireless extensions.") This is the wireless interface associated with your wifi card. I'll assume from now on that it is called wlan0 - replace that with your interface name.

  3. Run iwconfig wlan0 mode ad-hoc. If you see no error message, the card almost certainly can work in ad-hoc mode with your current driver. To verify that, run iwconfig wlan0 and you should see Mode: Ad-Hoc in the second line of the description. If there were no errors, but you don't see 'Ad-Hoc', then probably something is forcing the card back to Managed mode. I'll get into this later, if necessary.


Once you assured yourself that the card can be used in Ad-Hoc mode, there can be two general reasons why the computer fails to connect:

  • The graphical configuration tool does not set up the connection properly,

or

  • The configuration of that connection from the Windows-7 machine does not allow your connection or disconnects for whatever reason.

It can also be both or neither of course as well. To determine if the cause is on the GUI side, I'd suggest you to try a more generic way of connecting. So first run sudo service network-manager stop to make sure the GUI will not interfere. Next, use iwlist wlan0 scan to get a list of available wireless networks - this is mainly to find what encryption settings your ad-hoc network uses. Also, it lets you easily copy-paste the necessary information about that connection. Using this information, follow the steps described here to connect. You can skip the part about setting channel. Most probably, the network uses other encryption method than WEP, so you should substitute the last step before "Activation" with encryption settings described further in the article.

share|improve this answer
    
Thank you for your answer. I followed your steps and can confirm that none of the commands in terminal yielded any errors. wlan0 is the interface name. It says it is IEEE 802.11bgn. And it let me change the mode to ad-hoc without any problems too. Even after trying to connect to the ad-hoc wireless connection I checked again and it had not switched back to Managed mode. So I can still see the connection but when I type in my password (It's definitely correct) for the connection it still always fails to connect. If you have any other suggestions from here it would be very much appreciated! –  Sour Lemon Oct 18 '11 at 1:42
    
Did you try the command-line method I suggested above? –  rozcietrzewiacz Oct 20 '11 at 10:21
    
Sorry, I didn't notice you had updated your answer. I will try this as soon as possible and comment about the outcome - thank you very much for your time; it's appreciated! –  Sour Lemon Oct 20 '11 at 16:03
    
Brilliant! I followed your steps above and the internet is now working through a wireless ad-hoc connection setup on a windows 7 machine. My last question is, if I want to connect to the internet do I have to go through these steps every time? Or can I create some kind of file which will run all of the required commands for me? Thank you! –  Sour Lemon Oct 21 '11 at 6:32
    
You can either setup your network system-wide (making use of init scripts) and disable the GUI or use the settings you've just verified to fix NetworkManager's settings. The latter you can try to figure out yourself - if you have trouble or it does not work, I'll try to help on chat today in the evening (I'm at work now), since requires a bit more interaction. –  rozcietrzewiacz Oct 21 '11 at 10:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.