http://wiki.openwrt.org/doc/recipes/relayclient
Due I'm seeing a lot of confusion to make a repeater with OpenWRT, I will put the 2 modes available, with its configs.
I hope its easy to understand.
Of course, first install the latest Trunk version of OpenWrt:
http://downloads.openwrt.org/snapshots/trunk/
Working in Atheros hardware and Attitude Adjustment. I don't know if it works on other hardware or OpenWrt versions.
MODE 1: BRIDGED REPEATER
Both wireless networks will be the same network, DHCP addresses wil be given by the main router, all computers will see each other.
First connect the router to internet, by connecting an ethernet cable between the openwrt's router WAN port and the main router.
Install Relayd
opkg update
opkg install relayd
/etc/init.d/relayd enable
.
.
/etc/config/wireless
config wifi-device 'radio0'
#blahblah (default settings)
option channel '1' #Match with the main wireless network channel
option disabled '0'
config wifi-iface
option ssid 'MainWirelessNetwork'
option encryption 'psk' # Set wep, psk or psk2 for WEP, WPA or WPA2
option device 'radio0'
option mode 'sta'
option network 'wwan'
option key 'MainRouterWirelessPassword'
config wifi-iface
option device 'radio0'
option mode 'ap'
option ssid 'RepeaterWirelessNetwork'
option encryption 'psk'
option key 'RepeaterWirelessPassword'
option network 'lan'
.
.
/etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.254' #Set this to match you main router network 192.168.x.254
option netmask '255.255.255.0'
option gateway '192.168.1.1' # Your main router's IP
option dns '8.8.8.8'
config interface 'wwan'
option proto 'static'
option
option
config 'interface' 'stabridge'
option 'proto' 'relay'
option 'network' 'lan wwan'
option ipaddr '10.0.0.240'
.
.
/etc/config/dhcp
config dhcp lan
option interface lan
option start 100
option limit 150
option leasetime 12h
option ignore 1
config dhcp wan
option interface wan
option ignore 1
.
.
As we want to make all the same network, we can disable the firewall:
/etc/init.d/firewall stop
/etc/init.d/firewall disable
.
.
.
MODE 2: REPEATER, DIFFERENT NETWORK
Repeater's clients will be able to see Main Network's devices, but not vice versa.
Addresses in the Repeater network are managed by the repeater.
Nothing has to be downloaded, the stock openwrt is enought. This is the easiest and simplest way of making a repeater
/etc/config/wireless
config wifi-device 'radio0'
#blahblah (default settings)
option disabled '0'
option channel '1' #Match with the main wireless network channel
config wifi-iface
option ssid 'MainWirelessNetwork'
option encryption 'psk' # Set wep, psk or psk2 for WEP, WPA or WPA2
option device 'radio0'
option mode 'sta'
option network 'wwan'
option key 'MainRouterWirelessPassword'
config wifi-iface
option device 'radio0'
option mode 'ap'
option ssid 'RepeaterWirelessNetwork'
option encryption 'psk'
option key 'RepeaterWirelessPassword'
option network 'lan'
.
.
/etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.10.1' #set to different range of your main router's network""
option netmask '255.255.255.0'
config interface 'wwan'
option proto 'dhcp'
.
.
/etc/config/dhcp
config dhcp lan
option interface lan
option start 100
option limit 150
option leasetime 12h
option ignore 0
config dhcp wan
option interface wan
option ignore 1
.
.
/etc/config/firewall
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'lan'
option network 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
option network 'wan wwan'
config forwarding
option src 'lan'
option dest 'wan'
Once internet is running, its easy to install LuCi to get the nice WWW interface:
opkg update
opkg install luci
AND, IF YOU INSTALLED RELAYD
opkg install luci-proto-relay