====== OpenWrt ======
===== Introduction =====
In January 2006 we acquired an ASUS WL500G deluxe, which is a hardware router which also comes with a builtin 4-port ethernet switch, a wlan accesspoint and - which makes it very interesting - two USB2.0 ports. We reflashed that thing with the [[http://openwrt.org|OpenWrt firmware]], which went without any problems and turned the little device into a full sized linux box.
===== Quicknotes =====
* Interfaces on ASUS WL500G Deluxe: LAN = vlan0, WAN = vlan0, WIFI = eth1
===== dnsmasq refuses to start =====
* Symptom: ''Syntax error: network+192.168.1.100''
* Solution: ''dnsmasq'' expects the dhcp-ip-range to be given as integers, not as ip-adresses, so instead of
nvram set dhcp_start 192.168.0.100
nvram set dhcp_end 192.168.0.200
nvram commit
do a
nvram set dhcp_start 100
nvram set dhcp_end 200
nvram commit
and restart ''dnsmasq'': ''/etc/init.d/S50dnsmasq''
Source: [[http://wiki.openwrt.org/OpenWrtDocs/dnsmasq#head-a0efbfcb5d7bdb3240407ed83372cdec78b86f2e|OpenWrtDocs > dnsmasq]]
===== Remove bridge between wifi and lan interface =====
* Add to ''/etc/firewall.user'':
WIFI=$(nvram get wifi_ifname)
iptables -A FORWARD -i $WIFI -o $WAN -j ACCEPT
iptables -A FORWARD -i $WIFI -o $LAN -j ACCEPT
iptables -A FORWARD -i $LAN -o $WIFI -j ACCEPT
* Set the following in nvram: lan_ifname=vlan0
lan_proto=static
lan_ipaddr=192.168.0.1
lan_netmask=255.255.255.0
wifi_ifname=eth1
wifi_proto=static
wifi_ipaddr=192.168.1.1
wifi_netmask=255.255.255.0
and commit it and reboot.
* Add to ''/etc/dnsmasq.conf'':
dhcp-range=lan,192.168.0.100,192.168.0.199,2h
dhcp-range=wlan,192.168.1.100,192.168.1.199,2h
and do a ''killall -9 dnsmasq ; /etc/init.d/S50dnsmasq''.
* Sources:
* [[http://wiki.openwrt.org/OpenWrtDocs/Configuration#head-0823ebb7c6f057f8fcee871cca0dc3f4e2929172|OpenWrtDocs > Configuration > Sample network configurations]]
* [[http://wiki.openwrt.org/OpenWrtDocs/dnsmasq#head-8f0a2be5d968e166ed1c47ac1896ff270f07859c|OpenWrtDocs > dnsmasq > Configuring dnsmasq to use different IP ranges for wired and wireless]]
* [[http://therowes.net/~greg/blog/?postid=33|openwrt: burning the bridge part II]]
===== HP LaserJet 1000 =====
* On a standard linux box of your choice:
* ''wget http://foo2zjs.rkkda.com/foo2zjs.tar.gz && tar xvfz foo2zjs.tar.gz && cd foo2zjs''
* ''make'' \\ ''./getweb lj1000''
* Copy ''sihp1000.img'' to your router
* On your router:
* Install the ''p910nd'' package according to the [[http://wiki.openwrt.org/PrinterSharingHowto#head-11fecdddd08a3ea093c1817213fe4d575120af4e|OpenWRT docs]]: ''ipkg install p910nd''.
* Install the ''kmod-usb-printer'' kernel modules: ''ipkg install kmod-usb-printer''
* Create a new file ''/etc/hotplug.d/usb/hplj1000'': #!/bin/sh
FIRMWARE="/data/sihp1000.img"
if [ "$PRODUCT" = "3f0/517/120" ]
then
if [ "$ACTION" = "add" ]
then
logger "Sending firmware to printer..."
cat $FIRMWARE > /dev/usb/lp0
logger "done."
fi
fi
Remember to adjust the firmware location accordingly.
* Now configure the clients from which you want to print, according to [[http://wiki.openwrt.org/PrinterSharingHowto#head-8cebbb267ff2553eb24c0431d16dfa596e29b081|the OpenWRT docs]]. You're done :-)
===== Linkdump =====
* [[http://mpd.wikicities.com/wiki/OpenWRT_FullInstall|mpd on OpenWRT]]