Solved How to duplicate the tap0 interface in a new tap1 network interface that it is not used

In some of the tries that I did,yes,I could ping ubuntu. But in the lastest tries I couldn't. Don't know why,but I'm getting the error "host is down" when I ping the ubuntu vm from freebsd. We can try also with windows 10,maybe its easier. Even windows 10 can't connect to internet. This is what says ifconfig before to run the VM :

Code:
root@marietto:/home/marietto # ifconfig

em0: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
    ether e0:d5:5e:e2:1f:22
    inet 192.168.1.6 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 ba:2d:73:ae:ed:f3
    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: em0 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>

at this point,I create the tap0 interface with this command :

Code:
ifconfig tap0 create up

and I add the tap0 to vm-public :

Code:
ifconfig vm-public addm tap0

the ifconfig at this point,says :

Code:
root@marietto:/home/marietto # ifconfig

em0: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=4810099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
    ether e0:d5:5e:e2:1f:22
    inet 192.168.1.6 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 ba:2d:73:ae:ed:f3
    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: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
            ifmaxaddr 0 port 4 priority 128 path cost 2000000
    member: em0 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>

tap0: flags=8903<UP,BROADCAST,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:8e
    groups: tap
    media: Ethernet autoselect
    status: no carrier
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

as u can see,there are two members on the vm-public interface : em0 and tap0. This is what I see when is vm-bhyve that configures the network. BTW,for sure,vm-bhyve changes some other parameter under the hood.

on ubuntu :

Code:
ip route list


default via 192.168.1.1 dev enp0s5 proto static metric 100
169.254.0.0/16 dev enp0s5 scope link metric 100
192.168.1.0/24 dev enp0s5 proto kernel scope link src 192.168.1.7 metric 100
 
Yes, you're using the 'bridged' solution.
That is, BTW, what most of the home wifi routers use, less hussle there. Wifi card interface is linked together with LAN and as such has the same IP. That is how it becomes part of the same network...
So you really wanna read more on networking, virtual networks, routing etc. Specifically, for this setup, more about bridges .
VM-BHYVE github page contains a good deal about bridging... though not as much as I would like to. Still, you wanna read it for more information.

So! In this case your tap0 would have the same address as your em0 has -- because they're bridged together. Which means, you won't have to explicitly configure the address in Ubuntu... NetworkManager will automatically (which is the default) pick up the address.
Just there is that problem with NetworkManager -- it is very slow and unpredictable in its workings. Now you have network -- and now you don't!! And after some 5 min, for no obvious reason, you have it again!!! Terrible, I really hate that messy application.

So, currently (in your output) tap0 says 'no carrier' -- because Ubuntu guest is not UP. Once it goes up (your VM machine is launched) When it is UP, the address will be the same -- 192.168.1.6.
Routing information is all right, you have default route via 192.168.1.1, same as your host.

Oh, BTW, you can also open "terminal" app in your Ubuntu desktop and check dmesg output regarding networking.
Like dmesg | grep enp0s5.
 
Wifi card interface is linked together with LAN and as such has the same IP. That is how it becomes part of the same network...
IP is layer 3, they're on the same network because it's connected at layer 2. That's what a bridge(4) does, it connects two networks at the data link level.
 
I've tried several times to setup the ubuntu network configuration using the DHCP on the IP4,but even in this case,if I use bhyve,it won't connect. Instead,it works if I use vm-bhyve. I did what u read below several times,but it never worked. Anyway,I did it again to show you. I've created a different netplan file this time,using only the dhcp4 and a new network renderer,called networkd,instead of NetworkManager,that u don't like :

Code:
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s5:
      dhcp4: true

this time the error is different when I ping the ip address of google :

Code:
ping 172.217.21.67
ping connect : the net is not reachable.

Code:
dmesg | grep enp0s5

virtio_net virtio1 enp0s5: renamed from eth0

BTW enp0s5 hasn't any IP address assigned. Clearly in the site below u can see what's the limit of linux / ubuntu :


so many alternatives means that u need more and more experience if u want to understand why u get an error. You can expect a lot of headache.
 
according with this site : https://danielmiessler.com/study/manually-set-ip-linux/

I tried also to do :

Code:
ifconfig enp0s5 192.168.1.5 netmask 255.255.255.0 up
route add default gw 192.168.1.1
echo "nameserver 192.168.1.1" > /etc/resolv.conf

and then :

Code:
ping google.com
error during the name resolution.

no way.

According with the same website,I tried also :

Code:
ip link set enp0s5 up

and

Code:
nano /etc/netplan/*.yaml

network:
  ethernets:
      enp0s5:
          addresses: [192.168.1.13/24]
          gateway4: 192.168.1.1
          dhcp4: true
          optional: true
          nameservers:
              addresses: [8.8.8.8,8.8.4.4]
  version: 2

temporary error during the name resolution.
 
Well!! This is exactly why I DON"T use vm-bhyve and other black-box solutions.
That in the end of it you will have to 'make your hands dirty' anyway!!

BTW, with bridge solution DHCP is not the thing you want, I'm afraid.
according with this site : https://danielmiessler.com/study/manually-set-ip-linux/

I tried also to do :

Code:
ifconfig enp0s5 192.168.1.5 netmask 255.255.255.0 up
route add default gw 192.168.1.1
echo "nameserver 192.168.1.1" > /etc/resolv.conf

and then :

Code:
ping google.com
error during the name resolution.

no way.

According with the same website,I tried also :

Code:
ip link set enp0s5 up

and

Code:
nano /etc/netplan/*.yaml

network:
  ethernets:
      enp0s5:
          addresses: [192.168.1.13/24]
          gateway4: 192.168.1.1
          dhcp4: true
          optional: true
          nameservers:
              addresses: [8.8.8.8,8.8.4.4]
  version: 2

temporary error during the name resolution.
Makes no sense just blindly copying without understanding, you see.
As you don't have any name resolution set up at host 192.168.1.1 you will get your error. Why not try a more safe solution like '8.8.8.8'??
 
The name resolution could be [homenet.telecomitalia.it] ; so I tried with this :


Screenshot_20210817_182008.png

I didn't understand what are u saying. vm-bhyve is a wrapper created to make the dirty job. At the end,it works for me. Yes,I don't know what's inside the code because I haven't the right competences and experience. But with them,I can fix this problem easy. Anyone with some experience knows where to look,and in general,how to configure a bridge can find the solution. But for me,that I can't manage complicated configurations,at the end I can use the black box solution because it just works and I can go ahead. I don't do it because I'm tenacious and I want to learn. But soon I will give up,since no one is helping me with the will to find a solution. I created a lot of posts all around the net but I've got a very few useful replies. Yes. My eyes are blind for this job. I think that's natural,since I haven't studied anything of what it is needed to understand what to do. I'm a psychologist. My approach here is to try to understand,to use my intuition,a common sense,the right websites that may contains the solution and some trial and errors. You say to use "gateway4: 8.8.8.8" ? If u mean this :


yes,I've tried. Don't u think that this is interesting :

Screenshot_20210817_183110.png
 
Are you connected to the management switch? Some management switches like cisco have smartports that need to be configured to allow more than 1 MAC address per port otherwise your L2 bridge will not work.
 
I'm using ubuntu 21.04 as a guest / VM Os. FreeBSD is my main (host) OS. On ubuntu guest I tried to use the DHCP inside the netplan file. If I use bhyve,it doesn't connect to internet. with vm-bhyve it can. Can u suggest to me to issue some particular commands inside Ubuntu ? So,we can be sure of this.
 
To verify if your bhyve configuration is working test it by creating a new FreeBSD guest virtual machine, boot into LiveCD and obtain DHCP address. You don't have to install the entire guest for that test it's only to check if your bridge is working correctly. To do this you can follow the handbook here: https://docs.freebsd.org/doc/13.0-R...eebsd/handbook/virtualization-host-bhyve.html

With the only change is that instead of downloading 10.3 boot image as it's writed on the handbook you can download the 13.0-RELEASE via
fetch https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/13.0/FreeBSD-13.0-RELEASE-amd64-bootonly.iso

Then if the guest VM obtain the DHCP address you can shut down it and try the same with some other linux distro like Ubuntu.
 
Code:
ifconfig tap0 create up
ifconfig vm-public addm tap0

root@marietto:/home/marietto # ifconfig

Code:
em0: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=4810099<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
    ether e0:d5:5e:e2:1f:22
    inet 192.168.1.6 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 ca:94:8f:c2:93:6b
    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: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
            ifmaxaddr 0 port 4 priority 128 path cost 2000000
    member: em0 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>

tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80000<LINKSTATE>
    ether 58:9c:fc:10:ff:8e
    groups: tap
    media: Ethernet autoselect
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
    Opened by PID 2530


Code:
Loading kernel...
/boot/kernel/kernel text=0x17b9e0 text=0xdd6d30 text=0x65b9ac data=0x140 data=0x1b9348+0x445cb8 syms=[0x8+0x178e90+0x8+0x199058]
Loading configured modules...
can't find '/boot/entropy'
can't find '/etc/hostid'
---<<BOOT>>---
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
    The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021
    root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
VT: init without driver.
CPU: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (3600.03-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x906ed  Family=0x6  Model=0x9e  Stepping=13
  Features=0x9f83fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,SS,HTT,PBE>
  Features2=0xfeda7a17<SSE3,PCLMULQDQ,DTES64,DS_CPL,SSSE3,SDBG,FMA,CX16,xTPR,PCID,SSE4.1,SSE4.2,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND,HV>
  AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
  AMD Features2=0x121<LAHF,ABM,Prefetch>
  Structured Extended Features=0x40f39<FSGSBASE,BMI1,HLE,AVX2,BMI2,ERMS,INVPCID,RTM,RDSEED>
  Structured Extended Features3=0x400<MD_CLEAR>
  XSAVE Features=0x1<XSAVEOPT>
  TSC: P-state invariant
Hypervisor: Origin = "bhyve bhyve "
real memory  = 1073741824 (1024 MB)
avail memory = 1004269568 (957 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <BHYVE  BVMADT  >
random: registering fast source Intel Secure Key RNG
random: fast provider: "Intel Secure Key RNG"
arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled.
ioapic0 <Version 1.1> irqs 0-31
Timecounter "TSC-low" frequency 1800014314 Hz quality 1000
KTLS: Initialized 1 threads
random: entropy device external interface
000.000018 [4354] netmap_init               netmap: loaded module
[ath_hal] loaded
WARNING: Device "kbd" is Giant locked and may be deleted before FreeBSD 14.0.
kbd1 at kbdmux0
mlx5en: Mellanox Ethernet driver 3.6.0 (December 2020)
nexus0
cryptosoft0: <software crypto>
aesni0: <AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS>
acpi0: <BHYVE BVXSDT>
acpi0: Power Button (fixed)
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
attimer0: <AT timer> port 0x40-0x43 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 16777216 Hz quality 950
Event timer "HPET" frequency 16777216 Hz quality 550
Event timer "HPET1" frequency 16777216 Hz quality 450
Event timer "HPET2" frequency 16777216 Hz quality 450
Event timer "HPET3" frequency 16777216 Hz quality 450
Event timer "HPET4" frequency 16777216 Hz quality 450
Event timer "HPET5" frequency 16777216 Hz quality 450
Event timer "HPET6" frequency 16777216 Hz quality 450
Event timer "HPET7" frequency 16777216 Hz quality 450
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <32-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pcib0: could not evaluate _ADR - AE_NOT_FOUND
pci0: <ACPI PCI bus> on pcib0
isab0: <PCI-ISA bridge> at device 1.0 on pci0
isa0: <ISA bus> on isab0
virtio_pci0: <VirtIO PCI (legacy) Network adapter> port 0x2000-0x203f mem 0xc0000000-0xc0001fff irq 16 at device 2.0 on pci0
vtnet0: <VirtIO Networking Adapter> on virtio_pci0
vtnet0: Ethernet address: 00:a0:98:5f:06:1a
vtnet0: netmap queues/slots: TX 1/1024, RX 1/512
000.000161 [ 450] vtnet_netmap_attach       vtnet attached txq=1, txd=1024 rxq=1, rxd=512
virtio_pci1: <VirtIO PCI (legacy) Block adapter> port 0x2080-0x20ff mem 0xc0002000-0xc0003fff irq 17 at device 3.0 on pci0
vtblk0: <VirtIO Block Adapter> on virtio_pci1
vtblk0: 16384MB (33554432 512 byte sectors)
ahci0: <Intel ICH8 AHCI SATA controller> mem 0xc0004000-0xc00043ff irq 18 at device 31.0 on pci0
ahci0: AHCI v1.30 with 6 6Gbps ports, Port Multiplier not supported
ahcich0: <AHCI channel> at channel 0 on ahci0
vmgenc0: <VM Generation Counter> on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
driver bug: Unable to set devclass (class: atkbdc devname: (unknown))
Unhandled ps2 mouse command 0xe1
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
WARNING: Device "psm" is Giant locked and may be deleted before FreeBSD 14.0.
psm0: model Generic PS/2 mouse, device ID 0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (9600,n,8,1)
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
uart2: <16550 or compatible> port 0x3e8-0x3ef irq 4 on acpi0
uart3: <16550 or compatible> port 0x2e8-0x2ef irq 3 on acpi0
vga0: <Generic ISA VGA> at port 0x3b0-0x3bb iomem 0xb0000-0xb7fff pnpid PNP0900 on isa0
Timecounters tick every 10.000 msec
usb_needs_explore_all: no devclass
Trying to mount root from cd9660:/dev/iso9660/13_0_RELEASE_AMD64_BO [ro]...
Root mount waiting for: CAM
cd0 at ahcich0 bus 0 scbus0 target 0 lun 0
cd0: <BHYVE BHYVE DVD-ROM 001> Removable CD-ROM SCSI device
cd0: Serial Number BHYVE-A5E2-EFF5-2B7E
cd0: 600.000MB/s transfers (SATA 3.x, UDMA6, ATAPI 12bytes, PIO 8192bytes)
cd0: 346MB (177514 2048 byte sectors)
mountroot: waiting for device /dev/iso9660/13_0_RELEASE_AMD64_BO...
Starting file system checks:
Mounting local filesystems:.
random: unblocking device.
mkdir: /tmp/.diskless.da89c4b3b9df5c6a48101d571217c2d755493fb7e18127d5fa554a2a90461335: Read-only file system
/etc/rc: WARNING: $hostname is not set -- see rc.conf(5).
Setting up harvesting: VMGENID,PURE_RDRAND,[UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,[NET_ETHER],NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
Feeding entropy: dd: /entropy: Read-only file system
dd: /boot/entropy: Read-only file system
.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
32-bit compatibility ldconfig path:
lo0: link state changed to UP
Starting Network: lo0 vtnet0.

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: flags=8822<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
    ether 00:a0:98:5f:06:1a
    media: Ethernet autoselect (10Gbase-T <full-duplex>)
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
Starting devd.
Starting Network: vtnet0.

vtnet0: flags=8822<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
    ether 00:a0:98:5f:06:1a
    media: Ethernet autoselect (10Gbase-T <full-duplex>)

Code:
FreeBSD Installer
 ──────────────────────────────────────────────────────────────────────────────






                      ┌────────────Welcome──────────────┐
                      │ Welcome to FreeBSD! Would you   │
                      │ like to begin an installation   │
                      │ or use the live CD?             │
                      ├─────────────────────────────────┤
                      │ <Install> < Shell > <Live CD>   │
                      └─────────────────────────────────┘








Mounting late filesystems:.
Starting cron.
Starting background file system checks in 60 seconds.

Wed Aug 18 14:22:40 UTC 2021

FreeBSD/amd64 (Amnesiac) (ttyu0)

login: root
Aug 18 14:22:44  login[665]: ROOT LOGIN (root) ON ttyu0
FreeBSD 13.0-RELEASE (GENERIC) #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories:   https://www.FreeBSD.org/security/
FreeBSD Handbook:      https://www.FreeBSD.org/handbook/
FreeBSD FAQ:           https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums:        https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with:  pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed:  freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages:  man man
FreeBSD directory layout:      man hier

To change this login announcement, see motd(5).
root@:~ # ifconfig

vtnet0: flags=8822<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
        ether 00:a0:98:5f:06:1a
        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>

root@:~ # ping google.it
ping: Unknown host
root@:~ # dhclient vtnet0

DHCPDISCOVER on vtnet0 to 255.255.255.255 port 67 interval 8
DHCPOFFER from 192.168.1.1
DHCPREQUEST on vtnet0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.2 -- renewal in 10800 seconds.

root@:~ # ifconfig

vtnet0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
        ether 00:a0:98:5f:06:1a
        inet 192.168.1.2 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>

root@:~ # ping google.it

PING google.it (142.250.184.35): 56 data bytes
64 bytes from 142.250.184.35: icmp_seq=0 ttl=115 time=19.123 ms
64 bytes from 142.250.184.35: icmp_seq=1 ttl=115 time=18.477 ms
^C
--- google.it ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 18.477/18.800/19.123/0.323 ms
 
vm-bhyve create the tap interfaces for you and also bring them up. Don't mix it with traditional bhyve script for starting the VM. You need to choose to use either of them not both.
Now try the same thing but stop vm-bhyve from loading and create the manual bridge0 as it's described in the handbook. Also when you are creating the tap0 interface you don't have to bring it up as it's getting up when the virtual machine is loaded when you have net.link.tap.up_on_open=1
 
vm-bhyve create the tap interfaces for you and also bring them up. Don't mix it with traditional bhyve script for starting the VM. You need to choose to use either of them not both.
Now try the same thing but stop vm-bhyve from loading and create the manual bridge0 as it's described in the handbook. Also when you are creating the tap0 interface you don't have to bring it up as it's getting up when the virtual machine is loaded when you have net.link.tap.up_on_open=1

Yesterday I've re-installed Freebsd on a different partition and this time I haven't installed vm-bhyve. I've configured the bridging using this guide : https://wiki.freebsd.org/bhyve/UEFI ; but I've got the same error inside the ubuntu vm. So,I can assure you that to do this :

Code:
ifconfig tap0 create up
ifconfig vm-public addm tap0

brings the same result as to do this :

Code:
ifconfig tap0 create up
ifconfig bridge0 create up
ifconfig bridge0 addm em0
ifconfig bridge0 addm tap0

the problem is somewhere else. So,according with your suggestion,I could reboot and try to do :

Code:
ifconfig tap0 create
ifconfig vm-public addm tap0

Honestly I think that it will not work,since on the handbook,they say to do : ifconfig tap0 create up,you can read by yourself here : https://wiki.freebsd.org/bhyve/UEFI ; it seems that u are suggesting a minor change. what do u think ?
 

Where in the handbook you see vm-public ? It's a "desc" name create from a vm-bhyve script during the create of the bridge.
Anyway your FreeBSD guest VM get the DHCP address and it's able to ping google.it so it's working. Now you can try the same thing with linux distro.
 
I'm telling that mixing the brigde don't fix the problem,because I've already tried to follow carefully the instructions on the handbook on a fresh installation of FreeBSD and I got the same result. Can u suggest to me which command should I issue inside the ubuntu vm ? because I tried several times to use only a DHCP server and I did : dhcp enp0s5 to get the IP number,but nothing happens. It freezes. Maybe I give the wrong commands.
 
I've attached some screens to show you what happens.
 

Attachments

  • Screenshot_20210818_162919.png
    Screenshot_20210818_162919.png
    548.7 KB · Views: 87
  • Screenshot_20210818_162932.png
    Screenshot_20210818_162932.png
    643 KB · Views: 81
  • Screenshot_20210818_163012.png
    Screenshot_20210818_163012.png
    642.7 KB · Views: 76
Please don't post pictures of text, just copy/paste the information.
Posting pictures instead of text is wasting bandwidth, hides important information behind useless information and is just unprofessional. I told you before, but you keep on posting pictures. Maybe you will listen to an Admin. Please stop it.
 
Posting pictures instead of text is wasting bandwidth, hides important information behind useless information and is just unprofessional. I told you before, but you keep on posting pictures. Maybe you will listen to an Admin. Please stop it.

I know,but unfortunately I can't post text from within the ubuntu vm,because Im not connected to internet and the copy and paste don't work. I should copy everything by hand from the VM outside the VM ? I don't think so. I don't have time or will. No one has the time to do something like that. You don't seem very understanding. If you go to see my old posts, where I could, I always wrote messages using text. My reasons sound to you acceptable ?
 
I can't post text from within the ubuntu vm,because Im not connected to internet and the copy and paste don't work.
Ok, if the clipboard does not work you've got a point. But - speaking of me - i don't want to click images and search for a line of text in a 1920×1080 image.

Maybe get copy n paste working first?
 
Back
Top