Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Oct 2020 15:50:12 -0700
From:      Paul Vixie <paul@redbarn.org>
To:        D'Arcy Cain <darcy@druid.net>
Cc:        Jason Tubnor <jason@tubnor.net>, "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: When is a switch not a switch?
Message-ID:  <42e3d3f2-7cf3-568e-8714-086c699e9c33@redbarn.org>
In-Reply-To: <b39bb54e-dd49-e7b6-5493-41f40a9ee74a@druid.net>
References:  <57c32e6d-5572-3d3b-1a57-f3064bee7dc2@druid.net> <20201020065630.GE8272@funkthat.com> <CF189122-7D85-4BF1-9172-75D3EE0E77FB@punkt.de> <3ed627e2-d99a-107e-4135-8aef1ad4ec71@druid.net> <30A67F82-312E-4651-A5E7-2E2AD926FF24@punkt.de> <973b1b56-817f-6976-e5d3-34cfbc373b13@druid.net> <A075C069-1F89-428C-BDB7-7A9F44A4E283@punkt.de> <723CA318-80E9-4A6B-91ED-E791A40CC2C0@punkt.de> <6267599d-bc0c-6d63-bb19-1fc695e53997@druid.net> <CACLnyCJmLcRe-19iy2eZY8gxF9PGbzvaudTGEFcAHaMidL8XAw@mail.gmail.com> <b39bb54e-dd49-e7b6-5493-41f40a9ee74a@druid.net>

next in thread | previous in thread | raw e-mail | index | archive | help


D'Arcy Cain wrote on 2020-10-22 07:03:
> On 10/21/20 11:16 PM, Jason Tubnor wrote:
>>     public: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric
>> 0 mtu 1500
>>       ...
>>               groups: bridge
>>               nd6 options=9<PERFORMNUD,IFDISABLED>
>>     tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> 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 <guestname>
>
> 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
<https://www.postbox-inc.com/?utm_source=email&utm_medium=siglink&utm_campaign=reach>;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42e3d3f2-7cf3-568e-8714-086c699e9c33>