Showing posts with label networking. Show all posts
Showing posts with label networking. Show all posts

Monday, December 7, 2009

linux 802.1q support

In the previous article "vlan tag under vmware/virtualbox", I found that the e1000 network driver cannot insert vlan tag to frames. In this article I want to tell you that I WAS WRONG.

After some experiments, I found that the e1000 driver does insert the vlan tag into the frames. The problem is that the e1000 driver automatically remove vlan tags when receiving incoming frames before I was trying to read the incoming frames by tcpdump.

So, we can now use liunx + 802.1q module to communicate with vlan members.

Sunday, November 15, 2009

vlan tag under vmware/virtualbox

When I was trying to add a vlan tag on my network traffic, I found that the tcpdump can read the correct vlan id information when I was using VMware or Virtualbox, but it failed to read that on my host machine.

After a lot of googling and test, I found that the Intel Pro/1000 driver has a bug that it automically filter the vlan tag. The reason that VMware and Virtualbox worded fine is that they do not have a Intel Pro/1000 NIC (network interface card).

I will keep my work on the virtual machines. To test the vlan feature:

promote> vconfig add eth0 101
add a vlan interface named eth0.101
promote> ifconfig eth0.101 10.0.0.7/24 up
give eth0.101 a ip and active it
promote> ping -I eth0.101 xxx.xxx.xxx.xxx
ping a ip through eth0.101

we can dump the packet via tcpdump
promote> tcpdump -ne -i eth0 -xx

you can see output message like:

12:54:08.887252 00:0c:29:6f:2e:e2 > Broadcast, ethertype 802.1Q (0x8100), length 46: vlan 101, p 0, ethertype ARP, arp who-has 23.24.4.43 tell 10.0.0.7
0x0000: ffff ffff ffff 000c 296f 2ee2 8100 0065
0x0010: 0806 0001 0800 0604 0001 000c 296f 2ee2
0x0020: 0a00 0007 0000 0000 0000 1718 042b

where the rea-marked bits are the valn id.