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?