From owner-freebsd-net@freebsd.org Thu Nov 5 02:33:28 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 7D24BA26C58 for ; Thu, 5 Nov 2015 02:33:28 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) Received: from relay2.tomsk.ru (mail.sibptus.tomsk.ru [212.73.124.5]) by mx1.freebsd.org (Postfix) with ESMTP id E391C12A8 for ; Thu, 5 Nov 2015 02:33:27 +0000 (UTC) (envelope-from vas@mpeks.tomsk.su) X-Virus-Scanned: by clamd daemon 0.98.5_1 for FreeBSD at relay2.tomsk.ru Received: from admin.sibptus.TOMSK.ru ([212.73.125.240] verified) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.16) with ESMTPS id 38945528; Thu, 05 Nov 2015 08:33:26 +0600 Received: from admin.sibptus.TOMSK.ru (sudakov@localhost [127.0.0.1]) by admin.sibptus.TOMSK.ru (8.14.9/8.14.7) with ESMTP id tA52XNGP010356; Thu, 5 Nov 2015 08:33:23 +0600 (NOVT) (envelope-from vas@mpeks.tomsk.su) Received: (from sudakov@localhost) by admin.sibptus.TOMSK.ru (8.14.9/8.14.7/Submit) id tA52XNJv010355; Thu, 5 Nov 2015 08:33:23 +0600 (NOVT) (envelope-from vas@mpeks.tomsk.su) X-Authentication-Warning: admin.sibptus.TOMSK.ru: sudakov set sender to vas@mpeks.tomsk.su using -f Date: Thu, 5 Nov 2015 08:33:23 +0600 From: Victor Sudakov To: John Nielsen Cc: freebsd-net@freebsd.org Subject: Re: tap(4) and host-only networking between host and guest Message-ID: <20151105023323.GB10139@admin.sibptus.tomsk.ru> References: <20151104075454.GA99850@admin.sibptus.tomsk.ru> <5639FF12.1020109@freebsd.org> <20151104131230.GA1117@admin.sibptus.tomsk.ru> <20151104184503.GC1117@admin.sibptus.tomsk.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: OAO "Svyaztransneft", SibPTUS X-PGP-Key: http://www.dreamwidth.org/pubkey?user=victor_sudakov X-PGP-Fingerprint: 10E3 1171 1273 E007 C2E9 3532 0DA4 F259 9B5E C634 User-Agent: Mutt/1.5.24 (2015-08-30) 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: Thu, 05 Nov 2015 02:33:28 -0000 John Nielsen wrote: > >>>> > >>>> 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} > >> > >> Thank you, Julian! It works. I felt I was missing something obvious. > > > > For some reason, after a guest is shutdown or rebooted, the IP address > > on the host's tap0 interface is deleted. > > > > It's kind of inconvenient. > > What I have done in this scenario is create a bridge interface, > assign the host???s IP to the bridge, and add the tap as a member to > the bridge. That's what I have eventually done too. This way several guests can share a LAN emulation, and a DHCP server can listen on bridge0. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN sip:sudakov@sibptus.tomsk.ru