OpenWrt Forum Archive

Topic: Wireless Repeater

The content of this topic has been archived on 1 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I am trying to create a wireless repeater, I followed the instructions here: http://wiki.openwrt.org/oldwiki/Repeater but having some trouble, would appreciate some help please.  Firstly, is there any newer documentation on Repeater howto?

The router comes up with two wifi interfaces ok, one STA and the other AP. I can connect from my laptop to the SSID of the repeated side and ssh into the router. In turn it has successfully associated with the upstream master access point. However I cannot ping anything through the link to the main network.

Laptop ----> Repeater ----> Upstream AP ---> My network

I can get it partially working if I firstly assign an IP (different subnet to the repeated side) to the iface of the STA side, and then force a static route. Then I can ping from the router through the uplink wireless connection. But I still cannot access the network from the laptop itself.

So, how to make repeating work? how to make the route automatic? and do I need to also configure IP MASQ?

I hope I am explaining this well. Here is my config:

Kamikaze r23970

/etc/config/wireless

config 'wifi-device' 'radio0'
        option 'type' 'mac80211'
        option 'macaddr' 'e0:05:c5:68:a3:9a'
        option 'hwmode' '11ng'
        list 'ht_capab' 'SHORT-GI-40'
        list 'ht_capab' 'TX-STBC'
        list 'ht_capab' 'RX-STBC1'
        list 'ht_capab' 'DSSS_CCK-40'
        option 'channel' '4'
        option 'htmode' 'HT40+'

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


config 'wifi-iface'
        option 'device' 'radio0'
        option 'mode' 'sta'
        option 'ssid' 'MY_MAIN_NETWORK_SSID'
        option 'encryption' 'psk2'
        option 'key' 'supersecret'

/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.3.1
        option netmask  255.255.255.0
        option gateway ''

# disabled wan, not used.
config interface wan
        option ifname   eth1
        option type     bridge
        option disabled 1
        option proto    static
        option netmask  255.255.255.0


config switch eth0
        option enable_vlan      1

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


iwconfig:

wlan0     IEEE 802.11bgn  Mode:Master  Frequency:2.427 GHz  Tx-Power=27 dBm
          RTS thr:off   Fragment thr:off
          Power Management:on

wlan1     IEEE 802.11bgn  ESSID:"MY_MAIN_NETWORK_SSID"
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:90:CC:F2:3B:A4
          Bit Rate=1 Mb/s   Tx-Power=27 dBm
          RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=70/70  Signal level=-40 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:2   Missed beacon:0

mon.wlan0  IEEE 802.11bgn  Mode:Monitor  Tx-Power=27 dBm
          RTS thr:off   Fragment thr:off
          Power Management:off


I have to manually give wlan0 an IP, with "ifconfig wlan0 192.168.1.27", then set static route "route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 dev wlan0", before I can ping 192.168.1.1 from the router.

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.3.0     *               255.255.255.0   U     0      0        0 br-lan
192.168.1.0     192.168.1.1     255.255.255.0   UG    0      0        0 wlan1
192.168.1.0     *               255.255.255.0   U     0      0        0 wlan1

brctl show:
bridge name     bridge id               STP enabled     interfaces
br-lan          8000.e005c568a39a       no              eth0
                                                        wlan0
br-wan          8000.e005c568a39a       no              eth1


Hardware:  TP-Link TL-WR741N, Atheros AR9285



Thanks

butako

Just a quick review of your configurations. You forgot to assign network to the sta mode config. But, watch out that bridged client mode only works on brcm-2.4.

Client Mode Wireless - OpenWrt Wiki

The documentation at http://wiki.openwrt.org/oldwiki/Repeater does not have an 'option network' for the sta side either. 

As you say, I am guessing the hardware does not support. The example for the repeater is broadcom. My device is mac80211.

But its so almost working, i can connect from my laptop to the router, and then ssh out from the router to the main network OK. I even had it working using an ssh -D socks trick from laptop->router, but that is a workaround and a bit of a chore. I feel its a problem with IP masquerading, maybe need some help getting that working.

I want this repeater to boost the network to reach my bathroom.

butako wrote:

The documentation at http://wiki.openwrt.org/oldwiki/Repeater does not have an 'option network' for the sta side either.

[s]Then you have to specify "ifname" in lan config. Ex.,[/s]

config    interface    lan
    option    type    bridge
    option    ifname    'eth0 wlan0 wlan1'

[s]That's why wlan1 is missing at:[/s]

butako wrote:

brctl show:
bridge name     bridge id               STP enabled     interfaces
br-lan          8000.e005c568a39a       no              eth0
                                                        wlan0

[s]BTW, in the first example of the documentation, it represents a "repeater mode" scenario. What you want to achieve is a "bridged repeater mode" scenario which is similar to "Access Point #2 (Stand-alone repeater)" in the documention. Please read the definitions in Linking Routers - DD-WRT Wiki.[/s]

(Last edited by fyi on 20 Dec 2011, 10:16)

The bridged client issue is described in "Client Mode Wireless - OpenWrt Wiki - Bridged Client Mode Issues".

butako wrote:

I hope I am explaining this well. Here is my config:

Kamikaze r23970

Install "relayd" which is supported after Backfire 10.03.1-rc5.

/etc/config/wireless

config 'wifi-device' 'radio0'
    option 'type' 'mac80211'
    option 'macaddr' '00:11:22:33:44:55'
    option 'hwmode' '11ng'
    list 'ht_capab' 'SHORT-GI-40'
    list 'ht_capab' 'TX-STBC'
    list 'ht_capab' 'RX-STBC1'
    list 'ht_capab' 'DSSS_CCK-40'
    option 'htmode' 'HT40+'
    option 'channel' '1'

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

config 'wifi-iface'
    option 'device' 'radio0'
    option 'network' 'lan'
    option 'mode' 'ap'
    option 'ssid' 'MY_REPEATED_SSID'
    option 'encryption' 'psk-mixed/aes'
    option 'key' 'supersecret'

/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.3.1
    option netmask  255.255.255.0

# Connect to wan if you accidentally brick it
config interface wan
    option ifname   eth1
    option proto    static
    option ipaddr   192.168.0.1
    option netmask  255.255.255.0

config 'interface' 'wwan'
    option 'proto' 'dhcp'

config 'interface' 'stabridge'
    option 'proto' 'relay'
    option 'network' 'lan wwan'
#    option ipaddr   192.168.1.254

config switch eth0
    option enable_vlan    1
    option enable    1
    option reset    1

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

/etc/config/dhcp

config 'dhcp' 'lan'
    option 'interface' 'lan'
    option 'start' '100'
    option 'limit' '50'
    option 'leasetime' '12h'
    option 'ignore' '1'

# Turn wan into backup lan
config 'dhcp' 'wan'
    option 'interface' 'wan'
    option 'start' '100'
    option 'limit' '50'
    option 'leasetime' '12h'

/etc/config/firewall

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

# Turn wan into backup lan
config 'zone'
    option 'name' 'wan'
    option 'input' 'ACCEPT'
    option 'output' 'ACCEPT'
    option 'forward' 'REJECT'
#    option 'masq' '1'
#    option 'mtu_fix' '1'
/etc/init.d/dnsmasq restart
/etc/init.d/firewall restart
/etc/init.d/network restart
wifi down ; wifi

In theory it should work as a bridged repeater. In reality it might not because there are certain dhcp issues in the recent beta releases like rc5 and rc6.

Routed Client with relayd (Pseudobridge) - OpenWrt Wiki

The discussion might have continued from here.