A solution to bridge wlan0 or permit to use the same lan for tap/br?
0
votes
1
answer
602
views
I have a tftp server on lan 192.168.0.0/24
I want a qemu vm reach it, with ethernet is simple
a) First create br0
MAC1="52:54:$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')";
nmcli con add ifname br0 type bridge con-name br0 bridge.mac-address $MAC1
b) then add eth0 as slave, then you can add vnet* or tap* interfaces with qemu or libvirt
With wlan is impossible
brctl addif br0 wlan1
can't add wlan1 to bridge br0: Operation not supported
nmcli fail also with timeout
So I have two solutions, create a "virbr" with libvirt and the use iptables rules
for natting it, but the virbr must have a different lan address (192.168.1.0/24 or 10.2.1.0/24 or whatever you want but not an address of ip range used by wlan because exit with errors) or create an empty br0 with network-manager and then assign a ip address to it and with iptables route to wlan0
iptables -A FORWARD -i br0 -o wlan1 -j ACCEPT
iptables -A FORWARD -i wlan1 -o br0 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -o wlan1 -j MASQUERADE
but when I try to get a dhcp address from 192.168.0.0/24 lan it fail.
Any advice to use 192.168.0.0/24 ip for wlan "bridge"? Thanks
Edit: the iw command to "enable" the wlan0 as slave fail
iw dev wlan1 set 4addr on
command failed: Operation not supported (-95)
Another thing: today I have installed VirtualBox on Debian 12
and using wifi bridge work, I can ping the vm using the same ip class of wlan0 wifi (88x2bu driver), but ip addr and ip link sh don't report interface, where is the bridge?
Asked by elbarna
(13690 rep)
Oct 27, 2023, 02:51 PM
Last activity: Oct 6, 2024, 08:25 PM
Last activity: Oct 6, 2024, 08:25 PM