Connect your B3 as a wireless device to an access point

From BubbaWiki
Jump to: navigation, search

This howto is snitched from our forum, where kenned was kind enough to post it: 


My ISP gave me a router with built-in DSL modem, so I can't use the B3 as a router. Also I don't care to have the B3 close to the router for several reasons. So I needed to use the B3 as a wireless client, serving files and webpages to the local network over wifi, and here's the recipe I followed.
I wanted to put it on the wiki, but couldn't be bothered to request a login.


B3 Wifi client

Configure the B3 as a wifi client to make it connect to a wireless router or an access point.

Prerequisites

You need to have a user account with shell access for the B3.
You also need to be able to log into the root account, either by using "su -" with the root-password, or by using "sudo su -" (which then needs to be set up in advance).

Disable B3 Access Point

Log in to the admin website on http://b3.local using the admin logon.
Click in to the Settings, Profile page and switch to the "Server only" profile.
Then enter the Settings, Network, Wireless page and turn off the wireless access point function of the B3.

Log on to the root account

Using an ssh application, eg. putty, log on to the b3 via ssh and log on to the root account.

[user@MacBook: ~]$ ssh 192.168.1.11
Linux b3 2.6.35.4 #5 Tue Sep 7 16:06:15 CEST 2010 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Mar 24 22:38:42 2011 from macbook.local
user@b3:~$ sudo su -
[sudo] password for user:
root@b3:~#


The following commands all need to be run under the root account.

Install tools

Install wireless-tools and wpasupplicant packages like this:

change_distribution elvin -u
apt-get update
apt-get install wireless-tools wpasupplicant

Configure wifi device

Make the file /etc/network/interfaces readable only by root.

chmod 600 /etc/network/interfaces

Enter the following section into this file (changing MyWifiNetwork and MySecretWifiKey with suitable values).

auto wlan0
iface wlan0 inet dhcp
wpa-ssid MyWifiNetwork
wpa-psk MySecretWifiKey

This makes the wlan0 interface start at boot, connect to the network called "MyWifiNetwork" using the WPA PSK password "MySecretWifiKey" and request an IP address from the DHCP server.

Punch a big hole in the firewall for the wlan0 interface and restart the firewall to save the configuration.

iptables -A INPUT -i wlan0 -j ACCEPT
/etc/init.d/bubba-firewall restart

Now start the wlan0 device to check the settings.

ifup wlan0

The console will show that the device has connected to your WLAN, has sent an DHCP request and shortly after received a reply with the IP address to use.

Now enjoy your wirelessly connected B3.
kenned