From nobody Fri May 5 17:53:06 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QCdZZ2qM6z49bTy for ; Fri, 5 May 2023 17:53:10 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QCdZZ0q7wz4M7c for ; Fri, 5 May 2023 17:53:10 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-61b6101a1b9so9318776d6.3 for ; Fri, 05 May 2023 10:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683309187; x=1685901187; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=xs4Vj3No9EV6brycgPEXinatYX8ht8e7NoBJnLNCxpA=; b=pLuSRjlm5A9Desy6bQ+tFSag4sfKWOTGqUIznBf7k7dpk/XrMjz63ocn1bNldUtJfX 3kUiDee0xeCE83bUvkQIUtjVn0S/JnDzEKJLPiXwWUoin+6V6iFXCFyOLSlu6PtL7vdr yQ+bc/l4Uq2npFj9qB0m8eNQw+b2BhKRpsuWE0S6D99ONJ+Z5dXJRDODWw3Q3j8ZpeVJ VXGTppyjHWhJGtXvx9ZSl3o+rWavNdZWBMASMtaJm69Gcab7bKwQq5B7rsZWSeu2osZJ t/hqsQPtj9FI2sg3oXUAn6c/3BmNsTqnDZhLukDcvDkmaHCq8U+4Iquq+s6p8GjsTXV9 DYUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683309187; x=1685901187; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=xs4Vj3No9EV6brycgPEXinatYX8ht8e7NoBJnLNCxpA=; b=Ve5xdQLAwID5wWp6okWHukjgbD4BqE/NACd4v8cX/dy/gc5W33V2pXQXWGp6AJQr14 lTPSlaSTCKE62C1KVrHiAQ2BBdGxzLlmtFa/ndMOn8/7KWd1BryhOwaT7c1Xc/n1CD5b 93dU1nBc7bJpM97M8FL8a/AYWdOYQZKERcdPfvujB6/NtgUNriCDo4Uk2Y7F2AWSURsx HcjNqtnwauCRyReymkfhl0u5tFCCvJB/22YaqWOV7wv1yhm0zN7TnLFxXw9gD4xMSs/P +hR+Sx2GeUZjis5VVbIficopw7FrvaQNHENpTZf/6k9rRw2Kv7TYT57dLniaVykJoCt3 9aFQ== X-Gm-Message-State: AC+VfDxbwOslHJXEaeWNJwVAWPWrv29kyCKWONju0C7iwhBjoIlIaNZG Hp4NNLOmEdsqbcSif+hmqNKusxiRelZK+WRI X-Google-Smtp-Source: ACHHUZ5LxAZBPgwqIxl/MrFoI0xEece1n59saeNhIhSrAx6hEO3Uxg9rKBEq9Rv72RkmgmKVhGG+iA== X-Received: by 2002:ad4:5f0c:0:b0:5ea:9fc5:fca2 with SMTP id fo12-20020ad45f0c000000b005ea9fc5fca2mr3643644qvb.45.1683309187339; Fri, 05 May 2023 10:53:07 -0700 (PDT) Received: from [192.168.1.9] ([162.154.243.45]) by smtp.gmail.com with ESMTPSA id p1-20020a05620a132100b0074df20fb43dsm734387qkj.97.2023.05.05.10.53.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 May 2023 10:53:07 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------lRkF0crXhKIOZ97Q6F4EZj5B" Message-ID: Date: Fri, 5 May 2023 13:53:06 -0400 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: Can't figure out getting network into bhyve instance. To: Tomek CEDRO Cc: freebsd-questions@freebsd.org References: <8d3a09fe-e69f-2c0e-8cc8-ca87ccfcfa42@gmail.com> Content-Language: en-US From: Steven Friedrich In-Reply-To: X-Rspamd-Queue-Id: 4QCdZZ0q7wz4M7c X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N 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 metric 0 mtu 1500        options=80028        ether 58:9c:fc:02:aa:68        inet 192.168.1.14 netmask 0xffffff00 broadcast 192.168.1.255        media: Ethernet autoselect (10Gbase-T )        status: active        nd6 options=29 lo0: flags=8049 metric 0 mtu 16384        options=680003        inet6 ::1 prefixlen 128        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2        inet 127.0.0.1 netmask 0xff000000        groups: lo        nd6 options=21 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

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--