23 February 2011

OpenWRT on Motorola WR850g

tested on V2 and V3 using White Russian RC3
I have also done similar procedures for RC6
RC3 was more reliable and smaller


Install X-Wrt:

I used the tftp method on my wr850g (this might set the routers lan IP to 192.168.1.1), but I recommend using the X-Wrt bin file and uploading it via the web interface.

1. NVRAM


ssh root@192.168.10.1 (or whatever IP you use)
nvram set lan_ifname=vlan0
nvram set lan_proto=static
nvram set lan_ipaddr=192.168.10.1
nvram set lan_netmask=255.255.255.0
nvram set wifi_ifname=eth1
nvram set wifi_proto=static
nvram set wifi_ipaddr=192.168.1.1
nvram set wifi_netmask=255.255.255.0
nvram set wan_ifname=vlan0
nvram set wan_proto=dhcp
nvram set wl0_ssid=Hotspot
nvram commit
reboot


2.1 DNSMASQ

this step only applies to X-WRT firmwares. skip to section 2.2. See webif^2 to set up DNS and DHCP for the three interfaces vlan0, vlan1, and wifi


2.2 Skip this step if using firmware >= RC4

ln -s /usr/sbin/dnsmasq /etc/init.d/S50dnsmasq
chmod a+x /etc/init.d/S50dnsmasq
rm /etc/dnsmasq.conf
vi /etc/dnsmasq.conf


/etc/dnsmasq.conf :

domain-needed
bogus-priv
filterwin2k
local=/lan/
domain=lan
except-interface=vlan1
dhcp-range=vlan0,192.168.10.200,192.168.10.250,255.255.255.0,3h
dhcp-range=eth1,192.168.1.200,192.168.1.250,255.255.255.0,1h
dhcp-leasefile=/tmp/dhcp.leases
dhcp-option=vlan0,3,192.168.10.1
dhcp-option=vlan0,6,192.168.10.1
dhcp-option=eth1,3,192.168.1.1
dhcp-option=eth1,6,192.168.1.1


3. FIREWALL

vi /etc/init.d/S35firewall

NOTE: after doing a new WR850g with RC3 I used /etcinit.d/S45firewall please find a file is right for you. (hint: use ls /etc/init.d/)

Add:

WIFI="$(nvram get wifi_ifname)"


under the similar entries at the top.

Find the ### FORWARDING section
Add:

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


under accept and similar entries. Remove the # from the last two lines to enable a "soft" bridge.

APPENDIX:
quick vi help:
(Esc : I) to enter edit mode
(Esc : q!) to exit with out saving
(Esc : wq) to exit and save
I take no responsability for this information or what you do with it.

No comments:

Post a Comment