Check my configs: (they are not the full configs, just the parts you must add or modify)
network:
config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.11.1' # to access from LAN if you lose dhcp from main router, force your ip to 192.168.11.x
config interface 'wan'
option ifname 'eth1'
option proto 'none'
config interface 'stabridge'
option proto 'relay'
option network 'lan wlanAP wlanSTA'
option ipaddr '192.168.2.254' # MATCH THIS IP WITH wlanSTA !!
config interface 'wlanSTA'
option proto 'static'
# by default is for a main router using 192.168.2.1. for your main router
# It is set to 254 to be the last one and make all the IP range available for clients.
option ipaddr '192.168.2.254' # change to 192.168.0.254 , 192.168.1.254 , etc
option netmask '255.255.255.0' # to match the your main router's subnet
option gateway '192.168.2.1' # set your main router's IP both in gateway and dns
option dns '192.168.2.1'
config interface 'wlanAP'
option proto 'static'
option ipaddr '192.168.10.1' # to access from WLAN if you lose dhcp from main router, force your ip to 192.168.10.x
option netmask '255.255.255.0'
wireless
config 'wifi-device' 'radio0'
option 'type' 'mac80211'
option 'macaddr' '40:50:xx:xx:xx:xx'
option 'hwmode' '11ng'
list 'ht_capab' 'SHORT-GI-20'
list 'ht_capab' 'SHORT-GI-40'
list 'ht_capab' 'RX-STBC1'
list 'ht_capab' 'DSSS_CCK-40'
option 'txpower' '30'
option 'disabled' '0'
option 'channel' '1' #<--ONLY CHANGE THIS OPTION ON YOUR WIFI-DEVICE! SET THE WIFI CHANNEL WHERE YOUR MAIN ROUTER IS ON.
option 'country' 'US'
option 'htmode' 'HT20'
config 'wifi-iface'
option 'device' 'radio0' # PUT THE SAME DEVICE NAME THAT IS SET BY DEFAULT ON YOUR OPENWRT !!
option 'mode' 'sta' # CLIENT MODE
option 'network' 'wlanSTA' #
option 'ssid' 'MainRouterSSID' # SET THE WIRELESS NAME OF YOUR MAIN WIRELESS NETWORK
option 'encryption' 'psk2' # UNCOMMENT THE SECURITY YOU WANT TO USE.
#option 'encryption' 'psk' # ONLY ON CAN BE UNCOMMENTED!! (UNCOMMENT = REMOVE #)
#option 'encryption' 'wep'
option 'key' 'MainRouterPassword' # SET THE WIRELESS PASSWORD
config 'wifi-iface'
option 'device' 'radio0' # PUT THE SAME DEVICE NAME THAT IS SET BY DEFAULT ON YOUR OPENWRT !!
option 'mode' 'sta' # ACCESS POINT MODE
option 'network' 'wlanAP' #
option 'ssid' 'MyRepeater' # SET THE WIRELESS NAME YOU WANT
option 'encryption' 'psk2' # UNCOMMENT THE SECURITY YOU WANT TO USE.
#option 'encryption' 'psk' # ONLY ON CAN BE UNCOMMENTED!! (UNCOMMENT = REMOVE #)
#option 'encryption' 'wep'
option 'key' 'MyRepeaterPassword' # SET THE WIRELESS PASSWORD YOU WANT, CAN BE DIFFERENT FROM THE wlanSTA KEY
firewall
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option drop_invalid '1'
config zone
option name 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option network 'lan wlanAP wlanSTA'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option masq '1'
option mtu_fix '1'
option forward 'REJECT'
option network 'wan'
config forwarding
option src 'lan'
option dest 'wan'
config rule
option 'src' 'wan'
option 'proto' 'udp'
option 'dest_port' '68'
option 'target' 'ACCEPT'
option 'family' 'ipv4'
config include
option path '/etc/firewall.user'
dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
config dhcp 'lan'
option interface 'lan'
option ignore '1'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config dhcp 'wlanAP'
option interface 'wlanAP'
option ignore '1'
By putting this configs on the router and rebooting, the only thing you will need to install is "relayd". All Luci etc is optional.
The easiest is to start over again.
Always connect with Ethernet until its finished.
Erase the router config by doing "mtd -r erase rootfs_data". It will erase all settings and reboot.
Set yor IP manually to 192.168.1.11 for example.
Connect by telnet to it,(192.168.1.1) and modify the configs as shown, but adapting it to the main router's IP and wireless security settings, of both networks, and its channel.
Check this https://forum.openwrt.org/viewtopic.php?id=35953 to see how to modify them with vi editor.
You can also edit manually the config files in windows, matching your router wireless device .
And then upload them to the router directly by running a http server. It is explained there too.
When finished, re-check the config twice. If correct, set the router where it can connect to the wireless network. Reboot it.
Change your ip to the new lan range, ex. 192.168.11.11.
Telnet again the router, this time 192.168.11.1.
Check that the router has connected to the wireless network and has internet, by doing "ping google.es" on the telnet shell.
If you got response, break it doing control+c and continue. If not, something is wrong, break it, and check all the configs, wireless settings....
At this point, only the router will have internet, as the DHCP still doesn't work. You need "relayd" to send the DHCP requests from the repeater clients to the main router.
Do "opkg update" and then "opkg install relayd".
Do "/etc/initd.d/relayd enable"
"/etc/initd.d/relayd start"
(optional, just for the nice HTTP WebGUI )
If you want LuCi, do this:
"opkg install luci luci-proto-relay"
"/etc/initd.d/uhttpd enable"
"/etc/initd.d/uhttpd start"
FINISHED!!
Reboot. Set your LAN IP to auto or DHCP, disconnect and reconnect the LAN cable to make sure it renews.
Now you should get and IP address from the main router by either wireless or lan, also should have internet and be able to access both the main router and openwrt's.
To access the openwrt's router by HTTP go to 192.168.x.254. You should have previously configured it on your "network" config.
By telnet is the same address.
If the repeater looses connectivity with the main router, you will loose all conectivity with both routers as the DHCP depends on the main router.
In this case, to access openwrt's router, manually assign IP addresss of 192.168.10.xx if connected with LAN or 192.168.11.xx with wifi.
I have been using this config for months. Very stable and fast, running for months without rebooting on a cheap TP-Link WR740n v4.
It was just 14euro, about 18$ USD. A great value for the money.
I also was new at OpenWRT 6 months ago...completely lost. I understand how you might be feeling. OMG I thought it was going to be easier!
It is!! But there are so much options and looots of info that is very easy lo get lost.
Good luck, let me know if you achieve it!
(Last edited by dabyd64 on 28 Aug 2012, 18:26)