From owner-freebsd-virtualization@FreeBSD.ORG Thu Apr 2 17:53:21 2009 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B30C1106567A for ; Thu, 2 Apr 2009 17:53:21 +0000 (UTC) (envelope-from zec@icir.org) Received: from labs4.cc.fer.hr (labs4.cc.fer.hr [161.53.72.24]) by mx1.freebsd.org (Postfix) with ESMTP id 2CD288FC14 for ; Thu, 2 Apr 2009 17:53:20 +0000 (UTC) (envelope-from zec@icir.org) Received: from sluga.fer.hr (sluga.cc.fer.hr [161.53.72.14]) by labs4.cc.fer.hr (8.14.2/8.14.2) with ESMTP id n32Ha8Ds006567 for ; Thu, 2 Apr 2009 19:36:14 +0200 (CEST) Received: from [192.168.200.110] ([161.53.19.79]) by sluga.fer.hr with Microsoft SMTPSVC(6.0.3790.3959); Thu, 2 Apr 2009 19:35:43 +0200 From: Marko Zec To: freebsd-virtualization@freebsd.org, subbsd@gmail.com Date: Thu, 2 Apr 2009 19:35:25 +0200 User-Agent: KMail/1.9.10 References: <200904022043.57984.subbsd@gmail.com> In-Reply-To: <200904022043.57984.subbsd@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904021935.25688.zec@icir.org> X-OriginalArrivalTime: 02 Apr 2009 17:35:43.0679 (UTC) FILETIME=[7304DCF0:01C9B3B9] X-Scanned-By: MIMEDefang 2.64 on 161.53.72.24 Cc: Subject: Re: how to move physical interface into multiple vimage interfaces X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 17:53:22 -0000 On Thursday 02 April 2009 18:43:57 subbsd wrote: > Hello maillist > > i fetch and apply latest > http://imunes.tel.fer.hr/virtnet/vimage-20081015.tgz patches for 7.2 > i386 for testing vimage. Hi, if you're running 7.2-PRERELASE or similar you'll probably have more luck trying out the latest sys tarball tracking 7-stable: http://imunes.tel.fer.hr/virtnet/vimage_7_20090401.tgz > All according man page work done. > Small bug: vimage -i with 1 arguments make core dumped: > > # vimage -i onearg > Segmentation fault (core dumped) You're right, this needs to be fixed... > and bridge cannot worked: > kldload if_bridge.ko > link_elf: symbol ifnet undefined > KLD if_bridge.ko: depends on bridgestp - not available if_bridge is not virtualized yet, so as an alternative, I'd suggest you try out netgraph bridging which works quite well vith virtual stacks. There's a tutorial describing how to use netgraph with vimages - pls. take a look at this: http://imunes.tel.fer.hr/virtnet/eurobsdcon07_tutorial.pdf > And i've want asking: > may i using 1 physical or vlan interface as parent for multiple > vimage interfaces? something like > vimage -c sw1 > vimage -c sw2 > vimage -c sw3 > > vimage -i sw1,sw2,sw3 em0 No it won't work that way - a single interface (physical, vlan, whatever) can be assigned to only one vimage at a time. So to make multiple vimages visible via a single physical card you should create virtual interfaces for vimages and bridge them to the physical one. Here's an example: tpx32# vimage -c sw1 tpx32# vimage -c sw2 tpx32# vimage -c sw3 tpx32# ngctl mkpeer eiface ether ether tpx32# ngctl mkpeer eiface ether ether tpx32# ngctl mkpeer eiface ether ether tpx32# kldload ng_ether tpx32# ngctl mkpeer em0: bridge lower link0 tpx32# ngctl name em0:lower b0 tpx32# ngctl connect em0: b0: upper link9 tpx32# ngctl connect ngeth0: b0: ether link1 tpx32# ngctl connect ngeth1: b0: ether link2 tpx32# ngctl connect ngeth2: b0: ether link3 tpx32# vimage -i sw1 ngeth0 eth0@sw1 tpx32# vimage -i sw2 ngeth1 eth0@sw2 tpx32# vimage -i sw3 ngeth2 eth0@sw3 tpx32# tpx32# ifconfig em0: flags=8843 metric 0 mtu 1500 options=9b ether 00:16:41:15:4d:3e inet6 fe80::216:41ff:fe15:4d3e%em0 prefixlen 64 scopeid 0x3 inet6 a:2::51 prefixlen 64 inet 192.168.200.110 netmask 0xffffff00 broadcast 192.168.200.255 media: Ethernet autoselect (100baseTX ) status: active lo0: flags=8049 metric 0 mtu 16384 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 inet 127.0.0.1 netmask 0xff000000 tpx32# ping 192.168.200.1 PING 192.168.200.1 (192.168.200.1): 56 data bytes 64 bytes from 192.168.200.1: icmp_seq=0 ttl=255 time=4.668 ms 64 bytes from 192.168.200.1: icmp_seq=1 ttl=255 time=2.625 ms ^C --- 192.168.200.1 ping statistics --- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 2.625/3.647/4.668/1.022 ms tpx32# ifconfig em0 promisc tpx32# vimage sw1 Switched to vimage sw1 # ifconfig lo0: flags=8008 metric 0 mtu 16384 eth0: flags=8802 metric 0 mtu 1500 ether 00:00:00:00:00:00 # ifconfig lo0 localhost # ifconfig eth0 link 42:1:2:3:4:1 # dhclient eth0 DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPNAK from 192.168.200.31 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8 DHCPOFFER from 192.168.200.31 DHCPOFFER from 192.168.200.32 DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPACK from 192.168.200.31 bound to 192.168.200.112 -- renewal in 1800 seconds. # ifconfig lo0: flags=8049 metric 0 mtu 16384 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 eth0: flags=8843 metric 0 mtu 1500 ether 42:01:02:03:04:01 inet6 fe80::d41d:8cd9:8f00:b204%eth0 prefixlen 64 scopeid 0x2 inet 192.168.200.112 netmask 0xffffff00 broadcast 192.168.200.255 # ping 192.168.200.1 PING 192.168.200.1 (192.168.200.1): 56 data bytes 64 bytes from 192.168.200.1: icmp_seq=0 ttl=255 time=4.833 ms 64 bytes from 192.168.200.1: icmp_seq=1 ttl=255 time=2.619 ms 64 bytes from 192.168.200.1: icmp_seq=2 ttl=255 time=2.544 ms ^C --- 192.168.200.1 ping statistics --- 3 packets transmitted, 3 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 2.544/3.332/4.833/1.062 ms #