From owner-freebsd-virtualization@freebsd.org Thu Oct 22 22:50:25 2020 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAC4542C169 for ; Thu, 22 Oct 2020 22:50:25 +0000 (UTC) (envelope-from paul@redbarn.org) Received: from family.redbarn.org (family.redbarn.org [IPv6:2001:559:8000:cd::5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHMyS3NvYz4bDC for ; Thu, 22 Oct 2020 22:50:24 +0000 (UTC) (envelope-from paul@redbarn.org) Received: from [IPv6:2001:559:8000:c9:c9bf:4c9b:a373:d564] (unknown [IPv6:2001:559:8000:c9:c9bf:4c9b:a373:d564]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by family.redbarn.org (Postfix) with ESMTPSA id BE65DC3F19; Thu, 22 Oct 2020 22:50:14 +0000 (UTC) Subject: Re: When is a switch not a switch? To: D'Arcy Cain Cc: Jason Tubnor , "freebsd-virtualization@freebsd.org" References: <57c32e6d-5572-3d3b-1a57-f3064bee7dc2@druid.net> <20201020065630.GE8272@funkthat.com> <3ed627e2-d99a-107e-4135-8aef1ad4ec71@druid.net> <30A67F82-312E-4651-A5E7-2E2AD926FF24@punkt.de> <973b1b56-817f-6976-e5d3-34cfbc373b13@druid.net> <723CA318-80E9-4A6B-91ED-E791A40CC2C0@punkt.de> <6267599d-bc0c-6d63-bb19-1fc695e53997@druid.net> From: Paul Vixie Message-ID: <42e3d3f2-7cf3-568e-8714-086c699e9c33@redbarn.org> Date: Thu, 22 Oct 2020 15:50:12 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.34 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Rspamd-Queue-Id: 4CHMyS3NvYz4bDC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of paul@redbarn.org designates 2001:559:8000:cd::5 as permitted sender) smtp.mailfrom=paul@redbarn.org X-Spamd-Result: default: False [-2.25 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEFALL_USER(0.00)[paul]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2001:559:8000::/48]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.005]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.989]; DMARC_NA(0.00)[redbarn.org]; NEURAL_HAM_MEDIUM(-0.95)[-0.954]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:33651, ipnet:2001:559:8000::/48, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MAILMAN_DEST(0.00)[freebsd-virtualization]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.33 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, 22 Oct 2020 22:50:25 -0000 D'Arcy Cain wrote on 2020-10-22 07:03: > On 10/21/20 11:16 PM, Jason Tubnor wrote: >>     public: flags=8843 metric >> 0 mtu 1500 >>       ... >>               groups: bridge >>               nd6 options=9 >>     tap0: flags=8843 metric 0 >> mtu 1500 >> ... >>               groups: tap vm-port >>               media: Ethernet autoselect >>               ... >> >> >> tap0 is not a member of public so has no way to get to eth0 or public. > > Odd.  I thought that vm-bhyve did that when the VM came up. here's how i do it, per years-ago documentation to this effect: > autobridge_interfaces="bridge0"                                                                                         > autobridge_bridge0="tap* > igb1"                                                                                          > ifconfig_igb1="up media 1000baseTX fib > 1"                                                                               > cloned_interfaces="bridge0 tap0 tap1 tap2 tap3 tap4 tap5 tap6 tap7" > ifconfig_bridge0="inet 24.104.150.210/27 fib > 1"                                                                         > ifconfig_bridge0_ipv6="inet6 2001:559:8000:cd::2/64 fib 1 > auto_linklocal up" > ifconfig_tap0="up fib 1" > ifconfig_tap1="up fib 1" > ifconfig_tap2="up fib 1" > ifconfig_tap3="up fib 1" > ifconfig_tap4="up fib 1" > ifconfig_tap5="up fib 1" > ifconfig_tap6="up fib 1" > ifconfig_tap7="up fib 1" note, fib 1 is a detail here, just gives me a different default route for the virtual machines. > > Hmm.  It looks like tap0 gets attached to vm-public if it is > configured to attach to public.  Perhaps I just need to name the > bridge that way. autobridge_* (rc.conf(5)) is what you'll need for that. > >> I'd avoid creating the 'public' bridge and let vm-bhyve create it.  >> Something like: >> >> vm switch create public >> vm switch add public eth0 > > But then I can't create the IP on the host until too late in the > boot.  I assume that you mean to do that in rc.local.  Are you sure > that the above is any different than what I did? because my management interface for the milking machine is on a different subnet, i have this: > vlans_igb0="201 203" > ifconfig_igb0="up vlanmtu media > 1000baseTX"                                                                             > ifconfig_igb0_201="inet > 24.104.150.130/26"                                                                              > ifconfig_igb0_201_ipv6="inet6 2001:559:8000:c9::3/64" > ifconfig_igb0_203="inet > 24.104.150.16/27"                                                                               > ifconfig_igb0_203_ipv6="inet6 2001:559:8000:cb::16/64" however, you could do away with that and just autobridge your connected interface (mine is igb1, see above.) > >> Then for the guest: >> >> vm add -d network -s public > > Hard to automate when VM can migrate to another host. hard to do any of this if you're not doing it by hand. (i don't use the "vm" command.) -- Sent from Postbox