View previous topic :: View next topic |
Author |
Message |
a_stranger n00b
Joined: 25 Feb 2004 Posts: 36 Location: Sweden
|
Posted: Sat Jul 23, 2005 1:10 pm Post subject: rt2500: when using wpa |
|
|
I have got rt2500 working and the wpa working by running this lines:
ifconfig ra0 up
iwconfig ra0 channel 0
iwpriv ra0 set SSID=Gallien
iwpriv ra0 set NetworkType=Infra
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=TKIP
iwpriv ra0 set WPAPSK=passphrase
dhcpcd ra0
but when I restart the computer I lose the wpa and I haft to run the lines again. What should I do to |
|
Back to top |
|
|
BradN Advocate
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Sat Jul 23, 2005 10:00 pm Post subject: |
|
|
As a quick solution, you could put the lines in your /etc/conf.d/local.start file, otherwise you would have to edit a net.ethx file in /etc/init.d/ and add the lines to an appropriate location in there (except for the dhcpcd line, as that can be handled by the startup script). |
|
Back to top |
|
|
maca Tux's lil' helper
Joined: 26 Jun 2003 Posts: 84 Location: Perth, Australia
|
Posted: Mon Aug 01, 2005 4:37 am Post subject: WPA PSK RT2500 net.ra0 wireless |
|
|
I have these lines in a copy of net.eth0 that i called net.ra0
I have statically assigned the IP so its in the section to do with !=DHCP in the script ....
If anyone has a nicer way of doing it .. Id love to hear it ... I have a RT2500 card, but this all seems to work fine ... I reboot/restart it and it all comes up good and proper !
iwconfig ${IFACE} mode Managed
/sbin/ifconfig ${IFACE} mtu 1450 >/dev/null
iwpriv ra0 set SSID=home
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=TKIP
iwpriv ra0 set WPAPSK=****PASSPHRASE***** <----replace with your passphrase
The only thing Im lacking is that ... I cant seem to see any report from the system that I am running the WPA encryption even though I must be cause I still talk to the router ....
is there a switch on iwpriv or something to report what is going on, on the interface ... iwconfig and ifconfig doesnt really show me much.
the only thing that shows me there is encription on is iwlist scan ..... but that only shows the network ... not what is configured locally ?? _________________ You can take nothing from me that I will more freely give, except my life
William Shakespeare
Hamlet |
|
Back to top |
|
|
dandelion n00b
Joined: 04 Aug 2005 Posts: 11 Location: Case Pilote
|
Posted: Fri Aug 05, 2005 10:56 pm Post subject: |
|
|
Silly me... I thought we had to use wpa_supplicant for wpa... Anyway, wpa_supplicant bundles so nicely with gentoo's initscripts... Perhaps Uberlord should add some iwpriv magic to the wireless scripts then? Or am I missing something? |
|
Back to top |
|
|
xepk Tux's lil' helper
Joined: 27 Mar 2005 Posts: 124
|
Posted: Sat Aug 06, 2005 2:37 am Post subject: |
|
|
Although this should be possible using the iwpriv_ra0 arguments in your /etc/conf.d/net, I never got that working. Here's how I do WPA + rt2500:
I first use a script called pre.ra0 that I have added to the boot runlevel, that looks like this: Code: | #!/sbin/runscript
start() {
einfo "Checking for local WPA network"
ifconfig ra0 up
sleep 7s
if [ "`iwlist ra0 scanning | grep -i MY_ESSID`" != "" ]; then
einfo "WPA network found, Starting ra0 pre-up WPA commands"
cp /etc/conf.d/net.ra0.noiw /etc/conf.d/net
iwconfig ra0 channel MY_CHANNEL
iwpriv ra0 set SSID=MY_ESSID
iwpriv ra0 set NetworkType=Infra
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=TKIP
iwpriv ra0 set WPAPSK=MY_PSK
else
einfo "Local WPA network not found, replacing /etc/conf.d/net with generic"
cp /etc/conf.d/net.ra0.generic /etc/conf.d/net
fi
} |
Of course replacing MY_ESSID, MY_CHANNEL, and MY_PSK with the appropriate values for your router.
As you can see this scans for my WPA network at home and, if found, executes the necessary iwpriv commands and replaces my net configuration file with this one, which tells gentoo not to mess with the wireless settings: (/etc/conf.d/net.ra0.noiw) Code: | modules_ra0=("!iwconfig" "dhcpcd")
iface_ra0="dhcp" |
If my WPA network is not found, the pre.ra0 script replaces the net config file with a generic config file (/etc/conf.d/net.ra0.generic) set to scan for an AP, useful for when I'm near public APs. |
|
Back to top |
|
|
maca Tux's lil' helper
Joined: 26 Jun 2003 Posts: 84 Location: Perth, Australia
|
Posted: Sun Aug 07, 2005 11:39 pm Post subject: ra0 WPA .. |
|
|
So you have to reboot in order to restart your network connection ? .... or manually run an extra script ... surely this is what /etc/init.d/net.ra0 or similar is meant for ..... I can see what you doing but restarting you network connection should be as similar as a wired connection as possible, this is just my opinion but given what has been said so far Im happiest with my solution .... in fact your script could be exectuted as part of my init.d scripts and that way It would be run automatically running it out of boot seperately from init seems a but crasy rc-update should be all you need to do to get it in a run-level and out ....
Again this is just my opinion _________________ You can take nothing from me that I will more freely give, except my life
William Shakespeare
Hamlet |
|
Back to top |
|
|
quiver n00b
Joined: 31 Dec 2004 Posts: 17 Location: Melbourne, Australia
|
Posted: Wed Dec 21, 2005 12:57 pm Post subject: The reason... |
|
|
Well I don't have a solution, but I do have the reason for why the iwpriv command in the /etc/conf.d/net.ra0 scripts doesn't work... After some discussion with Uberlord, it seems there are two issues, of which one is the real problem. The first issue is that each line of iwpriv_ra0= in the script overwrites the previous, as it's read by bash. You can only have one - of each - argument, no more... So in fact if you had;
iwpriv_ra0=set SSID=Gallien
iwpriv_ra0=set NetworkType=Infra
iwpriv_ra0=set AuthMode=WPAPSK
iwpriv_ra0=set EncrypType=TKIP
iwpriv_ra0=set WPAPSK=passphrase
then it'd keep overwriting and the only line the driver would acknowledge is the last, so it wouldn't know the AuthMode, EncrypType etc, and the connection would fail.
The solution, it would seem is to place all the parameters on the same line, like you can with iwconfig (eg iwconfig ra0 channel 5 essid blah etc etc)... Yet despite the fact that iwconfig, iwpriv, iwlist etc are all supposedly written by the same person, iwpriv only accepts one parameter per line, contrary to the other tools in the package. So you can't stack them all either
So that's the two issues, and the real underlying problem. I'm told the rt2x00 driver will work with the wpa_supplicant shortly, so that's where the developers priorities are... I'll be using xepk's groovy lil script in the meantime, though I'll certainly be keeping up to date on the progress with the rt2500/rt2x00 driver, as disabling SMP to get the rt2500 driver to work was a very sorry loss |
|
Back to top |
|
|
maca Tux's lil' helper
Joined: 26 Jun 2003 Posts: 84 Location: Perth, Australia
|
Posted: Wed Dec 21, 2005 10:24 pm Post subject: It is working |
|
|
I have been using the commands I posted since before July this year, I can reboot and the network is initialised out of the run level. You are saying it wont work but it does ... I dont know what to say ... Im using WPA-psk encription on my network and it runs fine ..... _________________ You can take nothing from me that I will more freely give, except my life
William Shakespeare
Hamlet |
|
Back to top |
|
|
quiver n00b
Joined: 31 Dec 2004 Posts: 17 Location: Melbourne, Australia
|
Posted: Thu Dec 22, 2005 1:55 am Post subject: |
|
|
Maca, your script, if I'm not mistaken, is an init.d script, like xepk's, that's why you can add it to a runlevel and it works. So yes, it does work, but as you say;
Quote: | I can see what you doing but restarting you network connection should be as similar as a wired connection as possible |
Which would be to have iwpriv_ra0= parameters in the conf.d end of things |
|
Back to top |
|
|
|