Re: bhyve VM not getting as much upload bandwidth as the host

From: Odhiambo Washington <odhiambo_at_gmail.com>
Date: Mon, 14 Aug 2023 11:50:23 UTC
On Mon, Aug 14, 2023 at 2:40 PM Patrick M. Hausen <hausen@punkt.de> wrote:

> Hi all,
>
> this:
>
> > Am 14.08.2023 um 13:32 schrieb Odhiambo Washington <odhiambo@gmail.com>:
> > em1 is NOT a bridge member. It's the host's interface that is connected
> to the Internet.
>
> and this:
>
> > ifconfig_em1bridge="addm em1 addm tap0 addm tap1 addm tap2 addm tap3 up"
> > [...]
> > Of course, because em1 is a bridge member, no?
>
>
> contradict each other. em1 seems indeed to be the physical member
> interface of your
> bridge.


You are right. I got confused there.


> In that case you must move the IP address from em1 to em1bridge.
>

I don't quite agree with that. em1 is the host's interface - the one that
connects to the router.



> Like so:
>
> ifconfig_em1="-tso -lro -txcsum -rxcsum up"
> cloned_interfaces="bridge0 tap0 tap1 tap2 tap3"
> ifconfig_bridge0_name="em1bridge"
> ifconfig_em1bridge="addm em1 addm tap0 addm tap1 addm tap2 addm tap3 up"
> ifconfig_em1bridge_alias0="inet w.x.y.z netmask 255.255.255.0"
>
> Again: a bridge member interface must not have an IP address. Which
> directly leads to
> your last question:
>

My host has two NICs, em0 and em1.
em0 isn't in use at all.
em1 is the main interface to the Internet, with a public IP.
Making the change you suggest will simply make the server not connect to
the Internet. em1 has the public IP that I use to connect to the host from
where I am.
The host is in a Data Centre.
I hope this clarifies it :)


> >  One last question for today (although I should just go and RTFM): Do I
> really need several tap devices? Can't I just have all my VMs on tap0? Each
> with it's own IP in that range?
>
> You do need one tap interface per VM but these are just "virtual ethernet
> cables" plugged into
> a "virtual switch" (em1bridge). So they need not and *must* not  have an
> IP address configured
> on the host side. Just create them and add them to the bridge.
>
> All IP configuration is done in the VM guest and should match the network
> connected to em1, of course.
>

So my configuration is right actually. I am giving IPs to the tapX devices
and using NAT to let the VMs access the Internet. Why?
Because my host has a single IP address assigned by my ISP. I don't have
any other addresses other than private ones.


-- 
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
[How to ask smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html]