1

I am trying to route a Linux machine (Ubuntu 14.04) traffic with VLAN ID 4 tag. It is important that the tagging will be done in the Linux itself and not in a further switch.

I created a new interface eth0.4 using this command

vconfig add eth0 4
ifconfig eth0.4 10.0.0.32 broadcast 10.0.0.0 up

In addition I checked that the 8021q driver is loaded using

lsmod | grep 8021q

I also added to /etc/network/interfaces

auto eth0.4
iface eth0.4 inet static
       address 10.0.0.32
       netmask 255.255.255.0
       vlan-raw-device eth0

When I make a request to the an HTTP website. I don't see anything comes out of the vlan's interface (using ifconfig).

I am wondering how the Linux knows to route the traffic through the vlan's interface? and If it is not, how can I manually configure such route?

Niv Penso
  • 333
  • 3
  • 17

1 Answers1

0
  1. Note that only VLAN aware devices can accept the vlan traffic, else the packets will be dropped. The NIC / Switch should be supporting VLAN (IEEE 802.1q). Check the devices involved in this excercise.

  2. Note some kernel / drivers will need some patch to support VLAN. Check your kernel/network driver.

Another observation is that while assigning ip address to the vlan interface, the "ifconfig eth0.4 10.0.0.32 broadcast 10.0.0.0 up" can be as "ifconfig eth0.4 10.0.0.32 netmask 255.255.255.0 broadcast 10.0.0.0 up". Verify this configuration by using the command "ifconfig eth0.4".

Karthik Balaguru
  • 7,424
  • 7
  • 48
  • 65