Date: Mon, 19 Oct 2020 23:56:30 -0700 From: John-Mark Gurney <jmg@funkthat.com> To: "D'Arcy Cain" <darcy@druid.net> Cc: freebsd-virtualization@freebsd.org Subject: Re: When is a switch not a switch? Message-ID: <20201020065630.GE8272@funkthat.com> In-Reply-To: <57c32e6d-5572-3d3b-1a57-f3064bee7dc2@druid.net> References: <57c32e6d-5572-3d3b-1a57-f3064bee7dc2@druid.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable D'Arcy Cain wrote this message on Mon, Oct 19, 2020 at 22:02 -0400: > I am using bhyve with vm-bhyve, I am trying to set up a virtual network= =20 > with multiple hosts. The idea is that a VM would be on the same virtual= =20 > network no matter which actual host it is on. >=20 > Say I have a public network a.b.c.0/24. I thought I could create a switc= h=20 > on a host. The host would be a.b.c.1 and the VMs would be a.b.c.100 and= =20 > a.b.c.101. The idea would be that the VMs would appear on the real netwo= rk.=20 > Then the 101 VM could migrate to a.b.c.2 and still be accessible. I=20 > envisioned some sort of proxy arp would happen so that every VM would sim= ply=20 > announce itself wherever it was. >=20 > This did seem to work in that I could ping from the VM: >=20 > # ping 8.8.8.8 > PING 8.8.8.8 (8.8.8.8): 56 data bytes > 64 bytes from 8.8.8.8: icmp_seq=3D0 ttl=3D114 time=3D1.734 ms >=20 > Even IPV6: >=20 > # ping6 2605:2600:1001::4b > PING6(56=3D40+8+8 bytes) 2605:2600:1001::4 --> 2605:2600:1001::4b > 16 bytes from 2605:2600:1001::4b, icmp_seq=3D0 hlim=3D64 time=3D0.960 ms > 16 bytes from 2605:2600:1001::4b, icmp_seq=3D1 hlim=3D64 time=3D0.415 ms >=20 > However TCP doesn't work. In fact, I could only ping by IP because the= =20 > system couldn't connect to the DNS server, to get an address even though = it=20 > could ping it. >=20 > I guess my first question is does this seem doable? If so, what am I=20 > missing? Is it possible that a bhyve switch is more like a router? By switch, do you mean use bridge? How specifically is the network configured? What you are describing sounds like what I do w/ bridge, but my use was slightly more complicated. Say your host has em0 as the main network, you would create a bridge0 interface, either via cloned_interfaces or via "ifconfig bridge0 create". Then you would put the em0 interface as a member of the bridge interface. You would also add the tap interfaces of the various bhyve vms as well (don't forget to make sure the tap interface is up on the host, net.link.tap.up_on_open helps w/ this)... I have heard (and that is the way I do that), that you have to put the host IPs on the bridge0 interface, and not the em0 interface. --=20 John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJfjoodXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2MEI1RTRGMTNDNzYyMDZDNjEyMDBCNjAy MDVGMEIzM0REMDA2QURBAAoJECBfCzPdAGraXcYP/0rzorXTZBfADZdRhm2DBuie NwdWSOIwgp1nHLwgLdAm58p2D7CzeDjrQ9CIqNGUeFRv/VIGpzJCuyTTeaWpJfWQ a5eqPwdpiPPBICS8JArk4ixm7Q5LZby8k2b1f6gM9KEkwjm4estrqNLd1w7tGa0K wIWscYaVEd5qj5eIMyD13XdeTKumGywXEtzN1oeNCJVF8ycoUkipTuY1ZKunICpp +N/2dLiJetFps2bNuz0G8SqevaAjn0NZ0YH2k1HlQPuIKzP+HnTxDL+k7bTTRbZj fRSIh/w/HIrpjjFQ6dLUiJVAvNSf4gM3A5XexgHCgiETOvUiF+c5SwaIZ0i/Gq3p dI9Bg7M9XIt88jGPoO6Zv/fW0gCpFGilq8jWNg+vO3BY6bZovzx91c9Np9o2TJig fIXKvIoGlC1Ba6+YrUqg5t3htA+ImA0nzo8TWQOOcghXLGrhfpFg3A/qRCiBvutL v+k9nDTUBp5IIQFiTB1uj583L1rZ8JNMfoYEGchun2PnURxuHW+QITBx8FQufjRA VKc3FvhLHe1N26J3+kBtjxYbUlzUAB5CKiKjaU9nNP7IvGy+UuWs7A6/ZQXea4ng jIVi7sD4XaTD27HpTVoaubMBBdDWof14+ZMPA/+zLTi2FWq/eCJ8M92V4NqRqxx4 MxA4GJA3kw+E1bGzDeiA =POR4 -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201020065630.GE8272>