You are not logged in.

#1 2009-06-11 15:57:16

Revolt
Member
From: Portugal
Registered: 2009-06-11
Posts: 71
Website

Ad-Hoc and netcfg

Hey there!

I've recently received a Toshiba A300-1S9 laptop and decided it was about time I tried out a Linux Distro for real. I've already played around with Ubuntu and OpenSUSE but only recently did I find Arch Linux and I must say I'm enjoying the experience.

I've hit a few brick walls down the way, almost panicked when I accidentally messed up GRUB and partitioning was quite an adventure aswell.

I'm now attempting to configure my wireless networks using the network profiles with netcfg (as explained in the begginers guide).

I have successfully setup my AR928X Wireless Network Adapter to connect to my home network (AD-HOC with a Windows computer that is connected to a router) using the manual configuration and Arch is able to connect to the net. These are the steps I take to connect:

ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc
ifconfig wlan0 up
ifconfig wlan0 192.168.0.3 netmask 255.255.255.0
iwconfig wlan0 essid "Phoenix" key s:<censored>
route add default gw 192.168.0.1
(DNS are setup in resolv.conf)

The reason I use ifconfig wlan0 down before changing the mode is because I've find out with trial and error that I'm not able to change the mode when the device is running (dunno if it is default behaviour).

However, when I try to replicate the above steps using the network profiles (following the wiki), I can't seem to set the interface to ad-hoc even if I put ifconfig wlan0 down in PRE_UP or use the predown QUIRKS. It always gives me the resource busy error.
If I remove the IWCONFIG part with the ad-hoc command, I get an error while trying to setup the gateway and the interface stays in managed mode (as expected) and doesn't even connect.

So what I wanted to know is if there's any way to replicate the above steps in netcfg and, if not, how could I create a script to run each boot with the necessary ifconfig and iwconfig calls to connect to a specific network.

Thanks in advance smile

Last edited by Revolt (2009-06-11 15:57:34)

Offline

#2 2009-06-12 12:39:29

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Ad-Hoc and netcfg

I never actually added specific ad-hoc support, but you might be able to work around that.

The config below _might_ work. It may require netcfg from [testing].

CONNECTION="wireless"
INTERFACE="wlan0"
SECURITY="wep"
ESSID="Phoenix"
KEY="s:<censored>"
IP="static"
IFOPTS="192.168.0.3 netmask 255.255.255.0"
GATEWAY="192.168.0.1"
PRE_UP="ifconfig wlan0 down; iwconfig wlan0 mode ad-hoc"

Offline

#3 2009-06-12 18:08:34

Revolt
Member
From: Portugal
Registered: 2009-06-11
Posts: 71
Website

Re: Ad-Hoc and netcfg

Yey it works (using the package from testing, haven't tried the normal one)!

Thanks big_smile

Offline

#4 2009-08-13 19:34:03

Deeexx
Member
Registered: 2008-11-01
Posts: 1

Re: Ad-Hoc and netcfg

Nice, I had trouble connecting to my phone (which learned recently to act as an Access Point).
Adding the line PRE_UP="ifconfig wlan0 down; iwconfig wlan0 mode ad-hoc" did the trick for me.

Thanks

Offline

Board footer

Powered by FluxBB