From nobody Fri May 05 15:54:54 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 4QCZy90MlNz49Tpb for ; Fri, 5 May 2023 15:54:57 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (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 4QCZy83H42z44WV for ; Fri, 5 May 2023 15:54:56 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20221208 header.b=Cm8YovbY; spf=pass (mx1.freebsd.org: domain of freebsdlouisville@gmail.com designates 2607:f8b0:4864:20::f33 as permitted sender) smtp.mailfrom=freebsdlouisville@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-61a9bb1b3a0so9195806d6.1 for ; Fri, 05 May 2023 08:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683302096; x=1685894096; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=YkIOVUiC1ggK79hYZQXAK0wb+7garG6wZEpf3JZ7utI=; b=Cm8YovbYuO9TeR3fpZ66Ca+nc4WV/HnDMtc5+8QoDdleLwEtAEqBR5igL7DzqZQuMd Z+4FI9AHsyV2XnFgUtBHc0rQHV3AD27dCucRMT9KObTDkuElRGfI5NUXDmyKx2ysTO7W KYhWuXzBQOA3ozCyB+vp4sxWvS5amUBJP+L/Y/REnsqfkaVHq8FntoMoVtXXrQKleQ/r qj78Ubp6MUitzKl3oaYhnL5PuEhHRrORPxPZryEz4lTyFKB6hr1ZASuT+UjL2gxKs0MG xDBxZUQmaVW9FuE6iclGokF66/SS/6PKEj0Y4t5ZvDeUIN014YPPqOBPoSdkbr3qI8dt Sygw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302096; x=1685894096; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YkIOVUiC1ggK79hYZQXAK0wb+7garG6wZEpf3JZ7utI=; b=KCD2Y8sk/0PI5wpd4WcMVs8rqUCBbv7drja2lqXw8/ol+0gNc+rwIu2QWStIcmxHsI MgWmlIZGgHmNGg4f6g2tPOJuipFEO9WBjRLchFgFV1wgsq5nWo2HtSbRFqO2u75BzTT9 gB5WkoHmh15XIi7bkEdltBxwlw+XogxWL+e2v3Ykf3XRqPNXMHZS7qG+tNdQXp5jrw0q tzXabJGW1Y32MF8y0msT5f1DKgJpYYRoMSYVZYKc3fvk4+Gl0P2XQJR7+aRCqDCVsJXx P/1+0Yo5s2qcXE7oGibNBOFg2cNTB5Jh4Jy4sxBXrmQ6Cy7iWPnM98rKzFPm4UbIzBOb UTGw== X-Gm-Message-State: AC+VfDzoI5pMVBbWgbF3uH5x82289YziFhUaebIz3rCnTHzptewcobVC +exlcLoshA+kZ5I1560d8J/vXh74PYOz5gHe X-Google-Smtp-Source: ACHHUZ4Xb73vUhQjsKVXl1rYpcWkf5PTM4OUp0iM1/yUu9iLv0FepmNnroZTvS4wYBZzgj+jKb0sEQ== X-Received: by 2002:a05:6214:20ee:b0:616:84a3:375c with SMTP id 14-20020a05621420ee00b0061684a3375cmr2037947qvk.42.1683302095628; Fri, 05 May 2023 08:54:55 -0700 (PDT) Received: from [192.168.1.9] ([162.154.243.45]) by smtp.gmail.com with ESMTPSA id i9-20020a0cf489000000b005ef608dc422sm696133qvm.41.2023.05.05.08.54.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 May 2023 08:54:55 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------YRWSDqQTJMcMLfXt2WB1TcZI" Message-ID: <8d3a09fe-e69f-2c0e-8cc8-ca87ccfcfa42@gmail.com> Date: Fri, 5 May 2023 11:54:54 -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 Content-Language: en-US To: freebsd-questions@freebsd.org From: Steven Friedrich Subject: Can't figure out getting network into bhyve instance. X-Spamd-Result: default: False [-3.90 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.90)[-0.903]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f33:from]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org] X-Rspamd-Queue-Id: 4QCZy83H42z44WV X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N This is a multi-part message in MIME format. --------------YRWSDqQTJMcMLfXt2WB1TcZI Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit I had found a bhyve tutorial on the Internet: https://klarasystems.com/articles/from-0-to-bhyve-on-freebsd-13-1/ I performed the steps to create vm_public, but I don't get internet inside the vm.  Here's my ifconfig from the host side: re0: flags=8943 metric 0 mtu 1500        options=8209b        ether 10:62:e5:02:ef:45        inet 192.168.1.9 netmask 0xffffff00 broadcast 192.168.1.255        media: Ethernet autoselect (1000baseT )        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 vm-public: flags=8843 metric 0 mtu 1500        ether 16:58:c1:2e:24:bc        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0        member: re0 flags=143                ifmaxaddr 0 port 1 priority 128 path cost 20000        groups: bridge vm-switch viid-4c918@        nd6 options=9 I tried to follow the man page vm: root@freebsd:/zroot/bhyve/.templates # vm switch add public re0 /usr/local/sbin/vm: ERROR: failed to add member re0 to the virtual switch public root@freebsd:/zroot/bhyve/.templates # vm switch create public /usr/local/sbin/vm: ERROR: switch public already exists So I tried ifconfig vm-public destroy so I could start fresh. vm-public no longer appears in ifconfig then I tried, from the vm man page: vm switch create public /usr/local/sbin/vm: ERROR: switch public already exists root@freebsd:/usr/local/share/examples/vm-bhyve # vm switch add public re0 /usr/local/sbin/vm: ERROR: unable to locate switch id vm switch list NAME    TYPE      IFACE  ADDRESS  PRIVATE  MTU  VLAN  PORTS public  standard  -      -        no       -    -     re0 root@freebsd:/usr/local/share/examples/vm-bhyve # vm switch info local: _netgraph,: bad variable name ------------------------ Virtual Switch: public ------------------------  type: standard  ident: -  vlan: -  physical-ports: re0 I'm uneducated in this area.  Any suggestion? -- uname -a FreeBSD freebsd.friedrich.org 13.2-RELEASE FreeBSD 13.2-RELEASE FREEBSD amd64 --------------YRWSDqQTJMcMLfXt2WB1TcZI Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

I had found a bhyve tutorial on the Internet: https://klarasystems.com/articles/from-0-to-bhyve-on-freebsd-13-1/

I performed the steps to create vm_public, but I don't get internet inside the vm.  Here's my ifconfig from the host side:

re0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
       options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
       ether 10:62:e5:02:ef:45
       inet 192.168.1.9 netmask 0xffffff00 broadcast 192.168.1.255
       media: Ethernet autoselect (1000baseT <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>
vm-public: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
       ether 16:58:c1:2e:24:bc
       id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
       maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
       root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
       member: re0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
               ifmaxaddr 0 port 1 priority 128 path cost 20000
       groups: bridge vm-switch viid-4c918@
       nd6 options=9<PERFORMNUD,IFDISABLED>

I tried to follow the man page vm:

root@freebsd:/zroot/bhyve/.templates # vm switch add public re0
/usr/local/sbin/vm: ERROR: failed to add member re0 to the virtual switch public
root@freebsd:/zroot/bhyve/.templates # vm switch create public
/usr/local/sbin/vm: ERROR: switch public already exists

So I tried ifconfig vm-public destroy so I could start fresh.

vm-public no longer appears in ifconfig

then I tried, from the vm man page:

vm switch create public
/usr/local/sbin/vm: ERROR: switch public already exists
root@freebsd:/usr/local/share/examples/vm-bhyve # vm switch add public re0
/usr/local/sbin/vm: ERROR: unable to locate switch id

vm switch list
NAME    TYPE      IFACE  ADDRESS  PRIVATE  MTU  VLAN  PORTS
public  standard  -      -        no       -    -     re0
root@freebsd:/usr/local/share/examples/vm-bhyve # vm switch info
local: _netgraph,: bad variable name
------------------------
Virtual Switch: public
------------------------
 type: standard
 ident: -
 vlan: -
 physical-ports: re0


I'm uneducated in this area.  Any suggestion?

-- 
uname -a
FreeBSD freebsd.friedrich.org 13.2-RELEASE FreeBSD 13.2-RELEASE FREEBSD amd64
--------------YRWSDqQTJMcMLfXt2WB1TcZI--