This is how I did it in openWRT:
I start by "turning around" the firewall: normally it's open from LAN and WLAN, and closed from WAN. Doing this first allows you to connect to the WAN port in case you accidentally mess up the LAN ports.
The WAN port will still be in DHCP mode, so you can simply plug it into your hub/switch.
/etc/init.d/S45firewall is:
#!/bin/sh
. /etc/functions.sh
WAN=$(nvram get wan_ifname)
WIFI=$(nvram get wifi_ifname)
IPT=/usr/sbin/iptables
for T in filter nat mangle ; do
$IPT -t $T -F
$IPT -t $T -X
done
$IPT -t filter -A INPUT -m state --state INVALID -j DROP
$IPT -t filter -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPT -t filter -A INPUT -i $WIFI -j DROP
$IPT -t filter -A FORWARD -m state --state INVALID -j DROP
$IPT -t filter -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPT -t filter -A FORWARD -i $WIFI -j DROP
$IPT -t filter -A FORWARD -o $WIFI -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
$IPT -t nat -A POSTROUTING -o $WIFI -j MASQUERADE
Next step is breaking down the bridge, keep an eye on http://openwrt.org/OpenWrtNVRAM for details.
nvram set lan_ifname=vlan0 # [ "vlan2"on v1 ]
nvram set lan_proto=static
nvram set lan_ipaddr=192.168.102.1 # Use some obscure IP to prevent conflicts with any AP
nvram set wifi_ifname=eth1 # [ "eth2" on v1 ]
nvram set wifi_proto=static
nvram commit
reboot
Then put the box into client mode:
nvram set wl0_mode=sta # Station mode (client mode)
nvram commit
reboot
Install the wl package:
cd /etc
rm ipkg.conf
cp /rom/etc/ipkg.conf .
vi ipkg.conf
And add this line to ipkg.conf:
src free.fr http://wrt54g.free.fr/openwrt/b4/ipkg/
Then install wl:
ipkg update
ipkg install wl
Now you can use
wl scan; sleep 2; wl scanresults
wl join SSID amode open
udhcp -q -n -i eth1 # eth2 on v1.1
I made some ash scripts that automatically keep scanning for APs and then automatically connect and create a VPN to a server of mine. I plan to package it when I finished the details.
As far as I understood things, 84mW is the maximum the Linksys can do anyway. The nvram setting can go higher (it's 255 by default on openwrt), but I'm still a little confused how it really works.
You can check some of the settings using
and
Hope this helps.
Jannes