OpenWrt Kamikaze 7.09: wireless client setup


requisites:
--- a linksys wrt54gl router
--- valid openwrt.bin image (7.09 brcm-2.4)
--- tftp installed on host (apt-get install tftp)
--- untar kamikaze-postinstall.tar in your home directory on host (inside there are the confiluration files used here, and the ipkg packages needed if you have to work offline)


1) enable virtual interface on host

root@host:/home/user/# ifconfig eth0:0 192.168.1.2 up

2) install openwrt.bin on router (being in the same directory as the.bin file)

root@host:/home/user/# tftp 192.168.1.1
tftp> binary
tftp> rexmt 1
tftp> trace
Packet tracing on.
tftp> timeout 60
tftp> put openwrt-wrt54g-2.4-squashfs.kamikaze709.bin 

3) login to router, change password and reboot

root@host:/home/user/# telnet 192.168.1.1

Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
 === IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
 ------------------------------------------


BusyBox v1.4.2 (2007-09-29 09:01:24 CEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (7.09) -----------------------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/# dropbear
root@OpenWrt:/# passwd
Changing password for root
New password:
Bad password: too weak
Retype password:
Password for root changed by root
root@OpenWrt:/# reboot

4) login to router

root@host:/home/user/# ssh 192.168.1.1
The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
RSA key fingerprint is 98:54:51:24:80:51:86:fc:c4:09:79:8b:45:ed:2c:95.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.1' (RSA) to the list of known hosts.
root@192.168.1.1's password:


BusyBox v1.4.2 (2007-09-29 09:01:24 CEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (7.09) -----------------------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:~#

5) modify /etc/config/network (lan interfaces settings)

root@OpenWrt:~# scp 192.168.1.2:/home/user/kamikaze-postinstall/network /etc/config/

6) modify /etc/config/wireless (wireless interface settings)

root@OpenWrt:~# scp 192.168.1.2:/home/user/kamikaze-postinstall/wireless /etc/config/

7) modify /etc/firewall.user (firewall settings)

root@OpenWrt:~# scp 192.168.1.2:/home/user/kamikaze-postinstall/firewall.user /etc/

8) modify /etc/ipkg.conf (package management repositories)

root@OpenWrt:~# scp 192.168.1.2:/home/user/kamikaze-postinstall/ipkg.conf /etc/

9) add a virtual interface on router, connect to internet (the .99. network is the host lan, the .100. network is the lan created behind the router)

root@OpenWrt:~# reboot
root@host:/home/user# ifconfig eth0:0 down
root@host:/home/user# ifconfig eth0:0 192.168.100.2 up
root@host:/home/user# ssh 192.168.100.1
root@OpenWrt:~# /etc/init.d/dnsmasq stop
root@OpenWrt:~# ifconfig br-lan:0 192.168.99.200 up
root@OpenWrt:~# route del default gw 192.168.1.1 wl0
root@OpenWrt:~# route add default gw 192.168.99.1 br-lan:0
root@OpenWrt:~# ping 141.20.1.3

10) fix the dns server list

root@OpenWrt:~# rm /etc/resolv.conf
root@OpenWrt:~# scp 192.168.99.99:/home/user/kamikaze-postinstall/resolv.conf /etc/
root@OpenWrt:~# ping heise.de

11) update package list and install packages

root@OpenWrt:~# ipkg update
root@OpenWrt:~# ipkg install wl webif webif-applications
root@OpenWrt:~# ipkg install ntpclient qos-scripts 
root@OpenWrt:~# ipkg install kismet-drone macchanger aircrack-ng

12) configure the QOS bandwidth management

root@OpenWrt:~# scp -r 192.168.99.99:/home/user/kamikaze-postinstall/l7-protocols /etc/
root@OpenWrt:~# scp 192.168.99.99:/home/user/kamikaze-postinstall/qos /etc/config/
root@OpenWrt:~# ln -s /etc/init.d/qos /etc/rc.d/S51qos

13) syncronize date

root@OpenWrt:~# ntpclient  -c 2 -h pool.ntp.org -s

14) allow host to passwordless ssh login

root@OpenWrt:~# scp 192.168.99.99:/root/.ssh/id_rsa.pub /etc/dropbear/authorized_keys

15) add a 'scan' alias for 'wl scan'

root@OpenWrt:~# echo "" >> /etc/profile ; echo "alias scan='wl scan ; wl scanresults'" >> /etc/profile

16) add a 'wl scan' page to the http management of the router

root@OpenWrt:~# scp 192.168.99.99:/home/user/kamikaze-postinstall/status-scan.sh /www/cgi-bin/webif/

16) add useful scripts

root@OpenWrt:~# scp 192.168.99.99:/home/user/kamikaze-postinstall/channelhop.sh /usr/sbin/
root@OpenWrt:~# scp 192.168.99.99:/home/user/kamikaze-postinstall/wstat.sh /usr/sbin/

17) automatize macchanger on boot

root@OpenWrt:~# scp 192.168.99.99:/home/user/kamikaze-postinstall/macchanger  /etc/init.d/
root@OpenWrt:~# ln -s /etc/init.d/macchanger /etc/rc.d/S38macchanger

17) configure the kismet drone (you'll have to configure /etc/kismet.conf on the host)

root@OpenWrt:~# scp 192.168.99.99:/home/user/kamikaze-postinstall/kismet_drone.conf  /etc/kismet/

18) the end: reboot and test if everything is ok!

root@OpenWrt:~# reboot 


---

References:

OpenWrt homepage

OpenWrt Wiki



-----------------------------
last update: inputs_marmalade 27/02/2009

###
contributions / feedback / questions


gpg public key
http://ram.squat.net/tech/inputs.marmalade.asc
###