Wrt54gl
From MobiComp
Setting up the wrt54gl router
one problem I had was that the hostname was set to sth. strange and therefore the router didn't get a dhcp lease from the network. ssh into the router and do:
nvram set wan_hostname=mobicomp
nvram set boot_wait=on
nvram set wl0_wep=disable
nvram set wl0_phytypes=b
nvram get wl0_phytypes
nvram set wl0_net_mode=b
nvram commit
restart router - don't press reset, switch the power off. Reset bootes the router in fail safe mode.
ifdown wifi
wl0_wep enabled
wl0_key 1
wl0_key1
wl0_auth 0
nvram set wl0_antdiv=0
ifup wifi
first do:
ipkg update ipkg install wl
useful wl commands, a complete list can be found here Wl:
Get tx power limit:
root@mobicomp:~# wl txpwrlimit Current TX Power Limit: 79 mW ( 19.00 dBm)
wl band b - force use of 802.11b band
wl ssid - Set or get the current SSID.
wl wep Set WEP options.
wl wep [options]
[on|enable|1] enable WEP
[off|disable|0] disable WEP
[sw|software] perform WEP in software
[hw|hardware] perform WEP in hardware
wepstatus
Set or Get WEP status
wepstatus [on|off]
primary_key
Set or get index of primary key
addwep Set an encryption key. The key must be 5, 13 or 16 bytes long, or
10, 26, 32, or 64 hex digits long. The encryption algorithm is
automatically selected based on the key size. keytype is accepted
only when key length is 16 bytes/32 hex digits and specifies
whether AES-OCB or AES-CCM encryption is used. Default is ccm.
addwep <keyindex> <keydata> [ocb | ccm] [notx] [xx:xx:xx:xx:xx:xx]
channel Set the channel:
valid channels for 802.11b/g (2.4GHz band) are 1 through 14
txpwr1 (number one, not L) Set tx power in various units. Choose one of (default: dbm):
-d dbm units
-q quarter dbm units
-m milliwatt units
Can be combined with:
-o turn on override to disable regulatory and other limitations
Use wl txpwr -1 to restore defaults
wl txpwr1 -o -m 5 (used by us)
WPA:
http://wiki.openwrt.org/OpenWrtDocs/Configuration#head-3df0fd425a927a2d9a7e5c13f070bc4840eb7144
Backdoor into the router via ssh tunnel:
client : dropbearkey -t rsa -f identity
client : dropbearkey -f identity -y >> identity.pub
copy identity.pub over to server
server : cat identity.pub >>~/.ssh/authorized_keys
ssh -i /etc/dropbear/dropbear_rsa_host_key -l "USER" "HOST" -R "22222:localhost:22"

