Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 May 2022 11:10:29 -0500
From:      Mike Karels <mike@karels.net>
To:        Benoit Chesneau <benoitc@enki-multimedia.eu>
Cc:        freebsd-net@FreeBSD.org, Mario Marietto <marietto2008@gmail.com>
Subject:   Re: tap0 don't receive anything in a vm
Message-ID:  <600615F2-5F92-46B4-8265-9E9C65D2A2CE@karels.net>
In-Reply-To: <dgDIaT5VNKKVp158NoQTBIiqppbL-reaQt3i3Aa7CCVW5G6jgiKNHCERh636tU-aRnYxh92ex49P0Bie6pRSOq807WIOefk6wL4sZrRz0dk=@enki-multimedia.eu>
References:  <kp7ZKmZfegE1lJU7OybWGBgBN5Oo8FkJNM25vZBEzM6hrU0km9iRKIwICKlo6Wt5e29pACahMKGWCX2fuGHTNDDZ7U3gnn6fGeZRX-12zuE=@enki-multimedia.eu> <CA%2B1FSih1KjvgG=kfdthYv3mFjXE0iz6Z=8C%2Bs=Bb0cVmyeJ3jA@mail.gmail.com> <dgDIaT5VNKKVp158NoQTBIiqppbL-reaQt3i3Aa7CCVW5G6jgiKNHCERh636tU-aRnYxh92ex49P0Bie6pRSOq807WIOefk6wL4sZrRz0dk=@enki-multimedia.eu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 15 May 2022, at 10:53, Benoit Chesneau wrote:

> Thanks but I have already set them to 1. This is kind of unexpected :/
>
> ```
> # sysctl net.inet.ip.forwarding
> net.inet.ip.forwarding: 1
> # sysctl net.link.tap.up_on_opennet.link.tap.up_on_open: 1
> ```
>
> in the vm, pinging the IP hosts are OK:
> ```
> # ifconfig vtnet0
> vtnet0: flags=3D8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> me=
tric 0 mtu 1500
> options=3D80028<VLAN_MTU,JUMBO_MTU,LINKSTATE>
> ether 58:9c:fc:02:83:8a
> hwaddr 58:9c:fc:02:83:8a
> inet 10.1.0.2 netmask 0xffffff00 broadcast 10.1.0.255
> inet6 fe80::5a9c:fcff:fe02:838a%vtnet0 prefixlen 64 scopeid 0x1
> inet6 2a0e:e701:110b:102::3 prefixlen 64
> nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL>
> media: Ethernet 10Gbase-T <full-duplex> status: active
>
> # ping 10.1.0.1
> PING 10.1.0.1 (10.1.0.1): 56 data bytes
> 64 bytes from 10.1.0.1: icmp_seq=3D0 ttl=3D64 time=3D0.192 ms
> 64 bytes from 10.1.0.1: icmp_seq=3D1 ttl=3D64 time=3D0.223 ms
> ^C
> --- 10.1.0.1 ping statistics ---
> 2 packets transmitted, 2 packets received, 0.0% packet loss
> round-trip min/avg/max/stddev =3D 0.192/0.208/0.223/0.015 ms
> # ping 10.2.0.11
> PING 10.2.0.11 (10.2.0.11): 56 data bytes
> 64 bytes from 10.2.0.11: icmp_seq=3D0 ttl=3D64 time=3D0.204 ms64 bytes =
from 10.2.0.11: icmp_seq=3D1 ttl=3D64 time=3D0.193 ms
>
> ```
>
> But pinging the default gateway of the host doesn't work
>
> ```
> ping -t5 10.2.0.1
> PING 10.2.0.1 (10.2.0.1): 56 data bytes
>
> --- 10.2.0.1 ping statistics ---5 packets transmitted, 0 packets receiv=
ed, 100.0% packet loss
> ```
>
> When I do a tcpdump on the tap0 interface on the Host I get the followi=
ng result:
>
> ```
> # tcpdump -i tap0
> tcpdump: verbose output suppressed, use -v or -vv for full protocol dec=
ode
> listening on tap0, link-type EN10MB (Ethernet), capture size 262144 byt=
es
> 17:35:21.210796 IP 10.1.0.2.6065 > vm91.jn-hebergement.com.https: Flags=
 [S], seq 3549455562, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS=
 val 2252684480 ecr 0], length 0
> 17:35:23.347332 IP 10.1.0.2 > 10.2.0.1: ICMP echo request, id 5721, seq=
 0, length 64
> 17:35:24.348907 IP 10.1.0.2 > 10.2.0.1: ICMP echo request, id 5721, seq=
 1, length 64
> 17:35:24.410733 IP 10.1.0.2.6065 > vm91.jn-hebergement.com.https: Flags=
 [S], seq 3549455562, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS=
 val 2252687680 ecr 0], length 0
> 17:35:25.350038 IP 10.1.0.2 > 10.2.0.1: ICMP echo request, id 5721, seq=
 2, length 64
> 17:35:26.351187 IP 10.1.0.2 > 10.2.0.1: ICMP echo request, id 5721, seq=
 3, length 64
> 17:35:27.352990 IP 10.1.0.2 > 10.2.0.1: ICMP echo request, id 5721, seq=
 4, length 64
> 17:35:27.611391 IP 10.1.0.2.6065 > vm91.jn-hebergement.com.https: Flags=
 [S], seq 3549455562, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS=
 val 2252690881 ecr 0], length 0
> 17:35:30.811451 IP 10.1.0.2.6065 > vm91.jn-hebergement.com.https: Flags=
 [S], seq 3549455562, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS=
 val 2252694080 ecr 0], length 0
> 17:35:30.998410 IP 10.1.0.2.1040 > 149.202.36.10.https: Flags [S], seq =
496616510, win 65535, options [mss 1460,nop,wscale 6,sackOK,TS val 105406=
1401 ecr 0], length 0
> ^C
> 10 packets captured
> 10 packets received by filter0 packets dropped by kernel
> ```
>
> Any idea what's going on ? could it be related to th bhyve options set =
by vm-bhyve starting a console ?
>
> ```
> May 15 17:55:25: [bhyve options: -c 1 -m 2G -Hwl bootrom,/usr/local/sha=
re/uefi-firmware/BHYVE_UEFI_CSM.fd -U ac3dafab-bedb-11ec-b24d-1402ec690a8=
0 -u]
> May 15 17:55:25: [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virti=
o-blk,/vms/utm/disk0.img -s 5:0,virtio-net,tap0,mac=3D58:9c:fc:07:c0:67 -=
s 5:1,virtio-net,tap2,mac=3D58:9c:fc:06:05:0c]
> ```
>
> Any suggestion is welcome,

Does 10.2.0.1 have a route back to the guest?

		Mike

> ------- Original Message -------
> On Sunday, May 15th, 2022 at 14:47, Mario Marietto <marietto2008@gmail.=
com> wrote:
>
>> /etc/sysctl.conf :
>>
>> net.link.tap.up_on_open=3D1
>> net.inet.ip.forwarding=3D1
>>
>> Il giorno dom 15 mag 2022 alle ore 14:33 Benoit Chesneau <benoitc@enki=
-multimedia.eu> ha scritto:
>>
>>> My goal is to setup a p2p connection between the host and a guest vm =
and use the host as the nethop for the vm. I'm uskng bhyve for this setup=
:
>>>
>>> 1. on the host i create a tap tap0 interface and assign to it the IP =
10.1.0,1
>>> 2. i create and start the vm using vm-bhyve.
>>> 3. in the vm I set the vtnet0 interface to 10.1.0.2 and set the defau=
lt router to 10.1.0.1.
>>>
>>> i can ping the host but nothing up. When i run tcpdump on the host fo=
r this interface i can see the ping reply coming but it doesn't go to the=
 guest. Any idea what's wrong? could it be related to the setup of the co=
nsole port in bhyve? -l com1,stdio .
>>>
>>> Thoughts?
>>>
>>> Beno=C3=AEt
>>
>> --
>>
>> Mario.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?600615F2-5F92-46B4-8265-9E9C65D2A2CE>