You are not logged in.

#1 2018-09-21 18:27:35

ezacaria
Member
Registered: 2007-12-10
Posts: 113

VLAN addition on top of a systemd.link

I used systemd.link to rename a network interface via a simple "Match" on MACAddress. But then I cannot create a VLAN on top of it.

For example, if the built-in ethernet card was been renamed to "eth_integrated", I get the following error:

ip link add link eth_integrated name eth_integrated.10 type vlan id 10
Error: argument "eth_integrated.10" is wrong: "name" not a valid ifname

Same thing happens if I build a netctl profile to create the VLAN on that (renamed) interface. And the same error if I rename the card with a udev file.

However, I can create the VLANs without any problems if the card is not renamed.

This seems different than FS#25189, where the VLAN could be created based on a card which was renamed (with a systemd rule). In that bug report, the VLAN was created but subsequently renamed.

Incidentally, I can build a netctl profile to assign an IP address to the renamed card and this works without problems.

Any ideas?

Offline

#2 2018-10-01 16:49:24

ezacaria
Member
Registered: 2007-12-10
Posts: 113

Re: VLAN addition on top of a systemd.link

I am glad to report that I found the problem.

By tracing a debug build of the iptools2 package, I realised that the problem is in the "iplink_parse" function. This is checking that the whole name (including VLAN and dot) has to be smaller than "IFNAMSIZ".

In turn, it appears that this is defined in "/usr/include/linux/if.h". As of writing, this is part of kernel headers 4.17.11-1 and has value 16. I just tried on a virtual machine by shortening "eth_integrated" to "eth_integrat", which makes "eth_integrat.10" 15 chars long and thereafter the VLAN creation succeeds.

I was over the mark for 2 chars tongue

Offline

Board footer

Powered by FluxBB