vlan management with iproute2

Use iproute2 to manage vlan:

# ip link add name eth0.3 link eth0  type vlan id 3
# ip link

To show vlan info you need the -d option.

# ip -d link show eth0.3
# ip l f eth0.3

Names like eth0.3 are a convention. The following works too:

# ip l a name foo3 link eth0  type vlan id 3
# ip -d l s foo3
32: foo3@eth0 [snip]
    vlan protocol 802.1Q id 12

vconfig off-by-one?

Vlan tagging (aka RFC 802.1q) is a Layer2 protocol enabling more VLAN on a single ethernet connection. It works tagging ethernet frames so that each port accepts only the configured frames.

The vlan id is a 12bit value (from 0 to 4095), and usually network devices use the 4095 value (0xFFF) for the management network.
But the following command gave me an error
# vconfig add eth1 4095

And I discovered that – actually – the last valid VLAN ID is 4094. Here’s a brief discussion on the subject