Page 1 of 1

wireless WLAN bridge

Posted: Wed Jun 05, 2013 1:57 pm
by Deliberatus
I read and enjoyed the article on creating a hot spot- and did so with a pi, it works fine; th8is could be a very useful tool. Now, what about a wireless network range extending bridge using 2 wifi dongles and appropriate configurati9on? Let's kick this around some!
:D

Re: wireless WLAN bridge

Posted: Thu Jun 13, 2013 4:33 pm
by SirLagz
Depending on the WiFi sticks, this could be difficult.
I'm trying to do it now by bridging and finding it hard to do.
itd be easier making it into a WiFi router.

Re: wireless WLAN bridge

Posted: Fri Jun 21, 2013 4:57 am
by YodaDaCoda
I've actually almost completely managed to do this. The only problem I'm having is routing DHCP and DNS requests to the router using iptables. Maybe there's something I'm missing, but if someone know things about iptables (I'm hardly a linux noob, but iptables confuses the hell out of me) I'd appreciate some help. Naturally, I'd do a proper write-up afterwards.

Re: wireless WLAN bridge

Posted: Fri Jun 21, 2013 5:45 am
by SirLagz
YodaDaCoda wrote:I've actually almost completely managed to do this. The only problem I'm having is routing DHCP and DNS requests to the router using iptables. Maybe there's something I'm missing, but if someone know things about iptables (I'm hardly a linux noob, but iptables confuses the hell out of me) I'd appreciate some help. Naturally, I'd do a proper write-up afterwards.
Are you using bridging or routing ?
if you're bridging, iptables *shouldnt* come into it.
If you're routing, then it's not really bridging, and you just setup iptables like a router.

Re: wireless WLAN bridge

Posted: Fri Jun 21, 2013 8:09 am
by MattF
Hi,

I looked into how to do this, and there are some challenges in bridging over Wireless because of the differences at layer 2.
If you can get full 4 addr support setup, then you are in with half a chance, but even then there are likely to be problems.

Happily there is a solution that "just works".

Build a normal Master/Managed Wi-Fi relationship between the two nodes.
Bridge the Wi-Fi adapters to the wired ethernet.

Then build an openvpn across the Wi-Fi segment in bridged mode.

This results in a full transparent layer 2 bridge in place, with no worries about mac addresses, NAT or any other such complication.

http://christian.hofstaedtler.name/blog ... envpn.html was very useful in getting OpenVPN correct - just remember it's a Wi-Fi segment rather than the Internet in between your pair of devices.

Rgds,

Matt

Re: wireless WLAN bridge

Posted: Fri Jun 21, 2013 11:43 am
by SirLagz
MattF wrote:Hi,

I looked into how to do this, and there are some challenges in bridging over Wireless because of the differences at layer 2.
If you can get full 4 addr support setup, then you are in with half a chance, but even then there are likely to be problems.

Happily there is a solution that "just works".

Build a normal Master/Managed Wi-Fi relationship between the two nodes.
Bridge the Wi-Fi adapters to the wired ethernet.

Then build an openvpn across the Wi-Fi segment in bridged mode.

This results in a full transparent layer 2 bridge in place, with no worries about mac addresses, NAT or any other such complication.

http://christian.hofstaedtler.name/blog ... envpn.html was very useful in getting OpenVPN correct - just remember it's a Wi-Fi segment rather than the Internet in between your pair of devices.

Rgds,

Matt
That link looks very interesting, Thanks for that Matt

I've been trying to implement layer 2 bridging over wifi for a long time now with the Pi

Re: wireless WLAN bridge

Posted: Fri Jun 21, 2013 11:53 am
by YodaDaCoda
SirLagz wrote:Are you using bridging or routing ?
if you're bridging, iptables *shouldnt* come into it.
If you're routing, then it's not really bridging, and you just setup iptables like a router.
I'm not bridging the connections; I'm routing using iptables. I still have to figure out why iptables isn't routing the dhcp requests, and I suspect it may be something to do with the way I did the nat translation chain stuff (copied a few lines from stackexchange) - I think it's dropping udp packets. But that's a job for Monday.

Re: wireless WLAN bridge

Posted: Fri Jun 21, 2013 12:01 pm
by SirLagz
YodaDaCoda wrote:
SirLagz wrote:Are you using bridging or routing ?
if you're bridging, iptables *shouldnt* come into it.
If you're routing, then it's not really bridging, and you just setup iptables like a router.
I'm not bridging the connections; I'm routing using iptables. I still have to figure out why iptables isn't routing the dhcp requests, and I suspect it may be something to do with the way I did the nat translation chain stuff (copied a few lines from stackexchange) - I think it's dropping udp packets. But that's a job for Monday.
Ahh. If you're routing, then you'll need to install a dhcp server on your Pi, and that will hand out IP addresses.
NAT won't work on the layer 2 level.
When a computer transmits a DHCP broadcast packet, it won't go over the WiFi as when it goes out over the WiFi, the source MAC address would change and the router would assign an IP address to the wrong MAC address.

I normally use dnsmasq as my DHCP server.