You are not logged in.

#1 2008-02-17 19:34:20

khordes
Member
Registered: 2007-06-23
Posts: 22

Use netcfg2 to set up ad-hoc wireless network

hey all.  I use a wired network connection with my main comp, have netcfg2 set up and working perfectly with it. I also have a wirless card in my main and am looking to conduct some internet connection sharing wirelessly with another computer, I am able to set up the wireless card manually into ad-hoc mode and am using firestarter to get iptables correctly configured, it works great when manually set up.  I understand how to connect to wireless networks using netcfg2, but I haven't been able to find any information concerning a way to autostart the card in ad-hoc mode and correctly bring it up.  I tried guessing what the option would be with:

MODE:"ad-hoc"

in my net-profile.  When I try to bring this connection up however, the card stays in managed mode.  If I the switch it to ad-hoc mode I get a failure if I try to bring that net-profile down again.  I'm wondering if what I am trying to do is possible to automate with netcfg2 and how to go about doing it.  My wireless interface is wlan0 and the ip I am trying to assign it is 192.168.100.1 (the gateway for the ICS).  The essid will be khordes, no WEP or WPA yet, just trying to get a consistent working system before I add an extra level of confusion in there :-)  Anyhelp ya'll can give would be greatly appreciated.  BTW, been using Arch since May 07, deployed to Afghanistan right now and still having a great time with it, gives me something else to think about ;-)

khordes

Offline

#2 2008-02-17 20:19:07

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Use netcfg2 to set up ad-hoc wireless network

Hmm.. you can't just add options to a config file like that. If there was a MODE setting, it would be covered in the documentation and examples.

You're looking for the IWOPTS= line - in your case, it should be:

IWOPTS="mode Ad-Hoc"

Offline

#3 2008-02-18 04:11:12

khordes
Member
Registered: 2007-06-23
Posts: 22

Re: Use netcfg2 to set up ad-hoc wireless network

That is definitely the command I was looking for.  However, when I load my profile with the IWOPTS line everything comes up but the card stays in managed mode. If I manually set it to ad-hoc first, remove the IWOPTS line, and then bring it up, it fails and complains of a device or resource busy.  My net-profile for the ad-hoc network is:

CONNECTION="wireless"
DESCRIPTION="Internet Connection Share"
INTERFACE=wlan0
IWOPTS="mode ad-hoc essid $ESSID channel 11"
IP="static"
IFOPTS="192.168.100.1 netmask 255.255.255.0 broadcast 192.168.100.255"
ESSID="khordes"
SECURITY=none

when i set it manually to adhoc before bringing it up I get:

:: ap up                                                                                                            [BUSY] Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Device or resource busy.
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Device or resource busy.
          - Could not set wireless configuration                                                                    [FAIL]

I have an Intel 4965 card.  And as I mentioned earlier, if I set it up manually I have no problems.  Thanks again.

khordes

Offline

Board footer

Powered by FluxBB