Deliberatus
Posts: 14
Joined: Thu Jan 31, 2013 10:10 pm

wireless WLAN bridge

Wed Jun 05, 2013 1:57 pm

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

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: wireless WLAN bridge

Thu Jun 13, 2013 4:33 pm

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.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

YodaDaCoda
Posts: 4
Joined: Fri Jun 21, 2013 4:45 am

Re: wireless WLAN bridge

Fri Jun 21, 2013 4:57 am

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.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: wireless WLAN bridge

Fri Jun 21, 2013 5:45 am

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.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

MattF
Posts: 55
Joined: Tue Feb 12, 2013 10:01 am

Re: wireless WLAN bridge

Fri Jun 21, 2013 8:09 am

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

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: wireless WLAN bridge

Fri Jun 21, 2013 11:43 am

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
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

YodaDaCoda
Posts: 4
Joined: Fri Jun 21, 2013 4:45 am

Re: wireless WLAN bridge

Fri Jun 21, 2013 11:53 am

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.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: wireless WLAN bridge

Fri Jun 21, 2013 12:01 pm

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.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

Return to “Advanced users”