<---- template headericclude ----->
How to access WEP/WPA/WPA2 access points with wpa_supplicant in FC5
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 9 123 ... LastLast
Results 1 to 15 of 124
  1. #1
    Darkmage Guest

    Post How to access WEP/WPA/WPA2 access points with wpa_supplicant in FC5

    What is wpa_supplicant?
    "wpa_supplicant is a WPA Supplicant for Linux, BSD and Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). Supplicant is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wlan driver.

    wpa_supplicant is designed to be a "daemon" program that runs in the
    background and acts as the backend component controlling the wireless
    connection. Support for separate frontend programs is included and an
    example text-based frontend, wpa_cli, is included with wpa_supplicant."

    I have a Laptop running Linux and I always wanted to have WPA encryption working with less hassle, this write up should make life a whole lot easier.

    NOTE: Assumption is made that you have ndiswrapper working or wlan0 is detected by Network Configuration and your ssid is been broadcasted with WEP/WPA or WPA2 encryption.
    This page only applies to FC5

    Wpa_supplicant is available from updates and to install it -->
    Code:
     yum -y install  wpa_supplicant-0.4.8-5 wpa_supplicant-gui-0.4.8-5
    navigate to /etc/wpa_supplicant
    Code:
    cd /etc/wpa_supplicant
    With an editor of your choice, modify wpa_supplicant.conf with the following information

    Code:
    ctrl_interface=/var/run/wpa_supplicant
    ctrl_interface_group=wheel
    ap_scan=2
    update_config=1
    
    network={
            ssid="any"
            key_mgmt=NONE
            disabled=1
    }
    click on Desktop -> System Settings -> Users and Groups. When prompted type in the user root password and hightlight your username and click on Properties. The User Properties windows comes up, then go to the Groups Tab and scroll all the way down to wheel group and put a check mark and Ok out of the window.

    Now to edit the /etc/sudoers file
    If you do not have visudo command, then
    Code:
    yum -y install sudo

    Open a terminal and become root and type in
    Code:
     /usr/sbin/visudo 
    scroll to the line similar to below
    # Same thing without a password
    #%wheel ALL=(ALL) NOPASSWD: ALL

    remove the comment on %wheel, so you have
    # Same thing without a password
    %wheel ALL=(ALL) NOPASSWD: ALL

    Save and exit

    Below is the content of /etc/sysconfig/wpa_supplicant
    Code:
    # wlan0 and wifi0
    # INTERFACES="-iwlan0 -iwifi0 -eth1"
    INTERFACES="-iwlan0"
    # ndiswrapper and prism
    # DRIVERS="-Dndiswrapper -Dprism -Dmadwifi -Dipw2200"
    DRIVERS="-Dwext"
    Note that ndiswrapper has been depreciated, that is why the change on the drivers section from above

    I assume you interface is called wlan0, if it is something different modify /etc/sysconfig/wpa_supplicant accordingly
    Also, this will work with other drivers like madwifi, ipw2200 etc

    Still as root, start the wpa_supplicant service with
    Code:
     /sbin/chkconfig wpa_supplicant on
    /sbin/service wpa_supplicant start
    this should give you an [OK] result.

    You have three choices of running wpa_supplicant, the command line wpa_cli or wpa_gui or NetworkManager, I will be discribing wpa_gui and NetworkManager.

    Unfortunately wpa_gui does not have an icon yet but, you can create one.
    Right click your desktop and select "Create Launcher", give it a name, the command is "/usr/bin/wpa_gui", choose an icon for it and the select Ok.


    Restart your system/desktop/laptop/notebook/tablet

    Double click the icon you created and you will be presented with the gui interface for wpa_supplicant, the adapter should have wlan0 highlighted and just click scan --Assumption is made that you have ndiswrapper working and your ssid is been broadcasted with WPA or WPA2 encryption.

    Once you see your ssid, double click on it and type in your encryption key and then connect. Once connected to the ssid, open a terminal and
    Code:
    /sbin/dhclient
    or use Network Control to activate wlan0

    While looking at wpa_gui interface, you should see an ip address assigned to it.

    That's all folks
    Hope this helps and please post any question or comment
    Attached Images Attached Images
    Last edited by Darkmage; 19th February 2007 at 07:25 AM.

  2. #2
    LBrown Guest
    please help a linux noob...

    i followed the instructions to the letter, except three things
    1. i ignored the first instruction to install it because i had already found the .conf file so i assumed it was already installed.
    2. i assumed you made a typo with "%wheel ALL=(ALL) NOPASSWD: ALL", and you didnt mean remove the '%' as above, but the '#'.
    3. My routers ssid is hidden

    one of the last commands gave me [failed] instead of [ok], but setting INTERFACES="-ieth1" as suggested in another post worked for that.
    on clicking the shortcut i made to wpa_gui, it complained about missing target, i realized then i shouldnt have ignored the first instruction. i ran the first instruction and it completed successfully, i checked all the changes i had done as above and they were all still present. i ran wpa_gui, i cant remember what it said, but it did find some stuff, and allowed me to specify some network properties, but im not sure it was able to connect and i decided to reboot.

    this is where things all went wrong.
    i started up wpa_gui and it now says 'could not get status from wpa_supplicant' and it wont do anything.
    ive tried checking and repeating the above but nothing works.
    the instruction above to start the service gives me [failed], saying:
    Code:
    Starting wpa_supplicant: Line 12: network block was not terminated properly.
    Line 12: failed to parse network block.
    Falied to read read or parse configuration'/etc/wpa_supplicant/wpa_supplicant.conf'
    during startup it displays the above when starting wpa_supplicant. it also mentions something about a fatal error with firestarter and iptables, but wth [ok] next to it...

    i really dont know what to do except format. please help
    Last edited by LBrown; 27th March 2006 at 03:46 PM.

  3. #3
    Mavtech Guest
    Tried to follow directions. I am getting this when I start WPA_supplicant

    Code:
    [root@localhost ~]# /sbin/service wpa_supplicant start
    Starting wpa_supplicant: ioctl[SIOCSIWPMKSA]: No such device
    ioctl[SIOCSIWMODE]: No such device
    Could not configure driver to use managed mode
    ioctl[SIOCGIFFLAGS]: No such device
    Could not set interface 'wlan0' UP
    ioctl[SIOCGIWRANGE]: No such device
    ioctl[SIOCGIFINDEX]: No such device
    ioctl[SIOCSIWENCODEEXT]: No such device
    ioctl[SIOCSIWENCODE]: No such device
    ioctl[SIOCSIWENCODEEXT]: No such device
    ioctl[SIOCSIWENCODE]: No such device
    ioctl[SIOCSIWENCODEEXT]: No such device
    ioctl[SIOCSIWENCODE]: No such device
    ioctl[SIOCSIWENCODEEXT]: No such device
    ioctl[SIOCSIWENCODE]: No such device
    Failed to disable WPA in the driver.
    ioctl[SIOCSIWAP]: No such device
    ioctl[SIOCGIFFLAGS]: No such device
                                                               [FAILED]

  4. #4
    Darkmage Guest
    Quote Originally Posted by LBrown
    please help a linux noob...

    i followed the instructions to the letter, except three things
    1. i ignored the first instruction to install it because i had already found the .conf file so i assumed it was already installed.
    2. i assumed you made a typo with "%wheel ALL=(ALL) NOPASSWD: ALL", and you didnt mean remove the '%' as above, but the '#'.
    3. My routers ssid is hidden

    one of the last commands gave me [failed] instead of [ok], but setting INTERFACES="-ieth1" as suggested in another post worked for that.
    on clicking the shortcut i made to wpa_gui, it complained about missing target, i realized then i shouldnt have ignored the first instruction. i ran the first instruction and it completed successfully, i checked all the changes i had done as above and they were all still present. i ran wpa_gui, i cant remember what it said, but it did find some stuff, and allowed me to specify some network properties, but im not sure it was able to connect and i decided to reboot.

    this is where things all went wrong.
    i started up wpa_gui and it now says 'could not get status from wpa_supplicant' and it wont do anything.
    ive tried checking and repeating the above but nothing works.
    the instruction above to start the service gives me [failed], saying:
    Code:
    Starting wpa_supplicant: Line 12: network block was not terminated properly.
    Line 12: failed to parse network block.
    Falied to read read or parse configuration'/etc/wpa_supplicant/wpa_supplicant.conf'
    during startup it displays the above when starting wpa_supplicant. it also mentions something about a fatal error with firestarter and iptables, but wth [ok] next to it...

    i really dont know what to do except format. please help
    Thanks for catching the typo.
    Try this, open a terminal and a root
    Code:
     /sbin/service wpa_supplicant restart

  5. #5
    Darkmage Guest
    Quote Originally Posted by Mavtech
    Tried to follow directions. I am getting this when I start WPA_supplicant

    Code:
    [root@localhost ~]# /sbin/service wpa_supplicant start
    Starting wpa_supplicant: ioctl[SIOCSIWPMKSA]: No such device
    ioctl[SIOCSIWMODE]: No such device
    Could not configure driver to use managed mode
    ioctl[SIOCGIFFLAGS]: No such device
    Could not set interface 'wlan0' UP
    ioctl[SIOCGIWRANGE]: No such device
    ioctl[SIOCGIFINDEX]: No such device
    ioctl[SIOCSIWENCODEEXT]: No such device
    ioctl[SIOCSIWENCODE]: No such device
    ioctl[SIOCSIWENCODEEXT]: No such device
    ioctl[SIOCSIWENCODE]: No such device
    ioctl[SIOCSIWENCODEEXT]: No such device
    ioctl[SIOCSIWENCODE]: No such device
    ioctl[SIOCSIWENCODEEXT]: No such device
    ioctl[SIOCSIWENCODE]: No such device
    Failed to disable WPA in the driver.
    ioctl[SIOCSIWAP]: No such device
    ioctl[SIOCGIFFLAGS]: No such device
                                                               [FAILED]
    When you open Network Settings, is you wireless nic detected by Network Configuration.

  6. #6
    LBrown Guest
    Quote Originally Posted by Darkmage
    Thanks for catching the typo.
    Try this, open a terminal and a root
    Code:
     /sbin/service wpa_supplicant restart
    start and restart give the same error, stop just says failed.

    i went into interactive mode during startup to get the other error, i dont know if its related or not, if not let me know so i can start a new thread
    Code:
    Bringing up interface eth0:
    Determining IP information for eth0...External network device eth0 is not ready. Aborting..
    touch: cannot touch '/var/lock/firestarter': Permission denied
    Fatal error: Your Kernel does not support iptables
    Firewall not started
    rm: Cannot remove '/var/lock/firestarter': Permission denied
    done.
    [OK]
    note eth0 = wired nic, eth1 = wireless (ipw2200) nic

  7. #7
    Mavtech Guest
    Quote Originally Posted by Darkmage
    When you open Network Settings, is you wireless nic detected by Network Configuration.
    Yes. After following the directions from FedoraJim, I was able to get the Intel 2200 detected by Network Manager. But, I cannot get WPA to work.

  8. #8
    LBrown Guest
    damn, ignore my first problem, i recked everything just now and for some reason id lost the '}' in the .conf file, and it works again now, just got to try to connect to the network which ill attaempt later cus i got to go...

    thanks though

  9. #9
    LBrown Guest
    ok, i cant do it, please help me.

    my access point is using WPA-PSK with TKIP, ive enabled SSID broadcasting for now to reduce problems.
    wpa_supplicant.conf is exactly as you have it above
    in network configuration
    - eth1 is listed as inactive
    - wireless settings: managed, ssid=auto, key left blank.
    wpa_gui
    - adapter = eth1
    - network = 0: any
    - Status = SCANNING
    - Last Message = Trying to associate with SSID 'my ssid'

    in wpa_gui, if i press 'scan', it correctly lists my access point and my neighbours. double clicking mine allows me to specify my PSK. as soon as i press 'add' the status in the main window switches to 'Could not get status from wpa_supplicant'. i then need to start the service again, it gives the message 'bind(PF_UNIX): Address already in use' but gives me [OK], and then wpa_gui goes back to 'SCANNING'.

    i have seen status go to 'INACTIVE' but i dont know what i did.

    i really dont know what to do, and id really appreciate some step by step instructions if you could.
    thanks

  10. #10
    Mavtech Guest
    Quote Originally Posted by LBrown
    ok, i cant do it, please help me.

    my access point is using WPA-PSK with TKIP, ive enabled SSID broadcasting for now to reduce problems.
    wpa_supplicant.conf is exactly as you have it above
    in network configuration
    - eth1 is listed as inactive
    - wireless settings: managed, ssid=auto, key left blank.
    wpa_gui
    - adapter = eth1
    - network = 0: any
    - Status = SCANNING
    - Last Message = Trying to associate with SSID 'my ssid'

    in wpa_gui, if i press 'scan', it correctly lists my access point and my neighbours. double clicking mine allows me to specify my PSK. as soon as i press 'add' the status in the main window switches to 'Could not get status from wpa_supplicant'. i then need to start the service again, it gives the message 'bind(PF_UNIX): Address already in use' but gives me [OK], and then wpa_gui goes back to 'SCANNING'.

    i have seen status go to 'INACTIVE' but i dont know what i did.

    i really dont know what to do, and id really appreciate some step by step instructions if you could.
    thanks

    At least you have gotten that far. I can't even see any networks in wpa_gui.

  11. #11
    Darkmage Guest
    @LBrown
    The original configuration file is located at wpa_supplicant.conf

    Code:
    ctrl_interface=/var/run/wpa_supplicant
    ctrl_interface_group=wheel
    ap_scan=2
    opensc_engine_path=/usr/lib/opensc/engine_opensc.so
    pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so
    pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so
    update_config=1
    
    network={
            ssid="any"
            key_mgmt=NONE
            disabled=1
    }
    change ap_scan=2 to 0 and do a
    Code:
    /sbin/service wpa_supplicant restart
    then try wpa_gui
    Last edited by Darkmage; 28th March 2006 at 12:04 AM.

  12. #12
    Darkmage Guest
    @LBrown and Mavtech
    what is your interface called in Network Configuration? If it is something different from wlan0, more modification is required.
    I will post when I get home

  13. #13
    LBrown Guest
    mine is eth1. i think maybe mavtech needs to alter INTERFACES="-wlan0" to INTERFACES="-ieth1" in etc/sysconfig/wpa_supplicant like. i recieved a similar/same problem before i did it.
    good luck mavteh btw

    i think im getting somewhere.
    i set ap_scan=0 and restarted the service. i did the scan, selected my network, entered the ssid (i have it disabled again now), entered the PSK and selected add. it now actually adds the network to the .conf file, and lists it in wpa_gui underneath adapter.
    status now = DISABLED, and pressing 'connect' doesnt seem to make a difference, but at least its progress (i hope)

    oh, one other thing you should know in case it makes a difference - my routers using dhcp.

    my conf file looks like this now (note i obviously removed my ssid and psk!):
    Code:
    ctrl_interface=/var/run/wpa_supplicant
    ctrl_interface_group=10
    ap_scan=0
    opensc_engine_path=/usr/lib/opensc/engine_opensc.so
    pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so
    pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so
    update_config=1
    
    network={
    	ssid="xxxxxxxx"
    	psk="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    	proto=WPA
    	key_mgmt=WPA-PSK
    	pairwise=TKIP
    }
    Last edited by LBrown; 28th March 2006 at 02:21 AM.

  14. #14
    Darkmage Guest
    @LBrown
    Post your /etc/sysconfig/network-scripts/ifcfg-eth1

  15. #15
    TFrog Guest
    Quote Originally Posted by Darkmage
    What is wpa_supplicant?
    "wpa_supplicant is a WPA Supplicant for Linux, BSD and Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). Supplicant is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wlan driver.

    wpa_supplicant is designed to be a "daemon" program that runs in the
    background and acts as the backend component controlling the wireless
    connection. Support for separate frontend programs is included and an
    example text-based frontend, wpa_cli, is included with wpa_supplicant."

    I have a Laptop running Linux and I always wanted to have WPA encryption working with less hassle, this write up should make life a whole lot easier.

    NOTE: Assumption is made that you have ndiswrapper working or wlan0 is detected by Network Configuration and your ssid is been broadcasted with WEP/WPA or WPA2 encryption.
    This page only applies to FC5

    Wpa_supplicant is available from updates and to install it -->
    Code:
     yum -y install  wpa_supplicant-0.4.8-5 wpa_supplicant-gui-0.4.8-5
    navigate to /etc/wpa_supplicant
    Code:
    cd /etc/wpa_supplicant
    With an editor of your choice, modify wpa_supplicant.conf with the following information

    Code:
    ctrl_interface=/var/run/wpa_supplicant
    ctrl_interface_group=wheel
    ap_scan=2
    opensc_engine_path=/usr/lib/opensc/engine_opensc.so
    pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so
    pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so
    update_config=1
    
    network={
            ssid="any"
            key_mgmt=NONE
            disabled=1
    }
    click on Desktop -> System Settings -> Users and Groups. When prompted type in the user root password and hightlight your username and click on Properties. The User Properties windows comes up, then go to the Groups Tab and scroll all the way down to wheel group and put a check mark and Ok out of the window.

    Now to edit the /etc/sudoers file
    If you do not have visudo command, then
    Code:
    yum -y install sudo

    Open a terminal and become root and type in
    Code:
     /usr/sbin/visudo 
    scroll to the line similar to below
    # Same thing without a password
    #%wheel ALL=(ALL) NOPASSWD: ALL

    remove the comment on %wheel, so you have
    # Same thing without a password
    %wheel ALL=(ALL) NOPASSWD: ALL

    Save and exit

    Below is the content of /etc/sysconfig/wpa_supplicant
    Code:
    # wlan0 and wifi0
    # INTERFACES="-iwlan0 -iwifi0"
    INTERFACES="-iwlan0"
    # ndiswrapper and prism
    # DRIVERS="-Dndiswrapper -Dprism"
    DRIVERS="-Dndiswrapper"
    I assume you interface is called wlan0, if it is something different modify /etc/sysconfig/wpa_supplicant accordingly


    Still as root, start the wpa_supplicant service with
    Code:
     /sbin/chkconfig wpa_supplicant on
    /sbin/service wpa_supplicant start
    this should give you an [OK] result.

    You have two choices of running wpa_supplicant, wpa_cli or wpa_gui, I prefer wpa_gui and unfortunately wpa_gui does not have an icon yet but, you can create one.
    Right click your desktop and select "Create Launcher", give it a name, the command is "/usr/bin/wpa_gui", choose an icon for it and the select Ok.

    Restart your system/desktop/laptop/notebook/tablet

    Double click the icon you created and you will be presented with the gui interface for wpa_supplicant, the adapter should have wlan0 highlighted and just click scan --Assumption is made that you have ndiswrapper working and your ssid is been broadcasted with WPA or WPA2 encryption.

    Once you see your ssid, double click on it and type in your encryption key and then connect. Once connected to the ssid, open a terminal and
    Code:
    /sbin/ifup wlan0
    or use Network Control to activate wlan0

    While looking at wpa_gui interface, you should see an ip address assigned to it.
    Hope this helps and please post any question or comment
    I followed your instructions to the letter and was able to get wpa_supplicant to work fine. I even used the command you gave for the shortcut on the desktop and was able to configure a menu selection in KDE for it. Only problem I got now is that my wireless NIC doesn't show up in Network. I've installed the NDISwrapper packages from Livna. My laptop is a Compaq R4125US with a Broadcom 43xx chipset. Maybe you can give me some pointers. Wireless is a breeze for me with the Atheros chipset. However, this Broadcom is a pain in the A**.

Page 1 of 9 123 ... LastLast

Similar Threads

  1. FC9 Create access points with MadWifi
    By gtgoku in forum EOL (End Of Life) Versions
    Replies: 14
    Last Post: 13th September 2010, 02:59 PM
  2. configuring 8 access points ?
    By hermouche in forum Servers & Networking
    Replies: 0
    Last Post: 28th April 2008, 10:15 PM
  3. jumping access points
    By Wangberg in forum Servers & Networking
    Replies: 5
    Last Post: 5th May 2007, 09:10 PM
  4. FC6 Multiple Wireless Access Points
    By Kippei in forum Hardware
    Replies: 1
    Last Post: 31st October 2006, 06:34 PM
  5. no access to mount points in apache (2.0.54 FC4)
    By markg85 in forum Servers & Networking
    Replies: 1
    Last Post: 27th March 2006, 09:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]