I just wanted to learn how VLANs work.That's why thought of setting up on couple of ubuntu machines, which was not working.I think so i have some wrong understandings about VLAN.Please correct me wherever i am wrong.
These are the steps which i followed:
On ubuntu machine 1:
$ sudo modprobe 8021q
$ ifconfig eth0 0.0.0.0 up
$ sudo vconfig add eth0 6
$ sudo ifconfig eth0.6 192.168.0.100 broadcast 192.168.0.255 netmask 255.255.255.0
$ sudo ifconfig eth0 up
On ubuntu machine 2 :
$ sudo modprobe 8021q
$ ifconfig eth0 0.0.0.0 up
$ sudo vconfig add eth0 6
$ sudo ifconfig eth0.6 192.168.0.200 broadcast 192.168.0.255 netmask 255.255.255.0
$ sudo ifconfig eth0 up
Both these machines are connected to my organization's network.I heard that it is not mandatory to configure the switch/router about the ports and VLAN map(information which contains the map of specific ports to specific VLANs).They themselves will learn on the fly.Is that true? I think so my NIC also supports VLAN
After the above set up,I was able to see the interfaces with the corresponding IPs.
The entries in /proc/net/vlan/config is as below:
VLAN Dev name | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD
eth0.6 | 6 | eth0
The entries in /proc/net/vlan/eth0.6
eth0.6 VID: 6 REORDER_HDR: 1 dev->priv_flags: 1
total frames received 0
total bytes received 0
Broadcast/Multicast Rcvd 0
total frames transmitted 232
total bytes transmitted 19220
Device: eth0
INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0
EGRESS priority mappings:
from machine 1:
$ ping 192.168.0.200
It was not working.When i tried with wireshark, i was able to see the ARP packet flow,which failed to find the corresponding MAC address.