LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 09-09-2007, 09:42 PM   #1
dhanar_10
LQ Newbie
 
Registered: Jan 2006
Location: Semarang, Central Java, Indonesia
Distribution: Ubuntu 7.10 (Gutsy Gibbon)
Posts: 17

Rep: Reputation: 0
How can I make a wireless ad-hoc connection?


Hi,

How can I make a wireless ad-hoc connection?

I'm now using Ubuntu 7.04 with kernel 2.6.22 (vanilla).

Thx.
 
Old 09-10-2007, 09:09 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
You just need to put the device into Ad-Hoc mode, along with a few other bits of information, something like:

Code:
iwconfig wlan0 mode Ad-Hoc rate Auto channel auto
Then you need to configure both devices with IP addresses in the same subnet, for example, 192.168.1.1 and 192.168.1.2.
 
Old 09-11-2007, 02:59 AM   #3
dhanar_10
LQ Newbie
 
Registered: Jan 2006
Location: Semarang, Central Java, Indonesia
Distribution: Ubuntu 7.10 (Gutsy Gibbon)
Posts: 17

Original Poster
Rep: Reputation: 0
I tried the command you gave me (with a little modification)...

Quote:
sudo iwconfig eth1 mode Ad-Hoc rate Auto channel auto
But I got this...

Quote:
Error for wireless request "Set Frequency" (8B04) :
SET failed on device eth1 ; Invalid argument.
Any ideas? I'm using ipw2200 module from the kernel 2.6.22 (vanilla).
 
Old 09-11-2007, 01:28 PM   #4
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
That means it can't set channel, which isn't actually a big deal.

Try leaving everything off except "mode Ad-Hoc", that is the only thing that is actually required anyway.
 
Old 09-12-2007, 12:45 AM   #5
dhanar_10
LQ Newbie
 
Registered: Jan 2006
Location: Semarang, Central Java, Indonesia
Distribution: Ubuntu 7.10 (Gutsy Gibbon)
Posts: 17

Original Poster
Rep: Reputation: 0
So, after running this command...
Quote:
sudo iwconfig eth1 mode Ad-Hoc
I have to run this command too...
Quote:
sudo iwconfig eth1 essid SSID_NAME
Right?
 
Old 09-12-2007, 07:29 AM   #6
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Yes, it would be a good idea. Some drivers will automatically set a SSID based on the system hostname or the name of the chipset (like RTL818), but it is better to set your own.

Of course, you can also put those two commands together in the form of:

Code:
iwconfig eth1 essid MYNET mode Ad-Hoc
The reason it failed before was not because everything was in one command, but rather, that the specific option was not supported by the driver (or at least, not supported in that scenario; you might be able to change the channel while in monitor mode, for instance).
 
Old 09-12-2007, 10:49 PM   #7
dhanar_10
LQ Newbie
 
Registered: Jan 2006
Location: Semarang, Central Java, Indonesia
Distribution: Ubuntu 7.10 (Gutsy Gibbon)
Posts: 17

Original Poster
Rep: Reputation: 0
I have run the command...

Quote:
iwconfig eth1 essid MYNET mode Ad-Hoc
But it seems that it sometimes works, sometimes not....

I'm now currently using NetworkManager to connect to other wireless network.
Is it possible that NetworkManager is interrupting the command?
 
Old 09-13-2007, 01:36 AM   #8
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Possibly, but it could also be that your drivers don't have complete support for Ad-Hoc mode. One of my cards only partially supports Ad-Hoc, for instance.
 
Old 09-16-2007, 08:21 PM   #9
dhanar_10
LQ Newbie
 
Registered: Jan 2006
Location: Semarang, Central Java, Indonesia
Distribution: Ubuntu 7.10 (Gutsy Gibbon)
Posts: 17

Original Poster
Rep: Reputation: 0
What do you mean by partially?
What's working? What's not working?

May I know the the card that you use?

Sorry for the late reply.
 
Old 09-17-2007, 03:38 AM   #10
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
The RTL8180 drivers I use only have tentative Ad-Hoc support. Generally it works alright, but sometimes it simply refuses to connect, or I will get lost packets. Occasionally the kernel will even crash, depending on the machine's mood, alignment of the planets, that sort of thing.
 
Old 09-17-2007, 04:13 PM   #11
jabka
Member
 
Registered: Sep 2005
Distribution: Debian unstable && Kazit (reformated knoppix)
Posts: 194

Rep: Reputation: 31
I tried to use your instruction what i did was :
ifconfig eth1 down
iwco
 
Old 09-17-2007, 10:21 PM   #12
dhanar_10
LQ Newbie
 
Registered: Jan 2006
Location: Semarang, Central Java, Indonesia
Distribution: Ubuntu 7.10 (Gutsy Gibbon)
Posts: 17

Original Poster
Rep: Reputation: 0
Do you think that I have to disable NetworkManager?

Do you know how to disable it?
 
Old 09-18-2007, 07:33 PM   #13
dhanar_10
LQ Newbie
 
Registered: Jan 2006
Location: Semarang, Central Java, Indonesia
Distribution: Ubuntu 7.10 (Gutsy Gibbon)
Posts: 17

Original Poster
Rep: Reputation: 0
I got it work!

All I have to do is enter this command...

Quote:
sudo iwconfig eth1 mode ad-hoc essid MYNETWORK channel 1
No need to disable Network Manager.

Now, how to set the IP address?

Note:
Currently I am using Ubuntu 7.04 with kernel 2.6.22-10-generic (gutsy's kernel)
 
Old 10-24-2007, 11:12 AM   #14
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Did you try ifconfig?
 
Old 10-24-2007, 11:21 PM   #15
dhanar_10
LQ Newbie
 
Registered: Jan 2006
Location: Semarang, Central Java, Indonesia
Distribution: Ubuntu 7.10 (Gutsy Gibbon)
Posts: 17

Original Poster
Rep: Reputation: 0
Actually, I have managed to solve the problem.

To activate the ad-hoc connection, I use this script:

Quote:
#!/bin/bash

echo "adhoc-enable 24092007"
echo

INTERFACE="eth1"

echo -n "ESSID : "
read ESSID
echo -n "Channel : "
read CHANNEL
#echo -n "Key : "
#read KEY
echo -n "IP Address : "
read IP_ADDRESS
echo -n "Netmask : "
read NETMASK
echo

sudo /etc/dbus-1/event.d/25NetworkManager stop
sudo iwconfig $INTERFACE mode ad-hoc essid $ESSID channel $CHANNEL
#if [ "$KEY" != "" ]; then
# sudo iwconfig $INTERFACE key $KEY
#fi
sudo ifconfig $INTERFACE $IP_ADDRESS netmask $NETMASK
sudo route add link-local netmask 255.255.0.0 metric 1000 dev $INTERFACE
echo

echo "Press any key to continue..."
read
And, to disable the ad-hoc connection, I use this:

Quote:
#!/bin/bash

echo "adhoc-disable 23092007"
echo

sudo /etc/dbus-1/event.d/25NetworkManager start
echo

echo "Press any key to continue..."
read
These shell scripts has been tested on Ubuntu 7.04 (kernel 2.6.22-10-generic) with Intel 2200BG wireless adapter.

Last edited by dhanar_10; 10-24-2007 at 11:24 PM.
 
  


Reply



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
Samba Wireless Ad-Hoc Jansport_Kiefer Linux - Wireless Networking 3 12-13-2007 03:58 AM
how can i make auto configure wireless internet connection hibudd Linux - Software 2 03-26-2007 10:17 AM
My wireless card connects but only into ad-hoc Uh-Oh...Problems Linux - Wireless Networking 7 08-21-2006 02:50 PM
Multiple PC Ad-hoc wireless issues jholl Linux - Wireless Networking 1 01-31-2006 01:56 PM
ad-hoc connection (and internet sharing) between two linux boxes. A complex question. riccisit Linux - Wireless Networking 1 09-29-2005 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 01:37 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
Open Source Consulting | Domain Registration