LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   kvm wireless bridge network (http://www.linuxquestions.org/questions/debian-26/kvm-wireless-bridge-network-691953/)

shogun1234 12-20-2008 07:08 PM

kvm wireless bridge network
 
I've successfully install kvm with private network (nat) up running. I want to switch the kvm network using bridge mode (or host-interface), but do not success.

env: nic iwl4965/ kernel 2.6.27.8/ debian etch upgrade to lenny/ kvm 0.9.1/ hardware hp 6910p

The doc I follow up is at http://kvm.qumranet.com/kvmwiki/Netw...c1547920d9a74a

The way how i set it up is to modify /etc/network/interfaces by adding following section to enable br0
Code:

allow-hotplug br0
iface br0 inet dhcp
bridge_ports wlan0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

it looks fine as it outputs
Code:

br0      Link encap:Ethernet  HWaddr 00:1f:3b:21:25:13
          inet addr:192.168.1.72  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:3bff:fe21:2513/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1259 errors:0 dropped:0 overruns:0 frame:0
          TX packets:753 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:449060 (438.5 KiB)  TX bytes:173260 (169.1 KiB)

and the qemu-ifup is
Code:

#!/bin/sh
set -x

switch=br0

if [ -n "$1" ];then
        /usr/bin/sudo /usr/sbin/tunctl -u `whoami` -t tap0
        /usr/bin/sudo /sbin/ip link set tap0 up
        sleep 0.5s
        /usr/bin/sudo /usr/sbin/brctl addif $switch tap0
        echo "Error: no interface specified"
        exit 1
fi

then start first image with
Code:

sudo kvm -hda k1.img -net nic,macaddr=DE:AD:BE:EF:90:26 -net tap,script=/home/path/to/qemu-ifup.0
this creates tap0 in the output of ifconfig.

However, the problem is the guest os, which starts with -hda k1.img, can not access to the internet.

Is there any step I miss? or it is because wireless does not support bridge (I've heard doc says that wireless does not support wireless bridge)?

Thank in advice,

wilfgascon 12-21-2008 08:05 PM

KVM over IP
 
The KVM over IP that I use is from http://www.raritan.info/ and it is not wireless. I run no problem with bridged or unbridged connection. I have never used a wireless KVM.

Of course, that is an entirely different story BUT I have been troubleshooting for wireless connections and wireless does not work on bridged mode.

shogun1234 12-22-2008 05:43 PM

Quote:

Originally Posted by wilfgascon (Post 3383399)
The KVM over IP that I use is from http://www.raritan.info/ and it is not wireless. I run no problem with bridged or unbridged connection. I have never used a wireless KVM.

Of course, that is an entirely different story BUT I have been troubleshooting for wireless connections and wireless does not work on bridged mode.

Hi

Thanks for reply. Is there any doc referring to this information (wireless does not support bridge mode.) I've read some doc on the internet saying that wireless does not support bridge mode; but can not find any explain on e.g. http://wireless.kernel.org/en/users/Drivers/iwl4965. This makes me confused as I can not make sure the cause of the problem is due to my misconfiguration or the essense of the driver.

Thanks again for your help.

mkhan01 01-07-2009 03:48 PM

hi, it is my understanding that most wireless nics do not support bridge mode... other than some old 11mbps cards using a specific chipset...

judging from your post, I am assuming you want a kvm guest to be able to get on the network while running on a host that is networked using a wireless nic.

if this is the case, you have two options: 1. run NAT/DHCP on the host and have it route the traffic out for the guest. 2. try to bridge via using the software layer 3 daemon (parprouted), you can google parprouted + wireless or checkout a guide like this: http://www.scottro.net/vboxbridge.html, or this: http://wiki.voyage.hk/dokuwiki/doku....n_managed_mode

I had this setup and working previously w/ kvm on ubuntu but I don't have it up and running at the moment so I don't have kvm specific scripts available to post here.

Regarding your query about documentation for wireless bridging limitations try this: http://www.linuxfoundation.org/en/Ne...reless_card.21

pierro78 01-11-2009 08:10 AM

thanks so much for the tip mkhan01 !

I followed the parprouted VirtualBox tutorial on http://www.hazard.maks.net/blog/inde...70120&blogId=1

And then started my kvm virtual machine like this :
/usr/local/kvm/bin/qemu-system-x86_64 -hda /dev/sdb -m 512 -net nic,macaddr=DE:AD:BE:EF:90:26 -net tap,ifname=tap0,script=no

And configured the network interface in the guest vm with new static IP, subnet, mask, gateway and dns servers.

And it's working nicely :)

PS :
here is also an interesting comment with a script about parprouted on wireless ubuntu :
http://www.linuxweblog.com/virtualbo...ng#comment-328

attb2 08-13-2012 04:01 PM

Ubuntu 11.10 and 12.04
 
I try to summarize my experiences.
Following config works for me perfectly! Host and Guest on same subnet on a wireless NIC.

Host: Ubuntu 11.10
Guest: Ubuntu 12.04

Host:
wireless IP address: 192.168.111.20 wlan0 (network 192.168.111.0/24)

/etc/rc.local:
Code:

/usr/sbin/tunctl -t tap0
/sbin/ip link set tap0 up
/sbin/ip addr add 192.168.111.30/24 dev tap0
/usr/sbin/parprouted wlan0 tap0

After running rc.local you see following on Host:
$>ip ad list
Code:

3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 38:59:f9:b2:9b:92 brd ff:ff:ff:ff:ff:ff
    inet 192.168.111.20/24 brd 192.168.111.255 scope global wlan0
    inet6 fe80::3a59:f9ff:feb2:9b92/64 scope link
      valid_lft forever preferred_lft forever
4: tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 500
    link/ether 16:73:b5:e4:24:a5 brd ff:ff:ff:ff:ff:ff
    inet 192.168.111.30/24 scope global tap0
    inet6 fe80::1473:b5ff:fee4:24a5/64 scope link
      valid_lft forever preferred_lft forever

$>ip route list
Code:

default via 192.168.111.1 dev wlan0  proto static
169.254.0.0/16 dev wlan0  scope link  metric 1000
192.168.111.0/24 dev tap0  proto kernel  scope link  src 192.168.111.30
192.168.111.0/24 dev wlan0  proto kernel  scope link  src 192.168.111.20  metric 2
192.168.111.1 dev wlan0  scope link  metric 50
192.168.111.31 dev tap0  scope link  metric 50

Guest:
/etc/network/interfaces:
Code:

auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
 address 192.168.111.31
 netmask 255.255.255.0
 network 192.168.111.0
 gateway 192.168.111.30

Starting kvm:
$>kvm -m 256 -k hu -net nic,macaddr=DE:AD:BE:EF:90:26 -net tap,ifname=tap0,script=no /iso/VM/ubuntu_12.04.img


All times are GMT -5. The time now is 05:25 AM.