Renaming VLAN Interfaces in Linux
Figured it out. Simply run the following command
ip link set <current name> name <new name>
So if I had vlan eth0.3 and I wanted to call it eth0v3 I would run the command
ip link set eth0.3 name eth0v3
Related videos on Youtube
rhololkeolke
Updated on September 18, 2022Comments
-
rhololkeolke over 1 year
I need to know how to rename VLAN interfaces. I'm currently running Ubuntu 11.04. I'm running a networking application that takes frames on one interface applies things like delays and errors and then forwards the frames out another interface. The default naming convention which names things
<interface>.<vlan> e.g. eth0.2
will not work for my purposes because the program which parses the configuration script for the networking application doesn't like the decimal in the interface name. I ranvconfig set_name_type VLAN_PLUS_VID
which solves the decimal in the interface name problem, however, I can then no longer assign the same vlan id to multiple interfaces because they have the same name.I know how to change physical interface names using udev rules, but because the vlan's will have the same MAC address and they aren't physical interfaces I can't use those rules to rename the interfaces.
Is there a way to rename any interface in linux, including the virtual ones? Is there a way to specify your own naming convention for config set_name_type option without having to recompile the source of vconfig?