From owner-freebsd-virtualization@FreeBSD.ORG Sun Dec 12 02:45:02 2010 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 BB9861065670 for ; Sun, 12 Dec 2010 02:45:02 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from out-0.mx.aerioconnect.net (outl.internet-mail-service.net [216.240.47.235]) by mx1.freebsd.org (Postfix) with ESMTP id 9932F8FC0C for ; Sun, 12 Dec 2010 02:45:02 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id oBC2VOIk007815; Sat, 11 Dec 2010 18:31:24 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id E27642D6014; Sat, 11 Dec 2010 18:31:23 -0800 (PST) Message-ID: <4D0433F9.20803@freebsd.org> Date: Sat, 11 Dec 2010 18:31:21 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: William Phillips References: <31F97B5E-20FF-402D-B951-F6DB75B1BD88@mac.com> In-Reply-To: <31F97B5E-20FF-402D-B951-F6DB75B1BD88@mac.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: freebsd-virtualization@freebsd.org Subject: Re: ng_iface problems with VIMAGE 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: Sun, 12 Dec 2010 02:45:02 -0000 On 12/11/10 4:49 PM, William Phillips wrote: > Hello: > > The following script creates a point-to-point link between jails. I will admit that I don't remember ever actually connecting two ng_iface nodes directly to each other. Having said htat there the epair(4) driver which is specifically designed to do this. and you may have more luck with that. Also ng_iface nodes are more usually used with a ng_bridge or similar node. for an example look at the two example files in -current (9.x) in /share/examples/netgraph http://svn.freebsd.org/viewvc/base/head/share/examples/netgraph/virtual.chain?view=markup http://svn.freebsd.org/viewvc/base/head/share/examples/netgraph/virtual.lan?view=markup I should move these to 8 soon I guess. > #!/bin/sh > > # script to create two vnet jails and connect them via ng_iface interfaces > > # create two vnet jails > jail -c vnet name=node0 host.hostname=node0 path=/ persist > jexec node0 ifconfig lo0 localhost > > jail -c vnet name=node1 host.hostname=node1 path=/ persist > jexec node1 ifconfig lo0 localhost > > # create two ng_ifaces and connect them in netgraph > ngctl mkpeer . iface hook inet > ngctl mkpeer ng0: iface inet inet > > # move the corresponding interfaces into the jails > ifconfig ng0 vnet node0 > ifconfig ng1 vnet node1 > > # configure the interfaces in the jails > jexec node0 ifconfig ng0 192.168.10.1 192.168.10.2 > jexec node1 ifconfig ng1 192.168.10.2 192.168.10.1 > > # end of script > > When I try to ping node1 from node0 the echo request appears on ng1 according to tcpdump on node1 but node1 does not generate an echo reply. Here is the output generated on each jail. > > [root@gateway /home/phillips]# jexec node0 ping -c1 192.168.10.2 > PING 192.168.10.2 (192.168.10.2): 56 data bytes > > --- 192.168.10.2 ping statistics --- > 1 packets transmitted, 0 packets received, 100.0% packet loss > > > [root@gateway /home/phillips]# jexec node1 tcpdump -n -i ng1 > tcpdump: verbose output suppressed, use -v or -vv for full protocol decode > listening on ng1, link-type NULL (BSD loopback), capture size 96 bytes > 20:31:38.509494 IP 192.168.10.1> 192.168.10.2: ICMP echo request, id 55300, seq 0, length 64 > > > This is for FreeBSD8.1 with kernel config GENERIC with the following changes: > > #options SCTP # Stream Control Transmission Protocol > > options VIMAGE > options IPFIREWALL #firewall > options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default > options MROUTING # Multicast routing > > > Bill Phillips > > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@freebsd.org" >