Thursday, October 29, 2009

VLAN tagging in Debian GNU/Linux

$ sudo apt-get install vlan

edit /etc/network/interfaces:

auto vlan150
iface vlan150 inet static
address 172.0.0.150
netmask 255.255.255.0
vlan_raw_device eth0

As root, bring the interface up:
# ifup vlan150

You can also use vconfig and ifconfig:

# vconfig add eth0 150
Added VLAN with VID == 150 to IF -:eth0:-
# ifconfig eth0.150

Now you could try tcpdumping on it for example:

# tcpdump -i eth0 vlan 150

1 comment:

  1. You can also configure entry in /etc/network/interfaces like this:

    auto eth0.150
    iface eth0.150 inet static
    address 172.0.0.150
    network 255.255.255.0

    And the 'vlan' package will do the right thing - this method is easier for some people to parse and you get the same result.

    # tcpdump -i eth0.150

    ReplyDelete