Project

General

Profile

Actions

Bug #3317

open

Network vtnet0 not working on Hetzner cloud

Added by mneumann almost 2 years ago. Updated almost 2 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Category:
Networking
Target version:
Start date:
06/09/2022
Due date:
% Done:

0%

Estimated time:

Description

After running `dhclient vtnet0`, I cannot ping anything except the default gateway (172.31.1.1).

`route show` shows two entries for the default route (172.31.1.1) and
one contains very strange characters:

Screenshot

(See the second line for 172.31.1.1...)


Files

Actions #1

Updated by mneumann almost 2 years ago

  • File deleted (clipboard-202206091708-tazmu.png)
Actions #2

Updated by mneumann almost 2 years ago

I can get `ping` to work when I flush the default route and add it again.

Actions #3

Updated by mneumann almost 2 years ago

ah wait, no, I can't get `ping` to work. when I `route delete 172.31.1.1` and then `route add default 172.31.1.1` I have again two routes and one of them contains the strange characters in the Gateway column.

Actions #4

Updated by tuxillo almost 2 years ago

I wonder if those characters are garbage. Have you tried using kgdb to inspect the kernel structures? I don't know from the top of my head which ones are.
I'm assuing that's a KVM VM (since it's using vtnet)

Actions #5

Updated by mneumann almost 2 years ago

I will try to use `kgdb` at the weekend. Yes, I think it's KVM. The "garbage" changes when I remove the routes and add them again.

Actions #6

Updated by tuxillo almost 2 years ago

Also, is it possible to mount a custom image from the Hetzner Cloud panel? I dont' see an option for that.

Actions #7

Updated by mneumann almost 2 years ago

No, it's not possible to mount a custom ISO image. But I asked the support, and ~30 minutes later, they had the DragonFly (dfly-...) image uploaded and made available!!! Kudos.

Actions #8

Updated by mneumann almost 2 years ago

I have to correct myself. It's possible to mount a custom ISO. You just need to ask the support to do it (the dragonfly ISO is a custom ISO)

Actions #10

Updated by mneumann almost 2 years ago

I also checked the integrity of the ISO image by doing an `dd if=/dev/cd0s0 bs=2k | md5` and it is correct (d41d8...27e; 6.2.1).

Actions #11

Updated by mneumann almost 2 years ago

This error message might be of interest:

rtsock: received more addr bits than sockaddrs.

Actions #12

Updated by mneumann almost 2 years ago

I'd like to setup the routes manually (not via dhclient), but I am strugging with it. This is what I do:

ifconfig vtnet0 inet 192.119.117.156 netmask 255.255.255.255 up
route add -interface 172.31.1.1 vtnet0
route add default 172.31.1.1

But, it's not showing "link#1" in the Gateway field for route 172.31.1.1 (it is initially empty, and later shows the MAC address) as it does when this route is added via `dhclient`.

Not sure what I am doing wrong?

Actions #13

Updated by tuxillo almost 2 years ago

Can you please try this in your rc.conf?

[...]

static_routes="hetzner default" 
route_hetzner="172.31.1.1 -interface vtnet0" 
route_default="default 172.31.1.1" 
ifconfig_vtnet0="inet x.x.x.x netmask 255.255.255.255" 

[...]

Actions #14

Updated by mneumann almost 2 years ago

Hi tuxillo,

1000x thanks!

With your snippet above, it works!
Now I can install things and maybe we can figure out why DHCP does not work properly.

Actions #15

Updated by tuxillo almost 2 years ago

I didn't know DHCP was supposed to work, I'll give it a try and see what's up.

Actions #16

Updated by tuxillo almost 2 years ago

It seems to be related with our dhclient, it's definitely route related becuase if I use the config below in my rc.conf I'll get the bug you're reporting.

ifconfig_vtnet0="DHCP" 

However, if I just use dhcpcd, all seems to work fine, can you please try it?

dhcpcd_enable="YES" 
Actions #17

Updated by mneumann almost 2 years ago

yes,

dhcpcd_enable="YES"

alone works!

Actions #18

Updated by tuxillo almost 2 years ago

Nice!

The question is now, should we find out what's the problem with dhclient? Because it might be uncovering at the very least a route(8) issue.

Actions #19

Updated by mneumann almost 2 years ago

"We" probably should :). I guess DragonFly uses a different "dhclient" than FreeBSD, so diffing is not an option. Is "dhclient" going to be deprecated in DragonFly, or why is there a working alterantive (dhcpcd)?

Actions #20

Updated by mneumann almost 2 years ago

There is `/sbin/dhclient-script` which is invoked with the following env variables set:

I could image that this script is doing something wrong.

The script is calling the following commands:

ifconfig vtnet0 inet 168.119.117.156 netmask 255.255.255.255 broadcast 168.119.117.156
route add 172.31.1.1/32 -iface vtnet0
route add default 172.31.1.1

after afterwards one of the routes shows up scrabled, as in the original bug report.

I tried to enter exactly the same commands as dhclient-script produces, and voila I end up with the same scrabled route entry. So, it's not the fault of `dhclient`!!!

Actions #21

Updated by mneumann almost 2 years ago

Found the bug. So when I change:

route add 172.31.1.1/32 -iface vtnet0

to

route add 172.31.1.1 -iface vtnet0

it works! Might be a parsing problem in `route`.

Actions #22

Updated by tuxillo almost 2 years ago

  • Status changed from New to In Progress
  • Assignee set to tuxillo

mneumann wrote in #note-19:

"We" probably should :). I guess DragonFly uses a different "dhclient" than FreeBSD, so diffing is not an option. Is "dhclient" going to be deprecated in DragonFly, or why is there a working alterantive (dhcpcd)?

Yes, the idea is to permanently switch to dhcpcd and remove dhclient. dhclient comes from OpenBSD by the way.

Actions #23

Updated by mneumann almost 2 years ago

  • Assignee deleted (tuxillo)

debugged it further:

route add 172.31.1.1/32 -iface vtnet0

will result in:

add net 172.31.1.1: gateway vtnet0

while

route add 172.31.1.1 -iface vtnet0

will result in

add host 172.31.1.1: gateway vtnet0

An IP with /32 doesn't really look like a network to me. Maybe something is going havoc in the kernel if a network with /32 is given?

Actions #24

Updated by tuxillo almost 2 years ago

Ok, we will have to check route(8) then, there might be a bug that needs fixing there.

Actions

Also available in: Atom PDF