ifconfig
eth0 Link encap:Ethernet HWaddr 54:04:a6:3d:36:ff
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:3300 errors:0 dropped:0 overruns:0 frame:0
TX packets:3300 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:950771 (950.7 KB) TX bytes:950771 (950.7 KB)
wlan0 Link encap:Ethernet HWaddr 30:5a:3a:60:5d:c0
inet addr:192.168.0.105 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::7cf4:8ce5:ba7c:8fd3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1553 errors:0 dropped:0 overruns:0 frame:0
TX packets:1223 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1007907 (1.0 MB) TX bytes:524507 (524.5 KB)
Question
I've set up networking interface bridge0
for my QEMU Windows guest, enabled it with command line
brctl addbr bridge0
qemu .. -netdev bridge,br=bridge0,id=net0 -device virtio-net-pci,netdev=net0
(and allowed bridge0 in /etc/qemu/bridge.conf
).
With this setting, QEMU guest can't access Internet. For example, on the host, pinging via that bridge doesn't work:
ping -I bridge0 8.8.8.8
If i try to add my wifi card (with working connection) to bridge:
brctl addif bridge0 wlan0
I get the Operation not supported
error. I see many messages in the web It's not possible. But how do i workaround this?
I need to use bridge to apply custom
iptables
rules to my guests network connections.
What should i do to let my bridge use WiFi internet connection?
How can i involve iptables
to solve my problem? How to create Sub-NAT for my bridge to control guests?