Warning: This is a Debian-centric page
This page is written by a Debian user with Debian in mind. Thus, he liberally uses apt-get, and assumes that
everything will work exactly the same for you.
If you don't run Debian (or something based on it like Ubuntu), it won't, so please find the differences and add them to this page.
Contents |
How to setup a WLAN off a wired LAN.
In order to get the wireless card working I used ndiswrapper, I have included some basic instructions for this. If your card is not supported in this method you will have to get it working before procceding.
The wireless network has been designed also around a class c subnet (10.0.2.0).
The gateway router is 10.0.1.2 - if this is not how it is on your network then change it, just make sure you change it everywhere, my DNS server is also the on the same IP address. For compatibility with ndiswrapper i am also using 2.6.8 kernel, I have also found it to not work with 2.4 kernels.
Downloading and installing the programms
dhcp and ndiswrapper are optional
# apt-get install wireless-tools iptables dhcp ndiswrapper-utils ndiswrapper-modules-2.6.8-2-386
ndiswrapper
Finding your card
find out what chip set you are running
$ lspci
Check that it is supported and if there are any other instructions from this list.
Finding the drivers
The best way is to find your card on the same list, and download the aprpriate drivers, you may also get the drivers from a windows/wine install or directly from the install cd, however ndiswrapper warns that though this may work it is likely to be unstable.
Install the driver into ndiswrapper
# ndiswrapper -i /path/to/folder/containing/inf_file.inf
Note that the 'containing' folder must house all files that belong with the card's XP driver: Providing simply the .inf file alone, does not provide ndiswrapper all the information to install.
Checking that it worked
$ dmesg | tail -n 20
if you see something like the the following, every thing worked correctly.
ndiswrapper: driver bcmwl5 (Belkin,05/26/2003, 3.20.21.0) loaded ndiswrapper: using irq 5 wlan0: ndiswrapper ethernet device 00:90:96:67:3c:a8 using driver bcmwl5, configuration file 14E4:4320.5.conf
Automatically loading the module
Run this command to automatically load the module on every boot (i.e. add it to /etc/modules)
# ndiswrapper -m
Configuring the wireless card
Now that the card has been installed configure your wlan0 interface, here is a simple setup for more detailed information read the iwconfig man page.
If you are running debian add the following to /etc/network/interfaces
auto wlan0 iface wlan0 inet static address 10.0.2.1 netmask 255.255.255.0 #my wired local router gateway 10.0.1.2 wireless_channel 5 wireless_rate auto wireless_mode auto wireless_essid tuxbox
IPTables Configuration
Next is to configure forwarding and masqueradeing, for this I chose to use iptables, though there are many other ways to go about it.
# iptables -P FORWARD DROP # iptables -A FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT # iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Configureing DHCPD
This is optional but will make it so you don't have to manually enter in ip addresses on each host that wants to connect
to enable DHCP for wlan0 edit /etc/dhcpd.conf to be
#my domain name server
option domain-name-servers 10.0.1.2;
max-lease-time 500;
default-lease-time 200;
#wireless subnet
subnet 10.0.2.0 netmask 255.255.255.0 {
#range of ips that host will be assinged
range 10.0.2.100 10.0.2.120;
option subnet-mask 255.255.255.0;
#ip address of access point, not gateway
option routers 10.0.2.1;
}
Thats it.
Now you have a wireless access point that you may share if you chose, if you wish to share it please consider adding it to nodedb, and check out Cape Town Wireless User Group.
Enjoy.

