You are not logged in.

#1 2007-06-09 14:00:21

anadyr
Member
Registered: 2005-02-10
Posts: 225

iwpriv commands & network-profiles

Hi,

I am running the rt2500 beta driver and am connecting to a wireless network, using WPAPSK and AES encryption. For some reason I do not know how I add these information to a /etc/network-profile/file, and connecting to the network at bootup. My problem is that I do not know how to add iwpriv commands there... I want to do that!

Now I connect to the internet through this script:

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
        start)
         stat_busy "Starting Wireless Interface"
ifconfig ra0 up
iwconfig ra0 essid dlink
iwconfig ra0 mode Managed
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=AES
iwpriv ra0 set WPAPSK=XXX
iwpriv ra0 set TxRate=0
dhcpcd ra0
route add default gw 192.168.1.1
#dhcpcd ra0
        ;;
        stop)
         stat_busy "Stopping Wireless Interface"
        /sbin/ifconfig ra0 down
        ;;
esac

but I want to create a proper Network profile. And the iwpriv commands in this script above should be used for this, but I don't know where. This is the network profile I made so far:

#
# Network Profile
#

DESCRIPTION="Yemen LC"

# Network Settings
INTERFACE=ra0
HOSTNAME=anadyr

# Interface Settings (use IFOPTS="dhcp" for DHCP)
IFOPTS="dhcp"
#GATEWAY=192.168.1.1

# DNS Settings (optional)
DOMAIN=localdomain
DNS1=192.168.1.1
DNS2=

# Wireless Settings (optional)
ESSID=dlink
#KEY=XXX
IWOPTS="mode Managed essid $ESSID"
#IWOPTS="mode Managed essid $ESSID channel 6 key restricted $KEY"

#WIFI_INTERFACE=ra0    # use this if you have a special wireless interface
                      # that is linked to the real $INTERFACE

#WIFI_WAIT=5           # seconds to wait for the wireless card to
                      # associate before bringing the interface up
#USEWPA="yes"          # start wpa_supplicant with the profile
#WPAOPTS="-D wext"     # use "" for normal operation or specify additional
                      # options (eg, "-D ipw")
                      # see /etc/wpa_supplicant.conf for configuration
#AUTOWPA="yes"         # automatically configure WPA
#PASSKEY=XXX
#PASSKEY=XXX

Could someone say where I should implement these commands in this file:

iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=AES
iwpriv ra0 set WPAPSK=XXX
iwpriv ra0 set TxRate=0

Thanks!
Rogier

Offline

#2 2007-06-09 14:27:04

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: iwpriv commands & network-profiles

I use the same drivers as you, and in the end it's easier to create a custom script that you put in rc.local... Since rt2500 has a very strange way of setting up encryption (the encryption is in-driver), it is not easy to fit it into the existing network-profile infrastructure.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2007-06-09 15:26:42

anadyr
Member
Registered: 2005-02-10
Posts: 225

Re: iwpriv commands & network-profiles

well, that is rather odd... can't a network profile "call" an executable, which includes those commands?

But then I have another question if I have to keep working with this script... The ra0 interface uses dhcp. When I set rc.conf to start ra0 (ra0=dhcp), I get a timeout... Afterwards I start my script and internet works.
If I do not start ra0 (uncomment ra0 in interfaces), and start my script afterwards it doesn't work! Why is that then? And how do I fix it. How do I start the daemon /etc/rc.d/network, without error, and afterwards starts the second daemon (my script /etc/rc.d/wireless_ylc)?

Last edited by anadyr (2007-06-09 15:27:12)

Offline

#4 2007-06-10 06:01:27

anadyr
Member
Registered: 2005-02-10
Posts: 225

Re: iwpriv commands & network-profiles

And can I add the iwpriv commands somehow to the /etc/conf.d/wireless file?

Offline

#5 2007-06-10 09:52:56

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

Re: iwpriv commands & network-profiles

the current network scripts have no support whatsoever for this. The new ones DO allow you to call another script before/after up/down of the interface.

http://wiki.archlinux.org/index.php/Network_Scripts

I've got exams atm, but i'll polish them up and get them merged after exams. Currently though, they ought to work ok.

Offline

#6 2007-06-10 12:30:29

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: iwpriv commands & network-profiles

From 2.6.22 on, with the new wireless stack, people using Ralink stuff will have to switch to rt2x00 drivers, which are wpa_supplicant-compliant smile.

I think it is not worth the effort anymore to support the older drivers in your new network scripts, iphitus smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2007-06-10 12:44:20

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

Re: iwpriv commands & network-profiles

B wrote:

From 2.6.22 on, with the new wireless stack, people using Ralink stuff will have to switch to rt2x00 drivers, which are wpa_supplicant-compliant smile.

I think it is not worth the effort anymore to support the older drivers in your new network scripts, iphitus smile.

yeah i know that. i'm not explicitly supporting them. the new scripts let you run *any* command before or after connecting to a network. So yeah, he could run those if he wanted, or anything else.

In addition, some of the rt2x00 drivers are still somewhat problematic, so the older drivers are still of use for some time.

Offline

Board footer

Powered by FluxBB