Talk:Wireless/Configuration

From Gentoo Linux Wiki

Jump to: navigation, search

Contents

[edit] Syntax Error

I found out that there are some misleading syntax errors in the WPA (using iwconfig) part.

iwpriv_homenetwork=(
        "set AuthMode=WPAPSK"
        "set EncrypType=TKIP"
        "set WPAPSK=YOURPASSWORD"
)

is supposed to be written like this:

iwpriv_homenetwork=(
        set AuthMode="WPAPSK"
        set EncrypType="TKIP"
        set WPAPSK="YOURPASSWORD"
)

Otherwise, whenever you tried to run the wireless connection, it will complain about ioctls.

[edit] Compaq Evo N800C with W200 card

Hi Roy

Thanks for the ebuild. It works like a dream, with a very basic config so far :-)

One aspect that got me a little stuck for a few minutes was that the comments at the end of the /etc/conf.d/net file suggested that the hooks should always be for net.eth0

My wireless card was listed by iwconfig as eth1. Once I had linked net.eth1 to net.eth0 and put in a statement in /etc/conf.d/net for iface_eth1="dhcp" (before the hook statements) all worked fine.

Hopefully this may help others who have the same issue.

Thanks again. You have made my life a little easier...

I have attached a first set of notes on how I got the W200 card to work as well if someone else can make use of it. I know it took me an age to get it working.....

Cheers and thanks again

Paul Cuttriss


My notes for setting up W200 on Compaq Evo N800C The info below applies to the kernel I was using at the time, it should work with others. Kernel v2.6.8-gentoo-r3

Ensure your kernel has support for Wireless LAN (non-hamradio), Hermes Chipset 802.11b support (Orinoco/Prism2/Symbol) and Atmel at76c50x chipset 802.11b support. (This might be more than absolutely required but this is a fist cut of these notes....) Support for necessary USB components as the card is based on USB

Orinoco usb drivers http://www.nongnu.org/orinoco/ Thanks to the author. Download source using cvs export CVS_RSH="ssh" cvs -z3 -d:ext:anoncvs@savannah.nongnu.org:/cvsroot/orinoco co orinoco

Change directory to orinoco make make install Edit /etc/modules.autoload/kernel-2.6 and add orinoco_usb, orinoco, hermes, atmel.


Ensure you have hotplug emerged

Firmware for W200 http://folk.uio.no/oeysteio/orinoco-usb/install.html Follow the instructions. Thanks to the author.

Ensure you have wireless-tools emerged

Note: You may find on first boot that the W200 does not power up, as long as the firmware has loaded the Fn F2 key combination should operate to power the card.

Configuration of the W200 after it is detected and powered on.

Example

Code:
root #iwconfig
eth1      IEEE 802.11b  ESSID:"xxx"  Nickname:"HERMES I"
          Mode:Managed  Frequency:2.437GHz  Access Point: 00:60:B3:78:6D:00

edit /etc/conf.d/net and put in iface_eth1="dhcp" edit /etc/conf.d/wireless and put in relevant information for interface ln -s /etc/init.d/net.eth0 /etc/init.d/net.eth1

  1. If you want to start the wireless int every time you boot

rc-update add net.eth1 default

Hopefully you will be up and running. Thanks must go to all the people who have created/maintained all the various components listed above.

[edit] Problem: blacklisting access point by mac address

I have a problem here at university: We have a wireless network here with essid tsunami - encryption is disabled bescause everyone has to use a vpn client. I am able to connect to the wlan without problems normally. In some rooms I detected a wlan with WEP encryption - also with essid tsunami (which is in my opinion a bad idea - but I cannot change it). Now the wireless init script tries to connect to the WEP-enabled access point (of which I do not know the wep key), and tries the next in list (which is my wep enabled network at home). So I cannot connect to the non-wep tsunami network. I think the simplest way would be to blacklist the mac address of the access point - does anyone here know how to do that?

[edit] Madwifi wlan_wep & wlan_tkip Requirement

"For madwifi cards, remember to install the wlan_wep and/or wlan_tkip kernel modules"

I've got an Atheros chipset wireless card and I'm using madwifi with WEP without either of those modules. Is it really a requirement? tro

I use Atheros with WEP as well. dhcpcd did not work so far. Where are these wlan_wep modules, in the cryptographic API? Please clarify a bit more. Thanks, Bahadir

AFAIK they are a requirement. wlan_wep and wlan_tkip are built by the madwifi-driver ebuild and can be modprobed.

I think a reference on howto get tkip and ccmp to work is needed, which things in the kernel to add

[edit] how to select profile

How to select my wireless profile at startup ? Using quickswitch ?

moved from the article
ΩD'mitri 16:24, 19 Dec 2004 (GMT)

[edit] Use ~ instead of = in package keywords

Since the portage update of readline-5.0-r2 the package.keywords won't work properly. I have managed to avoid this issue by simply using ~sys-libs/readline-5.0 ~x86 instead of the =sys-libs/readline-5.0-r1 ~x86. After the r2 package was released it seems that the keyword is ignored and portage reverts back to version 4 of realine. Perhaps all the packages should for this reason use ~ instead =.

I also thought that I'd post my working /etc/conf.d/net.ath0 for those searching for more examples:

essid_ath0="MyNetwork"
mode_ath0="Managed"
adhoc_essid_ath0="MyNetwork"
channel_ath0="6"
key_MyNetwork="open AAAA-3708-07"
config_MyNetwork=( "dhcp" )

The key is fictive but gives perhaps an idea of how to do a basic setup out of all the wireless.example options.

You can use "=sys-libs/readline-5.0* ~x86" --CrazyTerabyte 13:27, 23 March 2008 (UTC)

[edit] How can I have multiple hidden ESSIDs in /etc/conf.d/wireless

With my Laptop I have two WLANs I have access to, both with hidden essid. In /etc/conf.d/wireless I tried

Code:
essid_eth1=( "ESSID1" "ESSID2" ) 

but that doesn't work, the startup script tries only the first one. I figured out a way to do it in /etc/init.d/net.ethX like this

Code:
# split essid's
local essids=( \"\$\{essid_$iface\[@\]\}\" )
# do this only for wireless interfaces
if [[ -n ${iwconfig_IFACE} ]]; then
  # sequentially go through essids
  for essid in ${essids} ; do
     # replace all invalid chars by underscore (so it works with /etc/conf.d/wireless)
     local ESSID_IF=`echo "${essid}" | sed s,'[^A-Za-z_]','_',g`
     # get the key for the interface
     eval key=( \"\$\{key_$ESSID_IF\}\" )
     # and configure it
     iwconfig ${IFACE} essid "${essid}" key "${key}"
     # get Access Point MAC
     local APMAC=`iwconfig ${IFACE} | grep Access | awk '{ print $NF; }'`
     if [[ ${APMAC} != "00:00:00:00:00:00" ]] ; then
       # we are connected
       break
     fi
  done
fi

then you could have multiple essids configured and the first valid found will be used for the interface. All other options in /etc/conf.d/wireless can be used as usual. My problem is that I cannot do this in /lib/rcscripts/net.modules.d/iwconfig in function iwconfig_associate(). Maybe you can tell me how to do it?

Thanks,

Georg

Have you tried using:

preferred_aps=( "Hidden ESSID 1" "Hidden ESSID 2" )
associate_order="forceany"

Or with wpa_supplicant, you can specify the various networks and use

ap_scan=2

[edit] Bias of this document

As a resource to set up wireless networking, I'm glad this exists to show me that there are a few methods to get the job done. In my case, I am better served by using gentoo's init scripts for starting up wireless. I find this document has a disproportionate bias towards the supplicant method. I would love to see more information on the first method. Perhaps I can add it myself...Hah.

yea, no kidding. Its silly to complain about a wiki article.
IMHO, you'll find wpa_supplicant handles roaming and, wireless in general, better than the gentoo init scripts and iwconfig anyway.

[edit] I am missing the wireless and wireless.example files

Anyone knows what I should emerge to get them?

baselayout version 1.11.0 or greater

No. The wireless files are obsolete, configuration goes to /etc/conf.d/net now, that's where the non-wireless configuration is. This is obviously a TODO for the article..

[edit] Many configuration changes after installing the unmasked baselayout

After installing the base layout I had over 30 configuration changes, and my X broke.
I merged them blindly with etc-update (bad move...) and then X was still broken, but in a very wierd way which I didn't manage to overcome.
I think the guide must warn about the many configuration changes, and stress the importance of a carfull merge through tools like dispatch-conf.

[edit] Timeout problem: need iwconfig before wpa_supplicant

Using the stable baselayout-1.11.12-r4: almost got the wpa_supplicant way to work, but for one thing. If I just try to start net.ath0, I get a timeout error as follows (with RC_VERBOSE="yes"):

 # /etc/init.d/net.ath0 start
  * Starting ath0
  *   Loading networking modules for ath0
  *     modules: wpa_supplicant essidnet iptunnel ifconfig dhcpcd apipa
  *       wpa_supplicant provides wireless
  *       ifconfig provides interface
  *       dhcpcd provides dhcp
  *   Starting wpa_supplicant on ath0 ...
  *     Waiting for association                                       [ ok ]
  *     timed out                                                     [ !! ]

After some trial and error tests, I narrowed it down to the following: if I do a "iwconfig ath0 channel 11" to set the card on the correct channel first, then it works:

 # iwconfig ath0 channel 11
 # /etc/init.d/net.ath0 start
  * Starting ath0
  *   Loading networking modules for ath0
  *     modules: wpa_supplicant essidnet iptunnel ifconfig dhcpcd apipa
  *       wpa_supplicant provides wireless
  *       ifconfig provides interface
  *       dhcpcd provides dhcp
  *   Starting wpa_supplicant on ath0 ...
  *     Waiting for association                                            [ ok ]
  *     ath0 connected to "TAMAREA" at 00:0D:0B:2C:EF:B2
  *     using WPA-PSK/CCMP
  *   Configuring ath0 for "TAMAREA" ...                                    [ ok ]
  *   Bringing up ath0
  *     dhcp
  *       Running dhcpcd ...                                               [ ok ]
  *       ath0 received address 192.168.1.138

I tried adding channel_ath0="11" to both /etc/conf.d/wireless and /etc/conf.d/net, but that does not seem to work.

Any ideas?

--Tam 04:46, 11 Jun 2005 (GMT)

Have a look at wpa_supplicant + ipw2200 + "no broadcast essid". This is regarding association to "hidden" SSID, but also involves iwconfig for activating the device for usage with wpa_supplicant.

--User:deadhead 04:46, 11 Jun 2005 (GMT)

Be sure that wpa_supplicant is not added as daemon somewere: rc-update -d wpa_supplicant and everything is all right. Nowadays net.$wireless check by itself wpa_supplicant

[edit] net.eth1 doesn't see wpa_supplicant

I just did an emerge -u world on my laptop and now when the networking starts it tells me to emerge wpa_supplicant. I do have it emerged and it works fine. I checked and it is already associated to my access point when /etc/init.d/net.eth1 starts and gives me the message. Net doesn't start because of the message so dhcpcd never runs. I can manually start dhcpcd and I get an IP and networking works great.

It appears that all of my config files are correct because everything works if I do it manually. Anyone have any idea why the net.eth1 (which is a link to net.lo) thinks I don't have wpa_supplicant emerged?

SOLVED: OK I fixed my own problem. I upgraded to the new baselayout and it was looking for wpa_supplicant in /sbin instead of /usr/sbin. I took baselayout out of my package.keywords file and went back to the stable version and everything is back working.

[edit] RT2x00 and WPA_Supplicant

As far as I can tell, the RT2x00 cards won't work with WPA Supplicant using the native drivers. They will work, however, if you use NDISWrapper.

[edit] automatic net configuration

This article does need a section about ifplugd and netplug.

Those 2 progs automatically detect network connection/disconnection, and react acordingly... Allowing for example roaming between different ESSIDs.

[edit] wpa_supplicant and ndiswrapper 1.2

Since 1.2 version of ndiswrapper the device will not be ndiswrapper, rather wext.

In etc/conf.d/net or etc/conf.d/wireless, it will be defined as: wpa_supplicant_wlan0="-Dwext"

[edit] Disable card completely (for energy reasons) ?

Does anyone happen to know a way to disable a pci-card, so it does not consume precious battery time?

[edit] General explanation?

I'm missing the gentoo-style text that explains a bit of the basic concept of wlan and how the possible ways to go relate to each other and relate to WEP/WPA encryption.

I simply dont get how wpa should work. do i have to unmerge wireless-tools in order to use wpa_supplicant? can i use wpa_supplicant on a BCM43xx at all? whats going on if i run wpa_supplicant?

Or have i just missed a url, in this case it should be included in this article too, please!

[edit] Merge with HOWTO Wireless

This is a nice guide for the basic configuration for those that have already have their network devices up and running. HOWTO_Wireless appears to be for configuring devices.

Removing merge notice.

Added weblink to category "Resources"

Personal tools