From owner-freebsd-net@freebsd.org Wed Nov 4 12:50:39 2015 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1E39A24269 for ; Wed, 4 Nov 2015 12:50:39 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD962142B for ; Wed, 4 Nov 2015 12:50:39 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-229-78.lns20.per1.internode.on.net [121.45.229.78]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id tA4CoXjj047388 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 4 Nov 2015 04:50:36 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: tap(4) and host-only networking between host and guest To: Victor Sudakov , freebsd-net@freebsd.org References: <20151104075454.GA99850@admin.sibptus.tomsk.ru> From: Julian Elischer Message-ID: <5639FF12.1020109@freebsd.org> Date: Wed, 4 Nov 2015 20:50:26 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151104075454.GA99850@admin.sibptus.tomsk.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2015 12:50:40 -0000 On 11/4/15 3:54 PM, Victor Sudakov wrote: > Colleagues, > > I am experimenting with bhyve which uses tap(4) for network access. > > I don't want to bridge tap0 with any of the hosts's real NICs. How can > I create a private network just between the host and the guest? you are thinking too hard! tap IS the interface.. ifconfig tap0 $address... and in the VM, ifconfig vtnet0 ${some_other_address} > > I even tried to create a lo1 interface on the host and bridge it with > tap0 but lo1 would not add as a bridge member even if I adjust its MTU. > > > root@vas:/etc # ifconfig bridge0 create > root@vas:/etc # ifconfig lo1 mtu 1500 up > root@vas:/etc # ifconfig bridge0 addm tap0 > root@vas:/etc # ifconfig bridge0 addm lo1 > ifconfig: BRDGADD lo1: Invalid argument > root@vas:/etc # > root@vas:/etc # ifconfig bridge0 > bridge0: flags=8802 metric 0 mtu 1500 > ether 02:8f:fd:16:50:00 > nd6 options=9 > id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 > maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200 > root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0 > member: tap0 flags=143 > ifmaxaddr 0 port 5 priority 128 path cost 2000000 > root@vas:/etc # > > Any help is appreciated. >