9

Is there any way how to create vlan interface without using vconfig ? I have only KVM console and trunk port connected to the machine, so I cannot use apt as I do not have internet access. I defined vlans in /etc/network/interfaces but it does not work as vlan interfaces are not created. Thanks.

John
  • 1,493
  • 3
  • 26
  • 46

1 Answers1

11
ip link add link eth0 name eth0.5 type vlan id 5 

do not forget to make link UP:

ip link set eth0 up
ip link set eth0.5 up
John
  • 1,493
  • 3
  • 26
  • 46
  • 1
    Awesome! Just what I was looking for (embedded device; minimal tools). And just for completion: `ip link del eth0.5` to delete the vlan – FractalSpace Apr 27 '16 at 15:20