Discussion:
KVM Bridge wlan0
(too old to reply)
t***@marion.systems
2016-03-06 17:40:03 UTC
Permalink
Hi All,

I have a laptop with a wireless interface.

I would like to use kvm.

I am to stupid to figure out how to setup a bridge using wlan0.

yes I am a idiot. Yes I need someone who can spell it out character by
character for me.

I can find many, many, many, many, many , how many do you need examples
of setting up a bridge with eth0.

I can only find 1 reference to using wlan0 for bridging.
https://wiki.debian.org/BridgeNetworkConnections This WEB Site and it
talks about using ebtable. Is ebtable the only way to have a bridge for
KVM with wlan0 ?

I refuse to believe I am the only human on earth trying to do KVM on a
laptop with wlan0. Somebody must have done this already. I cannot be
the
first person to want to bridge an wlan0 interface.

***@beeker:/etc/network# uname -a
Linux beeker 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4
(2016-02-29) x86_64 GNU/Linux

***@beeker:/etc/network# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no
***@beeker:/etc/network# brctl addif br0 wlan0
can't add wlan0 to bridge br0: Operation not supported


***@beeker:/etc/network# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback


# manual wifi configuration
# using wpa_pashphrase to generate wpa-psk string
auto wlan0
iface wlan0 inet manual
wpa_ssid KxxxF

wpa-psk 5303080c4418c4a7123456789031a23218fb70525ab238f71eafe99edfe05104

auto br0
iface br0 inet static
address 192.168.1.100
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 199.231.188.115
dns-nameservers 128.199.172.116
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0

***@beeker:/etc/network# sudo systemctl status networking
● networking.service - LSB: Raise network interfaces.
Loaded: loaded (/etc/init.d/networking)
Drop-In: /run/systemd/generator/networking.service.d
└─50-insserv.conf-$network.conf
/lib/systemd/system/networking.service.d
└─network-pre.conf
Active: inactive (dead) since Sun 2016-03-06 12:07:53 EST; 30s ago
Process: 2331 ExecStop=/etc/init.d/networking stop (code=exited,
status=0/SUCCESS)
Process: 1829 ExecStart=/etc/init.d/networking start (code=exited,
status=0/SUCCESS)

Mar 06 11:06:47 beeker networking[1829]: Configuring network
interfaces...RTNETLINK answers: File exists
Mar 06 11:06:47 beeker networking[1829]: Failed to bring up br0.
Mar 06 11:06:48 beeker networking[1829]: done.
Mar 06 11:57:31 beeker wpa_supplicant[535]: wlan0: WPA: Group rekeying
completed with 18:1b:eb:78:d9:2e [GTK=CCMP]
Mar 06 12:07:53 beeker networking[2331]: not deconfiguring network
interfaces: network file systems still mounted. ... (warning).
***@beeker:/etc/network# sudo systemctl start networking
***@beeker:/etc/network# sudo systemctl status networking
● networking.service - LSB: Raise network interfaces.
Loaded: loaded (/etc/init.d/networking)
Drop-In: /run/systemd/generator/networking.service.d
└─50-insserv.conf-$network.conf
/lib/systemd/system/networking.service.d
└─network-pre.conf
Active: active (running) since Sun 2016-03-06 12:08:43 EST; 15s ago
Process: 2331 ExecStop=/etc/init.d/networking stop (code=exited,
status=0/SUCCESS)
Process: 2344 ExecStart=/etc/init.d/networking start (code=exited,
status=0/SUCCESS)
CGroup: /system.slice/networking.service
├─535 /sbin/wpa_supplicant -s -B -P
/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -C
/run/wpa_supplicant
└─583 dhclient -v -pf /run/dhclient.wlan0.pid -lf
/var/lib/dhcp/dhclient.wlan0.leases wlan0

Mar 06 12:08:43 beeker networking[2344]: Configuring network
interfaces...can't add wlan0 to bridge br0: Operation not supported
Mar 06 12:08:43 beeker networking[2344]: RTNETLINK answers: File exists
Mar 06 12:08:43 beeker networking[2344]: Failed to bring up br0.
Mar 06 12:08:43 beeker networking[2344]: done.
***@beeker:/etc/network# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast
state DOWN group default qlen 1000
link/ether 2c:60:0c:2f:be:18 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
group default qlen 1000
link/ether ac:b5:7d:3d:18:df brd ff:ff:ff:ff:ff:ff
inet 192.168.1.2/24 brd 192.168.1.255 scope global wlan0
valid_lft forever preferred_lft forever
4: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue
state DOWN group default
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.100/24 brd 192.168.1.255 scope global br0
valid_lft forever preferred_lft forever


Thanks for any help or direction anybody can provide.

Tim
Reco
2016-03-06 18:00:02 UTC
Permalink
Hi.

On Sun, 06 Mar 2016 12:33:57 -0500
Post by t***@marion.systems
I can only find 1 reference to using wlan0 for bridging.
https://wiki.debian.org/BridgeNetworkConnections This WEB Site and it
talks about using ebtable. Is ebtable the only way to have a bridge for
KVM with wlan0 ?
No. ebtables come after the bridge is set up. Consider ebtables a form
of access control. It's not mandatory to use them by any means.
Post by t***@marion.systems
I refuse to believe I am the only human on earth trying to do KVM on a
laptop with wlan0. Somebody must have done this already. I cannot be
the first person to want to bridge an wlan0 interface.
Of course you're not the first. So...
Post by t***@marion.systems
wpa-psk <pre-shared-key was here>
First, I suggest you to change your WPA authentication right away, as
you've just shared your WPA key with all the world.

Second,
Post by t***@marion.systems
auto br0
iface br0 inet static
<some usual interface stanzas>
Post by t***@marion.systems
bridge_ports eth0
This part is wrong. You want to bridge some interfaces to wlan0 via
br0, yet you don't include wlan0 into the bridge.
The correct way of doing this should be:

bridge_ports eth0 wlan0

Assuming, of course, that you'll never want to have different IPs on
eth0 and wlan0.


Third,
Post by t***@marion.systems
Mar 06 12:08:43 beeker networking[2344]: Configuring network
interfaces...can't add wlan0 to bridge br0: Operation not supported
something strange goes here. You've told interfaces(5) not to add wlan0
to br0, yet there's someone who tries to do it. Is it the manual
invocation of "brctl addif"?

"can't add wlan0 to bridge br0: Operation not supported" should be
easily defeated with good old:

iw dev wlan0 set 4addr on

I.e. edit your /etc/network/interfaces like this:

auto wlan0
iface wlan0 inet manual
wpa_ssid XXX
wpa-psk YYY
pre-up /sbin/iw dev wlan0 set 4addr on

Reco
Timothy Marion
2016-03-06 19:10:02 UTC
Permalink
Different config similar result

did not email actual ssid, psk. I’m a idiot not a moron.

I do not know that I want to bridge eth0 to wlan0.

I have one working interface on my computer wlan0. I want a virtual machine using KVM to be able to communicate to the internet using wlan0. All documentation I can find indicates that is done with a bridge. All documentation I can find indicates you do this with eth0. I do not use eth0. I have wlan0.

changed /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback


# manual wifi configuration
# using wpa_pashphrase to generate wpa-psk string
auto wlan0
iface wlan0 inet manual
wpa_ssid XXXXX
wpa-psk xxxxx
pre-up /sbin/iw dev wlan0 set 4addr on

auto br0
iface br0 inet static
address 192.168.1.100
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 199.231.188.115
dns-nameservers 128.199.172.116
bridge_ports eth0 wlan0
bridge_stp off
bridge_fd 0
bridge_maxwait 0


good new! I now have br0 with eth0 and wlan0.

bad new! now the laptop no longer has any internet connectivity.


ifconfig

br0 Link encap:Ethernet HWaddr 2c:60:0c:2f:be:18
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

eth0 Link encap:Ethernet HWaddr 2c:60:0c:2f:be:18
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:93 errors:0 dropped:0 overruns:0 frame:0
TX packets:93 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9015 (8.8 KiB) TX bytes:9015 (8.8 KiB)

wlan0 Link encap:Ethernet HWaddr ac:b5:7d:3d:18:df
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4068 (3.9 KiB) TX bytes:0 (0.0 B)


ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN mode DEFAULT group default qlen 1000
link/ether 2c:60:0c:2f:be:18 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master br0 state DOWN mode DORMANT group default qlen 1000
link/ether ac:b5:7d:3d:18:df brd ff:ff:ff:ff:ff:ff
4: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
link/ether 2c:60:0c:2f:be:18 brd ff:ff:ff:ff:ff:ff


ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 1000
link/ether 2c:60:0c:2f:be:18 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master br0 state DOWN group default qlen 1000
link/ether ac:b5:7d:3d:18:df brd ff:ff:ff:ff:ff:ff
4: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 2c:60:0c:2f:be:18 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.100/24 brd 192.168.1.255 scope global br0
valid_lft forever preferred_lft forever
Post by Reco
Hi.
On Sun, 06 Mar 2016 12:33:57 -0500
Post by t***@marion.systems
I can only find 1 reference to using wlan0 for bridging.
https://wiki.debian.org/BridgeNetworkConnections This WEB Site and it
talks about using ebtable. Is ebtable the only way to have a bridge for
KVM with wlan0 ?
No. ebtables come after the bridge is set up. Consider ebtables a form
of access control. It's not mandatory to use them by any means.
Post by t***@marion.systems
I refuse to believe I am the only human on earth trying to do KVM on a
laptop with wlan0. Somebody must have done this already. I cannot be
the first person to want to bridge an wlan0 interface.
Of course you're not the first. So...
Post by t***@marion.systems
wpa-psk <pre-shared-key was here>
First, I suggest you to change your WPA authentication right away, as
you've just shared your WPA key with all the world.
Second,
Post by t***@marion.systems
auto br0
iface br0 inet static
<some usual interface stanzas>
Post by t***@marion.systems
bridge_ports eth0
This part is wrong. You want to bridge some interfaces to wlan0 via
br0, yet you don't include wlan0 into the bridge.
bridge_ports eth0 wlan0
Assuming, of course, that you'll never want to have different IPs on
eth0 and wlan0.
Third,
Post by t***@marion.systems
Mar 06 12:08:43 beeker networking[2344]: Configuring network
interfaces...can't add wlan0 to bridge br0: Operation not supported
something strange goes here. You've told interfaces(5) not to add wlan0
to br0, yet there's someone who tries to do it. Is it the manual
invocation of "brctl addif"?
"can't add wlan0 to bridge br0: Operation not supported" should be
iw dev wlan0 set 4addr on
auto wlan0
iface wlan0 inet manual
wpa_ssid XXX
wpa-psk YYY
pre-up /sbin/iw dev wlan0 set 4addr on
Reco
Reco
2016-03-06 19:50:02 UTC
Permalink
Hi.

Please refrain from top-posting.
Please do not CC me, I'm subscribed to the list.

On Sun, 6 Mar 2016 14:05:32 -0500
Post by Timothy Marion
I do not know that I want to bridge eth0 to wlan0.
You have it anyway in the current configuration.
Post by Timothy Marion
I have one working interface on my computer wlan0.
Er, your 'ifconfig' list says otherwise. At the very least you have a
wired interface called eth0. It's irrelevant to the current problem,
though.
Post by Timothy Marion
I want a virtual machine using KVM to be able to communicate to the
internet using wlan0.

There are multiple ways of doing it. Bridge, NAT, tunnels, you name it.
Post by Timothy Marion
All documentation I can find indicates that is done with a bridge.
Because it's the simpliest way to accomplish such connectivity. But
about the only *real* need to use a bridge arises if you need the
outside world to communicate with your VM. As in - you need someone to
establish inbound connections to your VM with the minimal hassle.
Post by Timothy Marion
All documentation I can find indicates you do this
with eth0. I do not use eth0. I have wlan0.

Got it.
Post by Timothy Marion
good new! I now have br0 with eth0 and wlan0.
Just as planned.
Post by Timothy Marion
bad new! now the laptop no longer has any internet connectivity.
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN mode DEFAULT group default qlen 1000
link/ether 2c:60:0c:2f:be:18 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master br0 state DOWN mode DORMANT group default qlen 1000
link/ether ac:b5:7d:3d:18:df brd ff:ff:ff:ff:ff:ff
4: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
link/ether 2c:60:0c:2f:be:18 brd ff:ff:ff:ff:ff:ff
So, disregarding eth0. Do you have wpa_supplicant running? Does wpa_cli
show successful association with your AP?

Reco
Timothy Marion
2016-03-06 20:10:01 UTC
Permalink
I have a laptop with an wireless adapter. I would like to run KVM with virtual machines. I would like to be able to access the internet from the virtual machine. Can anybody tell me how that is done using the wireless adapter?
Subject: Re: KVM Bridge wlan0
Date: March 6, 2016 at 2:42:42 PM EST
Hi.
Please refrain from top-posting.
Please do not CC me, I'm subscribed to the list.
On Sun, 6 Mar 2016 14:05:32 -0500
Post by Timothy Marion
I do not know that I want to bridge eth0 to wlan0.
You have it anyway in the current configuration.
Post by Timothy Marion
I have one working interface on my computer wlan0.
Er, your 'ifconfig' list says otherwise. At the very least you have a
wired interface called eth0. It's irrelevant to the current problem,
though.
Post by Timothy Marion
I want a virtual machine using KVM to be able to communicate to the
internet using wlan0.
There are multiple ways of doing it. Bridge, NAT, tunnels, you name it.
Post by Timothy Marion
All documentation I can find indicates that is done with a bridge.
Because it's the simpliest way to accomplish such connectivity. But
about the only *real* need to use a bridge arises if you need the
outside world to communicate with your VM. As in - you need someone to
establish inbound connections to your VM with the minimal hassle.
Post by Timothy Marion
All documentation I can find indicates you do this
with eth0. I do not use eth0. I have wlan0.
Got it.
Post by Timothy Marion
good new! I now have br0 with eth0 and wlan0.
Just as planned.
Post by Timothy Marion
bad new! now the laptop no longer has any internet connectivity.
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN mode DEFAULT group default qlen 1000
link/ether 2c:60:0c:2f:be:18 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master br0 state DOWN mode DORMANT group default qlen 1000
link/ether ac:b5:7d:3d:18:df brd ff:ff:ff:ff:ff:ff
4: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
link/ether 2c:60:0c:2f:be:18 brd ff:ff:ff:ff:ff:ff
So, disregarding eth0. Do you have wpa_supplicant running? Does wpa_cli
show successful association with your AP?
Reco
Dan Ritter
2016-03-08 18:10:02 UTC
Permalink
Post by Timothy Marion
I have a laptop with an wireless adapter. I would like to run KVM with virtual machines. I would like to be able to access the internet from the virtual machine. Can anybody tell me how that is done using the wireless adapter?
https://wiki.debian.org/BridgeNetworkConnections

There are special instructions for wireless bridges.

-dsr-
Pascal Hambourg
2016-03-08 19:40:02 UTC
Permalink
Post by t***@marion.systems
https://wiki.debian.org/BridgeNetworkConnections
There are special instructions for wireless bridges.
Interesting, but it won't be of much help if the kernel itself prohibits
bridging of a wireless interface.
Gustavo S. L.
2016-03-08 20:00:02 UTC
Permalink
already tried?

# apt-get install libvirt-bin
# virsh net-start default

Following if you use the virt-manager will easily specify the network
interface as a bridge
Post by Pascal Hambourg
Post by t***@marion.systems
https://wiki.debian.org/BridgeNetworkConnections
There are special instructions for wireless bridges.
Interesting, but it won't be of much help if the kernel itself prohibits
bridging of a wireless interface.
--
*Gustavo Soares de Lima*

diasporabr: gustavolima
facebook.com/gustavosdelima
linkedin.com/in/gustavo-soares-de-lima-29ab0663
Skype: logicuschat
github.com/gutolima
twitter.com/logicuslinux
youtube.com/ghtp25
Pascal Hambourg
2016-03-06 21:10:02 UTC
Permalink
Hello,
Post by t***@marion.systems
I am to stupid to figure out how to setup a bridge using wlan0.
No, you're not. You're just ignorant of an important fact : bridging of
a wireless interface in managed (asociated) or adhoc mode has been
disabled for some time now, because, by design, it just can't work.
Bridging requires to send and receive frames with a different MAC
address, but the wireless frame format prevents an interface in managed
mod from doing this. Only an interface in master (access point) mode can
do this.
Loading...