LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Bridging two wifi interfaces (https://www.linuxquestions.org/questions/linux-networking-3/bridging-two-wifi-interfaces-4175731684/)

slackerz 12-10-2023 11:08 AM

Bridging two wifi interfaces
 
I want to find out if it can be done.

Following this guide:

https://jamielinux.com/docs/libvirt-...d-network.html

It shows how to create a virtual bridge. The wifi iface cannot be added to the bridge. So the wifi traffic will need to be routed to the bridge instead. It's well established that the problem can be solved using NAT and without using a bridge. I'm looking not to use NAT (don't ask).

Is routing alone enough? What would be routing config using a bridge for two wireless interfaces wlan0, wlan1 and bridge vbr0 say?

jayjwa 12-11-2023 10:37 AM

Why can't you add the wifi interface to the bridge?
Code:

ip link set dev wlan0 master br0

slackerz 12-11-2023 11:25 AM

Quote:

Originally Posted by jayjwa (Post 6469788)
Why can't you add the wifi interface to the bridge?
Code:

ip link set dev wlan0 master br0

Can't do that. Besides there results the error:

Code:

Error: Device does not allow enslaving to a bridge.

slac-in-the-box 12-11-2023 11:42 AM

ebtables

slac-in-the-box 12-11-2023 12:07 PM

you can have an ethernet bridge with 2 available ethernet interfaces--plug the router/ap for first wifi network via ethernet cable into one of the interfaces; Use another ethernet cable to connect the second wifi network's router/ap to the other ethernet interface on the brige. Use brctl to add both ethernet interfaces to the bridge. now you've bridged the two wireless networks... you could have add a third ethernet interface to the bridge and use ethernet cable to connect that 3rd interface to a dsl modem or some other source of internet, assuming you wish to share internet with both wifi networks... now you have them bridged, and you can use ebtables on the bridge to filter--or tc for traffic shaping, or tcpdump for packet sniffing, etc.

slackerz 12-11-2023 12:22 PM

Quote:

Originally Posted by slac-in-the-box (Post 6469808)
ebtables

If I am not mistaken this is much like NAT except it works at the MAC address layer. Problem can be solved fairly easily using NAT but looking for something a little more performant. Bridge approach would be almost perfect.


All times are GMT -5. The time now is 12:22 AM.