1 (edited by dabyd64 2015-09-03 23:28:23)

Topic: Repeater configurations here! Both ways, bridged and simple repeater

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.10.1'
    option gateway '192.168.1.1'   # Your main router's IP
    option netmask '255.255.255.0'
    option dns     '192.168.1.1'

config interface 'wwan'
    option proto 'static'
    option ipaddr '192.168.1.254' #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

config 'interface' 'stabridge' 
    option 'proto' 'relay' 
    option 'network' 'lan wwan' 
    option ipaddr '192.168.1.254' #Same IP as in WWAN

.
.
/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

Update 04/09/2015
Some users had trouble accesing shared services. This should fix them (thanks panni!):

panni wrote:

Install igmpproxy:

opkg install igmpproxy

Then edit the file /etc/config/igmpproxy
Make it look like this:

config igmpproxy
    option quickleave 1

config phyint
    option network wwan
    option direction upstream
    list altnet 192.168.0.0/24

config phyint
    option network lan
    option direction downstream
    list altnet 192.168.0.0/24

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 web interface:

opkg update
opkg install luci

AND, IF YOU INSTALLED RELAYD
opkg install luci-proto-relay

I have tested both and they work. I think this are the easiest configs for making a repeater.

Edit the files manually with the VI editor.
If you don't know how to use it, check this:
---------------------------------------------------------------------------
vi editor small tutorial
Let's edit "network" file

vi network

Now, navigate with the arrow keys to the line you want to read, modify, etc.
To start writing first type "i" (command to insert).
Now you can write, delete, etc as usual.
To exit the insert mode press "ESC".
To delete an entire line, press "d" twice.
Finally, to save the file press "Z" twice. Yes it must be UPPERCASE
If you screwed your file and want to discard changes press control+z to close without saving.


Regards

Re: Repeater configurations here! Both ways, bridged and simple repeater

Good howto, but it's already in the OpenWrt Wiki!

3 (edited by dabyd64 2013-05-15 14:26:02)

Re: Repeater configurations here! Both ways, bridged and simple repeater

Yes, but the wiki has a problem, that is that most of people understand "repeater" but not "bridged/unbridged wireless network".
That's why I said "repeater". 99% of people search repeater.
I had the same problem too, at the beginning is hard to find and understand all the info.

Typing "repeater" in the wiki search won't show you anything useful at first, try it. For the noobs this is a real problem.

Re: Repeater configurations here! Both ways, bridged and simple repeater

Hi, i'm new to this so bear with me, today i installed openwrt over ddwrt and learned how uci works and thats about it of my knowledge, so i've managed to set bridge using this article http://wiki.openwrt.org/doc/recipes/bridgedclient
using brcm 2.4 openwrt but there is nothing about virtual AP part of bridged router but picture clearly shows that both sides have their lan and wlan part functional. I see in this howto that second wireless config adds AP part but i'm confused about network configuration and all the IP addreses and the relayd part because i dont use relayd for bridge so i'm not sure if this configuration will work with mine so if anyone could write a step by step after this configuration http://wiki.openwrt.org/doc/recipes/bridgedclient i will be really grateful, btw primary router is 192.168.1.1 dhcp and bridged one is 192.168.1.2 static.
Thanks!

5 (edited by dabyd64 2012-09-04 13:44:55)

Re: Repeater configurations here! Both ways, bridged and simple repeater

Do you really want to bridge both networks or just a wireless repeater for surfing? the second doesn't need relayd.
Also, tell us your router model, openwrt version...
Post here your configs to be easier to tell you.
Rememer to but your configs like this:

Example:

wireless

[c0de]
blah
blah
blah
[/c0de]

The text betweeen the [c0de] and[/c0de] will be showed like this text box, a lot tidier for reading
Logically its "code" and not "c0de", just typed as that to avoid breaking the sintax in this box.

Re: Repeater configurations here! Both ways, bridged and simple repeater

dabyd64 wrote:

Do you really want to bridge both networks or just a wireless repeater for surfing? the second doesn't need relayd.
Also, tell us your router model, openwrt version...
Post here your configs to be easier to tell you.
Rememer to but your configs like this:

Example:

wireless

[c0de]
blah
blah
blah
[/c0de]

The text betweeen the [c0de] and[/c0de] will be showed like this text box, a lot tidier for reading
Logically its "code" and not "c0de", just typed as that to avoid breaking the sintax in this box.

Thanks for answering, i found this article http://wiki.openwrt.org/doc/recipes/broadcom.repeater i want that but bridged on the same subnet so what i want is wireless repeater bridge.

Router is wrt54gs 1.1 backfire 10.03.1 brcm 2.4

Re: Repeater configurations here! Both ways, bridged and simple repeater

Then do the config #1.
You know how to enter the router by telnet and editing the config files?
The first you need is to give internet to the router so it can download the relayd package.
Can you reach that point yourself?

Re: Repeater configurations here! Both ways, bridged and simple repeater

dabyd64 wrote:

Then do the config #1.
You know how to enter the router by telnet and editing the config files?
The first you need is to give internet to the router so it can download the relayd package.
Can you reach that point yourself?

I know how to edit config files and bridged the router and internet is working but i dont have a virtual wireless ap on the bridged router which means that i can use lan ports with network and internet but dont have wireless signal from router.
relayd package doesn't exist for brcm-2.4 build.

9 (edited by kakonema 2012-09-05 11:10:55)

Re: Repeater configurations here! Both ways, bridged and simple repeater

Followed this http://wiki.openwrt.org/doc/recipes/broadcom.repeater i cant get AP part working, i think that eth0.0 and wl0 are not bridged, the notes say

If you run `brctl show' you will see that eth0.0 and wl0.1 are bridged.

but i get this

bridge name     bridge id               STP enabled     interfaces
br-lan          8000.0013107cd1da       no              eth0.0

is this right?
Here are config

/etc/config/wireless

config wifi-device  wl0
    option type     broadcom
    option channel  11

    # REMOVE THIS LINE TO ENABLE WIFI:
    option disabled 0

config wifi-iface
    option device   wl0
    option network    lan
    option mode     ap
    option ssid     Secondary
    option encryption psk2
    option key    'network'

config wifi-iface
    option device wl0
    option network wan
    option mode    sta
    option ssid    'Main'
    option encryption none

/etc/config/network

#### VLAN configuration 
config switch eth0
    option enable   1

config switch_vlan eth0_0
    option device   "eth0"
    option vlan     0
    option ports    "1 2 3 4 5*"

config switch_vlan eth0_1
    option device   "eth0"
    option vlan     1
    option ports    "0 5"

#### Loopback configuration
config interface loopback
    option ifname    "lo"
    option proto    static
    option ipaddr    127.0.0.1
    option netmask 255.0.0.0


#### LAN configuration
config interface lan
    option type     bridge
    option ifname    'eth0.0'
    option proto    'static'
    option ipaddr    '10.0.0.1'
    option netmask    '255.255.255.0'
    option gateway '' 
    option dns ''

#### WAN configuration
config interface    wan
    option proto    'dhcp'

Any clue?

10 (edited by dabyd64 2012-09-05 16:15:30)

Re: Repeater configurations here! Both ways, bridged and simple repeater

This configs are tested in Attitude Adjustment, and Atheros hardware, I have no idea how the Broadcom hardware works since I have never touched any router with it.
Have you tested the latest trunk version for your router?
http://downloads.openwrt.org/snapshots/trunk/brcm47xx/

11 (edited by dabyd64 2012-09-06 12:56:08)

Re: Repeater configurations here! Both ways, bridged and simple repeater

Did you download the relayd package first? Can the router connect to internet? (do "ping google.es" in the console)
Paste your configs here, and also put the primary router IP address.

I', not sure about the firewall rule..I will check if I can do anything at home.

Re: Repeater configurations here! Both ways, bridged and simple repeater

Oops I see, I didn't realise of that line "Edit: I found out what was wrong, in dhcp file, I needed to add this section.."
I just had saw the configs and the last part hehe, you tricked me smile.
Nice you fixed it! And of course, thanks for posting your problem and how you fixed it, making it available for everybody, in this thread.
A big problem in this forum is that there are a lots of posts about similar problems, so its hard to find them.
Doing it here, will keep the topic up and track all the issues for people who tries the repeater.

Re: Repeater configurations here! Both ways, bridged and simple repeater

Do it as you always did. Telnet your main router or put its ip on the browser. I didn't need to do anything on the firewall.
I can enter both routers perfectly, 192.168.1.1(main router), 192.168.1.254(opemwrt in bridged mode, config #1), 192.168.10.1(config #2, unbridged mode).
By the way,have you tried before asking?

14 (edited by hgrueber 2012-09-25 03:29:23)

Re: Repeater configurations here! Both ways, bridged and simple repeater

For the life of me I cannot get the bridged repeater mode working as per above. Clients that connect to the Repeater AP do not get assigned DHCP addresses from my main Cisco router. Not sure if I'm doing something wrong or that maybe this just isn't supported under the firmware I'm running.

Repeater hardware is TP-Link 1043ND running Attitude Adjustment 12.09-beta. Firewall and dnsmasq is shutdown and Relayd is confirmed as running. I can succesfully connect to the wwan ip address via the wireless connection for management purposes.

I see in the DHCP server logs on the router that the requests come through and a response is sent but no reponse is received from the device.

Router DHCP log

Sep 25 00:50:02.277: DHCPD: DHCPREQUEST received from client 0104.4665.75a5.22.
Sep 25 00:50:02.277: DHCPD: Sending notification of ASSIGNMENT:
Sep 25 00:50:02.277:  DHCPD: address 192.168.1.23 mask 255.255.255.224
Sep 25 00:50:02.277:   DHCPD: htype 1 chaddr 0446.6575.a522
Sep 25 00:50:02.277:   DHCPD: lease time remaining (secs) = 2592000
Sep 25 00:50:02.277: DHCPD: Appending system default domain
Sep 25 00:50:02.277: DHCPD: Using hostname 'android-b07bf949c8721c81' for dynamic update (from hostname option)
Sep 25 00:50:02.277: DHCPD: Sending DHCPACK to client 0104.4665.75a5.22 (192.168.1.23).
Sep 25 00:50:02.277: DHCPD: broadcasting BOOTREPLY to client 0446.6575.a522.
Sep 25 00:50:03.905: DHCPD: client's VPN is .
Sep 25 00:50:03.905: DHCPD: Sending notification of DISCOVER:
Sep 25 00:50:03.905:   DHCPD: htype 1 chaddr 0446.6575.a522
Sep 25 00:50:03.905:   DHCPD: remote id 020a0000c0a8011e00000001
Sep 25 00:50:03.905:   DHCPD: circuit id 00000000
Sep 25 00:50:03.905: DHCPD: DHCPDISCOVER received from client 0104.4665.75a5.22 on interface Vlan1.
Sep 25 00:50:03.905: DHCPD: Seeing if there is an internally specified pool class:
Sep 25 00:50:03.905:   DHCPD: htype 1 chaddr 0446.6575.a522
Sep 25 00:50:03.905:   DHCPD: remote id 020a0000c0a8011e00000001
Sep 25 00:50:03.905:   DHCPD: circuit id 00000000
Sep 25 00:50:03.905: DHCPD: Found previous server binding
Sep 25 00:50:03.905: DHCPD: Sending DHCPOFFER to client 0104.4665.75a5.22 (192.168.1.23).
Sep 25 00:50:03.905: DHCPD: broadcasting BOOTREPLY to client 0446.6575.a522.
Sep 25 00:50:08.389: DHCPD: client's VPN is .
Sep 25 00:50:08.389: DHCPD: Sending notification of DISCOVER:
Sep 25 00:50:08.389:   DHCPD: htype 1 chaddr 0446.6575.a522
Sep 25 00:50:08.389:   DHCPD: remote id 020a0000c0a8011e00000001
Sep 25 00:50:08.389:   DHCPD: circuit id 00000000
Sep 25 00:50:08.389: DHCPD: DHCPDISCOVER received from client 0104.4665.75a5.22 on interface Vlan1.
Sep 25 00:50:08.389: DHCPD: Seeing if there is an internally specified pool class:
Sep 25 00:50:08.389:   DHCPD: htype 1 chaddr 0446.6575.a522
Sep 25 00:50:08.389:   DHCPD: remote id 020a0000c0a8011e00000001
Sep 25 00:50:08.389:   DHCPD: circuit id 00000000
Sep 25 00:50:08.389: DHCPD: Found previous server binding
Sep 25 00:50:08.389: DHCPD: Sending DHCPOFFER to client 0104.4665.75a5.22 (192.168.1.23).
Sep 25 00:50:08.389: DHCPD: broadcasting BOOTREPLY to client 0446.6575.a522.

Looking at packet captures I can see the DHCP responses getting broadcasted throughout the network to 255.255.255.255.

Anyhow I suspect relayd on the repeater isn't forwarding the broadcast responses through to my device requesting a DHCP address.

Config as follows:

/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 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config switch
        option name 'rtl8366rb'
        option reset '1'
        option enable_vlan '1'
        option enable_vlan4k '1'

config switch_vlan
        option device 'rtl8366rb'
        option vlan '1'
        option ports '1 2 3 4 5t'

config switch_vlan
        option device 'rtl8366rb'
        option vlan '2'
        option ports '0 5t'

config interface 'wwan'
        option proto 'dhcp'

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        option type 'bridge'
 
config interface 'stabridge'
        option proto 'relay'
        option ipaddr '192.168.1.26'
        option network 'lan wwan'
        list network 'lan wwan'

/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option macaddr 'b0:48:7a:db:57:6a'
        list ht_capab 'SHORT-GI-40'
        list ht_capab 'DSSS_CCK-40'
        option distance '20'
        option country 'US'
        option txpower '20'
        option channel '4'
        option noscan '1'

config wifi-iface
        option device 'radio0'
        option mode 'sta'
        option ssid 'MY_SSID'
        option encryption 'psk2'
        option key 'KEY'
        option network 'wwan'

config wifi-iface
        option device 'radio0'
        option key 'KEY'
        option mode 'ap'
        option encryption 'psk2'
        option ssid 'MY_SSID'
        option network 'lan'

/etc/config/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'

/etc/config/firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option network 'lan wwan stabridge'

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        option network 'wan'

config forwarding
        option src 'lan'
        option dest 'wan'

Re: Repeater configurations here! Both ways, bridged and simple repeater

did you tried disabling the firewall?

16 (edited by hgrueber 2012-09-25 12:38:33)

Re: Repeater configurations here! Both ways, bridged and simple repeater

dabyd64 wrote:

did you tried disabling the firewall?

Hey,

Yes, firewall is disabled (I put in the config above anyway as I have tried with and without).

I am running OpenWrt Attitude Adjustment r33482.

I found this bug report for r33212 which mentions the same problem I am experiencing.
Not sure if related but looks like I'm not the only one who has seen this issue with relayd not forwarding dhcp.

https://dev.openwrt.org/ticket/12063

Re: Repeater configurations here! Both ways, bridged and simple repeater

There are some routers that doesn't work with relayd.
For example, with some Hitron routers, relayd won't work, so I have to do routing... I have no idea why.
It seems that the router doesn't release the DHCP address for the same mac, the wireless client 'iface' will request all DHCP addresses for all the clients in Openwrt's network...maybe its something about that.
But no idea!

Re: Repeater configurations here! Both ways, bridged and simple repeater

Well the DHCP request is sent from the tp-link bridge AP and the response is sent back from the DHCP server to the client mac address. Nothing is received back though on the lan side of the repeater AP. Its almost as if the bridge AP is just throwing it away and not forwarding the DHCP response back through to the repeater AP lan side. Weird.

Anyhow I managed to get this all working using routed method above in your post. smile
Not the ideal way but it works.
Also for some reason it is really unstable if I try to use wireless N, have had to run this router repeater as wireless G only. It is highly unstable when running N for me with constant dropouts, all fine on G though.

19 (edited by dabyd64 2012-09-26 14:55:40)

Re: Repeater configurations here! Both ways, bridged and simple repeater

Download the latest trunk release (r33482) and try again.
Can you try with other router? Or whatever that can give wifi and dhcp addresses. Maybe it's your main router.
For example, if you have and Android phone, enable wifi tether and setup openwrt to connecto to it. Then try if the dhcp works.
About the N or G mode, I always use the mode "11ng". I tried "HT20" and "HT40+" (20 and 40MHz) and both worked well...

Re: Repeater configurations here! Both ways, bridged and simple repeater

Hi dabyd64,
I try the first method and it works perfectly. Thanks for sharing, can these be done via luci ?

I got a small tl wr703n, was thinking when go oversea can use it as a repeater in the hotel room

21 (edited by dabyd64 2012-11-12 23:06:07)

Re: Repeater configurations here! Both ways, bridged and simple repeater

I don't configure this from the start through Luci, it's much faster copying the files directly. I have not even tried.

Once you installed Luci and set the config files, yes, you can configure both wireless interfaces, by going to Network/Wireless on Luci.
Changing the SSID, Channel and Security settings takes only a minute smile

Re: Repeater configurations here! Both ways, bridged and simple repeater

Hello,
I have tried the MODE 1: BRIDGED REPEATER, and it seems to work, or at least it makes a visible AP. I would however just like to extend my wifi coverage, so I'm wondering if I can select the same name for both the main router and the "option ssid 'RepeaterWirelessNetwork'" Or will they interfere in some way so that the repeater looses its connection? I'm asking because the setup is far away and I can't risk to try if it doesn't work..
So can the repeater be connected to a main router with the same SSID as itself then redistributes? I know it works with WDS but this isn't the same. Also, I haven't turned the firewall off, just accepted incoming ssh connections.

Re: Repeater configurations here! Both ways, bridged and simple repeater

You can name your repeater with the same name.
However, I don't recommend to do that, my experiences say that some devices get confused and sometimes they connect to the weak signal from the main router, and  others they do to the strong from openwrt, and so on.
It can be painful if that happens.
Easily solved by calling you repeater as "MyNetwork2" for example.
If you break wifi (it stops broadcasting the wireless)while testing, don't worry, connect by ethernet and reconfigure.
regards

Re: Repeater configurations here! Both ways, bridged and simple repeater

Can I Use TL-WR740N with OpenWRT as a wireless client while making a PPPOE connection at the same time?

I have to make a PPPOE connection on every computer I use on my primary router (locked Thomson 780WL).

I would like to connect to Thomson with my WR740N (not possible by cable, only by wireless) router and have Internet access from it.

I would like to know if this is possible without having to buy a third router (that would make PPPOE connection via wan port).

Thanks in advance!

Re: Repeater configurations here! Both ways, bridged and simple repeater

Hi,
I have a openwrt HG553 that I'd like to use as repeater of a master WDS Telsey router (not openwrt) linked via wifi, not cable.

How can I configure HG553 Openwrt wireless and network?
It's the same if i need to use #1 or #2 solution.

Thanks a lot