Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem creating VLAN interface? #15

Open
Dunuin opened this issue Oct 24, 2022 · 4 comments
Open

Problem creating VLAN interface? #15

Dunuin opened this issue Oct 24, 2022 · 4 comments

Comments

@Dunuin
Copy link

Dunuin commented Oct 24, 2022

Hi,

Already used this hook 2 years ago on Proxmox VE server to unlock a LUKS encrypted LVM via tagged vlan and that is still working fine.
Now I'm trying to set up another Proxmox VE 7.2 ( which is based on Debian 11) server that also needs tagged VLAN but this time to unlock the encrypted ZFS root filesystem dataset.

But with this server this just won't work. After manually unlocking the root filesystem by connecting a keyboard+display and Proxmox VE has booted my network is working fine. This is my /etc/network/intefaces:

auto lo
iface lo inet loopback

iface enp3s0 inet manual

auto enp3s0.43
iface enp3s0.43 inet manual

auto vmbr43
iface vmbr43 inet static
        address 192.168.43.40/24
        gateway 192.168.43.1
        bridge-ports enp3s0.43
        bridge-stp off
        bridge-fd 0

When I check the used driver in Proxmox VE it is reporting to use r8169 and the chip is a Realtek RTL8111GR.

My /etc/initramfs-tools/initramfs.conf looks like this:

VLAN="enp3s0:43"
IP=192.168.43.40::192.168.43.1:255.255.255.0:J3710Unlock:enp3s0.43:off:192.168.43.1

The old server, using a Mellanox Connectx-3, and this config works fine:

VLAN="ens5:43"
IP=192.168.43.50::192.168.43.1:255.255.255.0::ens5.43:off

So the new server uses basically the same, just another NIC, a hostname and an additional DNS server IP.

But when I reboot it looks like initramfs is failing to create the VLAN interface:
Second 4 to 5.5:

...
Running /scripts/init-premount ... done.
Mounting root filesystem ... Begin: Waiting up to 180 secs for enp3s0.43 to become available ... Begin: Running /scripts/nfs-top ... done.
Running /scripts/nfs-premount ... done.
Running /scripts/local-top ... Begin: Bringing up enp3s0.43 ... ip: RTNETLINK answers: Operation not supported
Generic FE-GE Realtec PHY r8169-0-300:00: attached PHY driver (mii_bus:phy_addr=r8169-0-300:00, irq=MAC)
r8169 0000:03:00.0 enp3s0: Link Is Down
ip: SIOCGIFFLAGS: No such device
done.
done
...
Begin: Importing ZFS root pool 'rpool' ... Begin: Importing pool 'rpool' using defaults ... done.
done.
Enter passphrase for 'rpool/ROOT':
r8169 0000:03:00.0 enp3s0: Link is Up - 1Gbps/Full - flow control off
IPv6: ADDRCONF(NETDEV_CHANGE): enp3s0: link becomes ready

Then a long time nothing and then 10x:

ipconfig: enp3s0.43: SIOCGIFINDEX: No such device
ipconfig: no devices to configure

And a single:
/scripts/init-premount/dropbear: .: line 329: can't open '/run/net-enp3s0.43.conf' : No such file or directory

When I skip tagged VLAN and use this for the /etc/initramfs-tools/initramfs.conf and set the switch to untagged VLAN 43 everything works fine:

IP=192.168.43.40::192.168.43.1:255.255.255.0:J3710Unlock:enp3s0:off:192.168.43.1

What could be the problem here? Looks like initramfs and Proxmox VE are using the same r8169 driver but somehow initramfs still can't create a vlan interface?

I'm also not sure how to add a driver to initramfs using modprobe. Do I just need to "modprobe r8169" to the /etc/initramfs-tools/initramfs.conf?

@Dunuin
Copy link
Author

Dunuin commented Dec 29, 2022

I installed a new server. Same problem as last time but this time it gets stuck with a endless loop of this after unlocking the root filesystem through the physical console:
dropbear2

Before unlocking the root filesystem it looks like this:
dropbear1

I've added this to the initramfs.conf:

VLAN="ens3:43"
IP=192.168.43.50::192.168.43.1:255.255.255.0:EnterpriseUnlock:ens3.43:off:192.168.43.1

Where ens3 is my ConnectX-3 NIC. Used the same NIC in the old server, where it was called ens5 with this config, and there everything was working fine:

VLAN="ens5:43"
IP=192.168.43.50::192.168.43.1:255.255.255.0::ens5.43:off

What is the best way to recover from this so I can boot my OS and change/disable the config?

@Dunuin
Copy link
Author

Dunuin commented Dec 31, 2022

In case someone also screws up the initramfs and needs to rebuild it to get the linux boot again. You need to boot another linux, chroot into the non-bootlable linux and then rebuild the initramfs. I documented it there: https://forum.proxmox.com/threads/fix-stuck-initramfs.120192/post-522569

Still the question why VLANs are not working and it fails with "RTNETLINK answers: Operation not supported" on both of my servers.

@stcz
Copy link
Owner

stcz commented Jan 15, 2023

Sorry, but because I'm not using the hook anymore and a lack of time, I'm not able to maintain this repo anymore.

Please fork and start developing :)

@williamdes
Copy link

@Dunuin I reported the sleep and cat issue to https://bugs.debian.org/1033802
But until now we did not find an easy way to reproduce the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants