Setting up VLANs/trunking on a Debian machine

  1. Install VLAN utilities:
    • apt-get update
    • apt-get install vlan
  2. Edit /etc/network/interfaces and add the line like:
    • auto ethX.Y
    • where X is the physical eth device number and Y is the VLAN number
  3. Add an IP address, netmask, broadcast address, etc. like any other interface, e.g.
    • auto eth0.49
    • iface eth0.49 inet static
    • address
    • netmask
    • broadcast
  4. Bring the interface up:
    • ifup eth0.49
  5. You might get a warning about it being unable to open /proc/net/vlan/config, that's because vconfig tries to access proc before the kernel autoloads the module. Verify that the interface is working properly by doing cat /proc/net/vlan/config after. You should see something like:
    • eth0.49      | 49 | eth0
  6. Instead of ethX.Y, you can also use the format vlan# where # is the vlan number. In this case, a line also must be present in the iface declaration that links the vlan to a device, e.g. vlan_raw_device eth0


  • ifdown [interface] does not remove the vlan from the vlan tables, to remove it do vconfig rem [interface] where interface is the VLAN interface (e.g. eth0.49 or vlan49), not the actual eth device
-- SevernTsui - 06 Apr 2005
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2006-02-08 - IsaacMorland
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback