Configuring FON as a wireless client (WPA network) (5)


    March 20th, 2007 | Tags:

    There are hundred and one stuffs to be done with the FON router! My current D-Link network camera (DCS-2120) wasn’t capable of connecting to my wireless network due to the constraints of DCS-2120 in accepting certain characters in my WPA key. I toyed with the settings in console mode (of DCS-2120) and failed to make it understand the WPA key, so I guess I would need to work around it.

    To work around it, I configured FON to be the wireless bridge! The DCS-2120 would connect to the FON through the ethernet port and FON would connect to my network as a wireless client.

    Configuring it is easy on OpenWRT (kamikaze). :)

    Step 1
    Ensure you have connectivity with the internet, ssh into FON router and install WPA-Supplicant if you are planning to connect to a WPA secured network.

    root@OpenWrt:~# ipkg update
    root@OpenWrt:~# ipkg install wpa-supplicant

    Step 2

    Next would be configuring the ethernet port to be the lan interface and the wan to be the wireless. Now my /etc/config/network looks like this. If you don’t wish to delete off any additional stuffs you have inside, you can comment them off by add a # at the start of the line.

    config interface loopback
    option ifname lo
    option proto static
    option ipaddr 127.0.0.1
    option netmask 255.0.0.0

    config interface lan
    option ifname eth0
    option proto static
    option ipaddr 172.16.0.1
    option netmask 255.255.255.0

    config interface wan
    option ifname ath0
    option proto dhcp

    The ethernet port would distribute Class B address and the FON router itself would be using the IP 172.16.0.1/24

    Step 3

    Next would be configuring the wireless to be in client mode. My /etc/config/wireless now looks like this

    config wifi-device wifi0
    option type atheros

    config wifi-iface
    option device wifi0
    option mode sta

    Configure the WPA settings. Create a new file /etc/wpa_supplicant.conf (create the file wpa_supplicant.conf at /etc/). In this file, you would specify the SSID of the network to connect to as well as the passphrase for connecting to it.

    ctrl_interface=/var/run/wpa_supplicant
    update_config=1

    network={
    ssid=”<SSID>”
    psk=”<passphrase>”
    }

    To get the wpa_supplicant to auto-run on startup. We would need to create a shell script.
    Create the file /etc/init.d/wpa_start.sh (filename is wpa_start.sh and located at /etc/init.d/)

    #!/bin/sh
    wpa_supplicant -Dwext -iath0 -c/etc/wpa_supplicant.conf -B

    Change the permission of the shell script to 755 and creating a symbolic link from /etc/rc.d/

    root@OpenWrt:~# chmod 755 /etc/init.d/wpa_start.sh
    root@OpenWrt:~# cd /etc/rc.d/
    root@OpenWrt:/etc/rc.d# ln -s /etc/init.d/wpa_start.sh S90wpa_start

    Reboot the device and FON is configured! Make sure all your settings are correct or you might be locking yourself out of FON due to misconfiguration of network interfaces!


    Share it on del.icio.us




    5 responses

    1. Configuring FON as a wireless bridge (WEP network)

      Configuring FON to connect to a WEP secured wireless network as a client is pretty much the same as configuring it to join a WPA network (see in trackbacks) Follow only Step 2 of that entry and we just need…

       
    2. Thankx.
      Now my old computer with NIC can surf wirelessly too.

       
    3. True. It allows those systems with only ethernet ports to be wireless. But then switching between wireless network can be a daunting task.

       
    4. Thanks, I want to go back to my original fw from ddwrt to try freewlan and this is what i needed ;)

       
    5. Thanks, I want to go back to my original fw from ddwrt to try freewlan and this is what i needed ;)

       

    RSS Feeds




    Treat shadowandy!


    Like to treat shadowandy a cup of Starbucks?

    Polls


    Which is your preferred SOHO networking brand?

    • D-Link (48%, 225 Votes)
    • Linksys (27%, 126 Votes)
    • Cisco (12%, 57 Votes)
    • Netgear (7%, 34 Votes)
    • Buffalo (2%, 9 Votes)
    • TRENDnet (1%, 6 Votes)
    • PCI (1%, 5 Votes)
    • Planex (2%, 3 Votes)

    Total Voters: 465

    Loading ... Loading ...

    Recent Comments



    Friend's Blog



    Interesting Links



    Previous Postings



    Copyright © 2005 - 2010 www.shadowandy.net  95 queries. 0.228 seconds.Go back up ↑