Bridging Two Wireless Interfaces For "Repeater" mode

2

1

I've looked around quite a bit and can't really find anything putting all the pieces together.

I'm using Debian and looking to connect to a wireless network and repeat the signal without using nat or any other unpleasantness.

ap -> wlan0 {debian} wlan1 -> repeated_ap_signal

I have two identical wireless nics, ath9k driver modules, and a router that supports 4 address mode.

From what I gather I need to have wlan0 connect to the ap as a client, and I need to turn on 4addr mode on wlan1, and bridge the two of them. Actual implementation is a little more confusing.

Do I still need to setup hostapd for wlan1 and set it to have an identical ssid/pw with the channel being 3 or more away from the one the ap is hosting?

Are there any special things that need to be set on the bridge for this to work?

Does 4addr mode need to be turned on for both wlan interfaces or only the "repeater" one?

Thanks!

Peck

Posted 2015-06-03T22:30:25.550

Reputation: 161

Answers

2

Yours is an unusual request, because you are trying to use some seldom (if ever) used technology (4addr mode) in order to avoid a truly trivial setup with NAT.

There is also another annoying feature.Your configuration requires that ap and wlan0 have both 4addr mode enabled, you cannot enable it on just one because then the other component will not be able to talk to the 4addr-mode component. What this means is that normal pcs (Windows, Macs, non-4-addr-mode-configured *Nixes) will not be able to link to the ap. Unless of course you setup VLANs on the AP, one for your debian machine with 4addr mode enabled, another one for all other pcs without 4addr mode. Still more overhead to reckon with, if you ask me.

As for wlan1 (the repeater-side interface) you do not need 4addr mode enabled on it. Just setup hostapd on it, bridge it with your eth0 (if you plan to use your ethernet cable to extend the repeater capability of the debian machine to a full-fledged wireless bridge), or with a virtual interface (tap, not tun otherwise you will be forfeiting level 2 connections).

As for the relation between wlan0 and wlan1, you cannot bridge them: bridging requires the exchange of whole ethernet frames, something which no wireless (4addr mode or not) can do. Besides, you do not need bridging: all you need is enabling IPv4-forwarding (through /etc/sysctl.conf) and proper routing (you must make sure that the same subnet is available on both wifis).

In order to decrease traffic, you may want to specify that your default gateway is at 192.168.1.1 (or whatever you use) on device wlan0: this will prevent your debian machine from sending traffic to it via wlan1, thus clogging your repeater to no avail.

MariusMatutiae

Posted 2015-06-03T22:30:25.550

Reputation: 41 321

Would DCHP leasing, where the ap handles it, work across something like this? – Peck – 2015-06-04T14:10:28.887

@Peck: I cannot see why not. After all, the initial DHCP request is just a message to the broadcast address, and the reply is a unicast without ARP. Even if it didn't, you could setup a local dhcp server dishing out IP addresses from a range not overlapping that of the main router, and a proxy_arp configuration which allows you to maintain ARP connections across wireless, the only (possible) stumbling block. – MariusMatutiae – 2015-06-04T14:27:17.673

Thanks. The part about enabling ipv4 forwarding is a little odd to me, since I want this all to be working at L2 how would that be effected? – Peck – 2015-06-04T16:27:03.070

@ Peck I understand, but you still need to enable IPv4 forwarding. Have you ever setup a bridged OpenVPN? It works at the L2 level, but you still have to allow IPv4 forwarding in sysctl.conf. – MariusMatutiae – 2015-06-04T16:59:31.483