Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 May 2023 13:53:06 -0400
From:      Steven Friedrich <freebsdlouisville@gmail.com>
To:        Tomek CEDRO <tomek@cedro.info>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Can't figure out getting network into bhyve instance.
Message-ID:  <e002e7a5-746b-b44f-345e-287ab6a1373e@gmail.com>
In-Reply-To: <CAFYkXjna8ytEfdqx-GAc6qThar04JC%2BYCMNGZMnK=Y0GSbQrrg@mail.gmail.com>
References:  <8d3a09fe-e69f-2c0e-8cc8-ca87ccfcfa42@gmail.com> <CAFYkXjna8ytEfdqx-GAc6qThar04JC%2BYCMNGZMnK=Y0GSbQrrg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------lRkF0crXhKIOZ97Q6F4EZj5B
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

I can get in with vm console nameofguest

root@freebsd:~ # ifconfig
vtnet0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 
1500
        options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
        ether 58:9c:fc:02:aa:68
        inet 192.168.1.14 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet autoselect (10Gbase-T <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

vtnet0 has an IP address, I assume it got it from DHCP.

But ping to my router at 192.168.1.1 fails.  100% packet loss.

On 5/5/23 13:22, Tomek CEDRO wrote:
> On Fri, May 5, 2023 at 5:55 PM Steven Friedrich wrote:
>> I had found a bhyve tutorial on the Internet:https://klarasystems.com/articles/from-0-to-bhyve-on-freebsd-13-1/
>> (..)
> In a simple scenario read `man vm` :-)
>
> Just add public switch with selected physical port / interface.
> Machines will use that for networking by default.
>
> I had the same problem(?). Packets were not going out of the guest vm.
> There are some sysctls to do in order to pass the bridged traffic.
>
> sysctl net.link.bridge.ipfw=0
> sysctl net.link.bridge.pfil_bridge=0
> sysctl net.link.bridge.pfil_member=0
>
> I have provided a man page update on that, any comments welcome :-)
>
> https://github.com/churchers/vm-bhyve/pull/510
>
> Hope that helps :-)
>
-- 
uname -a
FreeBSD freebsd.friedrich.org 13.2-RELEASE FreeBSD 13.2-RELEASE FREEBSD amd64

--------------lRkF0crXhKIOZ97Q6F4EZj5B
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I can get in with vm console nameofguest</p>
    <p><span style="font-family:monospace"><span
          style="color:#000000;background-color:#ffffff;">root@freebsd:~
          # ifconfig
        </span><br>
        vtnet0: flags=8863&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt;
        metric 0 mtu 1500
        <br>
               options=80028&lt;VLAN_MTU,JUMBO_MTU,LINKSTATE&gt;
        <br>
               ether 58:9c:fc:02:aa:68
        <br>
               inet 192.168.1.14 netmask 0xffffff00 broadcast
        192.168.1.255
        <br>
               media: Ethernet autoselect (10Gbase-T
        &lt;full-duplex&gt;)
        <br>
               status: active
        <br>
               nd6
        options=29&lt;PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL&gt;
        <br>
        lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; metric 0
        mtu 16384
        <br>
       options=680003&lt;RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6&gt;
        <br>
               inet6 ::1 prefixlen 128
        <br>
               inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        <br>
               inet 127.0.0.1 netmask 0xff000000
        <br>
               groups: lo
        <br>
               nd6 options=21&lt;PERFORMNUD,AUTO_LINKLOCAL&gt;<br>
        <br>
        vtnet0 has an IP address, I assume it got it from DHCP.</span></p>
    <p><span style="font-family:monospace">But ping to my router at
        192.168.1.1 fails.  100% packet loss.<br>
      </span></p>
    <div class="moz-cite-prefix">On 5/5/23 13:22, Tomek CEDRO wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFYkXjna8ytEfdqx-GAc6qThar04JC+YCMNGZMnK=Y0GSbQrrg@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">On Fri, May 5, 2023 at 5:55 PM Steven Friedrich wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">I had found a bhyve tutorial on the Internet: <a class="moz-txt-link-freetext" href="https://klarasystems.com/articles/from-0-to-bhyve-on-freebsd-13-1/">https://klarasystems.com/articles/from-0-to-bhyve-on-freebsd-13-1/</a>;
(..)
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
In a simple scenario read `man vm` :-)

Just add public switch with selected physical port / interface.
Machines will use that for networking by default.

I had the same problem(?). Packets were not going out of the guest vm.
There are some sysctls to do in order to pass the bridged traffic.

sysctl net.link.bridge.ipfw=0
sysctl net.link.bridge.pfil_bridge=0
sysctl net.link.bridge.pfil_member=0

I have provided a man page update on that, any comments welcome :-)

<a class="moz-txt-link-freetext" href="https://github.com/churchers/vm-bhyve/pull/510">https://github.com/churchers/vm-bhyve/pull/510</a>;

Hope that helps :-)

</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
uname -a
FreeBSD freebsd.friedrich.org 13.2-RELEASE FreeBSD 13.2-RELEASE FREEBSD amd64</pre>
  </body>
</html>

--------------lRkF0crXhKIOZ97Q6F4EZj5B--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e002e7a5-746b-b44f-345e-287ab6a1373e>