From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47892 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrFWn-0001dt-Ef for qemu-devel@nongnu.org; Sun, 20 Feb 2011 15:05:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrFWS-0003GP-3A for qemu-devel@nongnu.org; Sun, 20 Feb 2011 15:04:49 -0500 Received: from chello084112167138.7.11.vie.surfer.at ([84.112.167.138]:41485 helo=wiesinger.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrFWQ-0003Fm-TZ for qemu-devel@nongnu.org; Sun, 20 Feb 2011 15:04:48 -0500 Date: Sun, 20 Feb 2011 21:03:49 +0100 (CET) From: Gerhard Wiesinger Subject: Re: [Qemu-devel] Re: Network bridging without adding bridge with brctl, possible? In-Reply-To: <4D6151CF.3070104@web.de> Message-ID: References: <4D60E26D.3060202@web.de> <4D6121F1.1080900@web.de> <4D6151CF.3070104@web.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org, Arnd Bergmann On Sun, 20 Feb 2011, Jan Kiszka wrote: > On 2011-02-20 16:19, Gerhard Wiesinger wrote: >> On Sun, 20 Feb 2011, Jan Kiszka wrote: >> >>> On 2011-02-20 13:49, Gerhard Wiesinger wrote: >>>> On Sun, 20 Feb 2011, Jan Kiszka wrote: >>>> >>>>> On 2011-02-19 20:32, Gerhard Wiesinger wrote: >>>>>> Hello, >>>>> http://virt.kernelnewbies.org/MacVTap >>>>> >>>>> ip link add link eth1 name macvtap0 type macvtap mode bridge >>>>> ip link add link eth1 name macvlan0 type macvlan mode bridge >>>>> ifconfig macvlan0 ... >>>> >>>> >>>> Hello Jan, >>>> >>>> iproute2 2.6.37 is needed! >>>> http://devresources.linuxfoundation.org/dev/iproute2/download/iproute2-2.6.37.tar.bz2 >>>> >>>> >>>> ================================================================================== >>>> >>>> >>>> 1.) Only macvtap interface used >>>> ================================================================================== >>>> >>>> >>>> For me it was just unlogically to use a VLAN type interface. Therefore I >>>> tried the following which worked nearly: >>>> /root/download/iproute2/iproute2-2.6.37/ip/ip link add link eth0 name >>>> macvtap0 type macvtap mode bridge >>>> /root/download/iproute2/iproute2-2.6.37/ip/ip link set macvtap0 address >>>> 1a:46:0b:ca:bc:7b up >>>> ip link show macvtap0 >>>> ls -l /dev/tap* >>>> # crw-rw---- 1 root root 249, 8 Feb 20 13:07 /dev/tap8 >>>> qemu-system-x86_64 ... some params ... -net >>>> nic,model=e1000,macaddr=1a:46:0b:ca:bc:7b -net tap,fd=3 3<>/dev/tap8 >>>> >>>> Booting Knoppix 6.2 with ping is ok, MAC address is also correct on >>>> second host. >>>> >>>> Only problem is that from host to guest no networking is possible (only >>>> from guest to other host). >>>> >>>> Any ideas? I guess some forwarding is missing? iptables forward missing? >>> >>> To my understanding macvlan(+macvtap) devices in bridge mode can only >>> talk to the outer world via the physical device they are attached to or >>> other macvlan nodes attached to that same device. Therefore... >>> >>>> ================================================================================== >>>> >>>> >>>> 2.) Only macvtap interface used >>>> ================================================================================== >>>> >>>> >>>> /root/download/iproute2/iproute2-2.6.37/ip/ip link add link eth0 name >>>> macvtap0 type macvtap mode bridge >>>> /root/download/iproute2/iproute2-2.6.37/ip/ip link set macvtap0 address >>>> 1a:46:0b:ca:bc:7b up >>>> #/root/download/iproute2/iproute2-2.6.37/ip/ip link add link eth0 name >>>> macvlan0 type macvlan mode bridge >>>> #/root/download/iproute2/iproute2-2.6.37/ip/ip link set macvlan0 address >>> >>> ...the need for this additional macvlan device. You just have to set an >>> IP on macvlan0. >> >> Negative. >> >> Tried: >> /root/download/iproute2/iproute2-2.6.37/ip/ip link add link eth0 name >> macvtap0 type macvtap mode bridge >> /root/download/iproute2/iproute2-2.6.37/ip/ip link set macvtap0 address >> 1a:46:0b:ca:bc:7b up >> /root/download/iproute2/iproute2-2.6.37/ip/ip link add link eth0 name >> macvlan0 type macvlan mode bridge >> /root/download/iproute2/iproute2-2.6.37/ip/ip link set macvlan0 address >> 1a:46:0b:ca:bc:7c up >> ip link show macvtap0 >> ip link show macvlan0 >> ls -l /dev/tap* >> # crw-rw---- 1 root root 249, 10 Feb 20 15:45 /dev/tap10 >> ifconfig macvlan0 192.168.0.23 up >> >> DHCP is configure for 1a:46:0b:ca:bc:7b mac for 192.168.0.23 ip and >> 1a:46:0b:ca:bc:7c mac for 192.168.0.24 ip. >> >> # works without outer connection >> qemu-system-x86_64 ... some params ... -net >> nic,model=e1000,macaddr=1a:46:0b:ca:bc:7b -net tap,fd=3 3<>/dev/tap10 >> >> # 2nd try: >> ifconfig macvlan0 192.168.0.24 up >> # No network at all >> qemu-system-x86_64 ... some params ... -net >> nic,model=e1000,macaddr=1a:46:0b:ca:bc:7c -net tap,fd=3 3<>/dev/tap10 >> >> Seems to me quite logically because macvtap0 (and not macvlan0) is >> associated with /dev/tap10 but with another mac address set in KVM. >> >> Any furher ideas? > > As you already noticed: you mixed up the MAC addresses. KVM's must be > the same as used for its frontend macvtap. The macvlan is only for the > host and has a separate one. I think I did everyting right in the last 1st try but it still didn't work: 1.) macvtap0: MAC: 1a:46:0b:ca:bc:7b 2.) macvlan0: MAC: 1a:46:0b:ca:bc:7c, 192.168.0.23 3.) KVM: MAC: 1a:46:0b:ca:bc:7b, assigned IP from DHCP: 1a:46:0b:ca:bc:7b (looks like an IP address conflict inside guest and outside?) That should be as you explained, right? BTW: Posted a bugfix to hw/pcnet.c with AMD drivers. Thnx. Ciao, Gerhard -- http://www.wiesinger.com/