Re: issue with ng_vlan nomatch connected to the bridge
Date: Fri, 29 Apr 2022 09:37:24 UTC
------- Original Message ------- On Friday, April 29th, 2022 at 09:53, Benoit Chesneau <benoitc@enki-multimedia.eu> wrote: >> To quickly test, I created an interface added to the bridge that get its IP from DHCP: The IP is correctly given by the DHCP server, but I can't ping from the same server (the router with the DHCP server) to this device. >> >> ``` >> # ngctl mkpeer public: eiface link2 ether >> # dhclient ngeth1 >> DHCPDISCOVER on ngeth1 to 255.255.255.255 port 67 interval 7 >> DHCPOFFER from 192.168.1.1 >> DHCPREQUEST on ngeth1 to 255.255.255.255 port 67 >> DHCPACK from 192.168.1.1bound to 192.168.1.37 -- renewal in 300 seconds. >> # ifconfig ngeth1 >> ngeth1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 >> options=28<VLAN_MTU,JUMBO_MTU> >> ether 58:9c:fc:10:c6:73 >> inet 192.168.1.60 netmask 0xffffff00 broadcast 192.168.1.255 >> inet 192.168.1.37 netmask 0xffffff00 broadcast 192.168.1.255 >> inet6 fe80::5a9c:fcff:fe10:c673%ngeth1 prefixlen 64 scopeid 0xb >> media: Ethernet autoselect (1000baseT <full-duplex>) >> status: active nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> >> ``` > > correction, I can ping this IP, only link added to the bridge using vm is not pingagble: > > ``` > # ngctl show public: > Name: public Type: bridge ID: 0000000d Num hooks: 3 > Local hook Peer name Peer type Peer ID Peer hook > ---------- --------- --------- ------- --------- > link3 <unnamed> socket 0000001c vmlink > link2 ngeth1 eiface 00000016 ether link0 vlan0 vlan 0000000a nomatch > >> > > ``` > > the vm-bhyve log: > > ``` > Apr 29 09:49:08: [bhyve options: -c 1 -m 2G -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CSM.fd -U ac3dafab-bedb-11ec-b24d-1402ec690a80 -u] > Apr 29 09:49:08: [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/vms/utm/disk0.img -s 5:0,virtio-net,netgraph,path=bgpnet:,peerhook=link3,mac=58:9c:fc:02:3a:be -s 5:1,virtio-net,netgraph,path=public:,peerhook=link3,mac=58:9c:fc:00:6e:5a]Apr 29 09:49:08: [bhyve console: -l com1,stdio]Apr 29 09:49:08: [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/vms/utm/disk0.img -s 5:0,virtio-net,netgraph,path=bgpnet:,peerhook=link3,mac=58:9c:fc:02:3a:be -s 5:1,virtio-net,netgraph,path=public:,peerhook=link3,mac=58:9c:fc:00:6e:5a]Apr 29 09:49:08: [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/vms/utm/disk0.img -s 5:0,virtio-net,netgraph,path=bgpnet:,peerhook=link3,mac=58:9c:fc:02:3a:be -s 5:1,virtio-net,netgraph,path=public:,peerhook=link3,mac=58:9c:fc:00:6e:5a] > ``` Before opening a ticket I can anyone told me if we can create a vlan using a vtnet interface? Using the public bridge attached to nomatch I created an eiface ngeth1 on which I crate a vlan101 and acquire an IP: https://imgur.com/a/HaUPdoJ ``` ifconfig ngeth1.101 create # dhclient ngeth1.101 DHCPDISCOVER on ngeth1.101 to 255.255.255.255 port 67 interval 8 DHCPOFFER from 10.101.1.1 DHCPREQUEST on ngeth1.101 to 255.255.255.255 port 67 DHCPACK from 10.101.1.1bound to 10.101.1.3 -- renewal in 300 seconds. ``` on ngeth1 it works. But when I create simpe freebsd vm using that bridge and then create the same vlan on the interface I don't get an IP from DHCP like I did with ngeth1: ``` root@test:~ # ifconfig vtnet0.101 create root@test:~ # ifconfig vtnet0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE> ether 58:9c:fc:03:34:44 inet 192.168.1.39 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.101: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=80000<LINKSTATE> ether 58:9c:fc:03:34:44 groups: vlan vlan: 101 vlanproto: 802.1q vlanpcp: 0 parent interface: vtnet0 media: Ethernet autoselect (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> root@test:~ # dhclient vtnet0.101 DHCPDISCOVER on vtnet0.101 to 255.255.255.255 port 67 interval 3 DHCPDISCOVER on vtnet0.101 to 255.255.255.255 port 67 interval 5 DHCPDISCOVER on vtnet0.101 to 255.255.255.255 port 67 interval 7 DHCPDISCOVER on vtnet0.101 to 255.255.255.255 port 67 interval 12 DHCPDISCOVER on vtnet0.101 to 255.255.255.255 port 67 interval 15 DHCPDISCOVER on vtnet0.101 to 255.255.255.255 port 67 interval 16 DHCPDISCOVER on vtnet0.101 to 255.255.255.255 port 67 interval 3 No DHCPOFFERS received.No working leases in persistent database - sleeping. ``` Is there any limitation to vtnet/virtio? What could be the issue there ? Is this related to the creation of a socket instead of an interface ? Or maybe an option in bhyve? Options given to bhyve: ``` Apr 29 10:56:04: [bhyve options: -c 1 -m 2G -AHP -U 2041c21c-c799-11ec-9e43-1402ec690a80 -u] Apr 29 10:56:04: [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/vms/test/disk0.img -s 5:0,virtio-net,netgraph,path=public:,peerhook=link4,mac=58:9c:fc:03:34:44] ``` Any idea is welcome :) Benoit This works