When is a switch not a switch?
Paul Vixie
paul at redbarn.org
Thu Oct 22 22:50:25 UTC 2020
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>
More information about the freebsd-virtualization
mailing list