2

I'm trying to implement vlans on a target programmatically.

But first I wanted to set up vlans manually to help get a better understanding of vlan setup. So I setup a vlan manually on my development system (ubuntu) using the vconfig/ifconfig command combination, but using the same command combination on the intended target doesn't work.

Both systems use the same 8021q driver so the method of informing the lower level Ethernet driver of the vlan info should be the same (I would think). After looking at the vlan driver source it appears that it collects the vlan info and adds the info the sk_buff structure which is eventually passed to the ethernet driver, but it's not obvious where the vlan magic is suppose to happen (ethernet driver or 8021q driver).

I looked at the source for the target system’s ethernet driver and it supports an ioctl method of setting up a vlan. But this does not seem like the conventional way that Linux sets up a vlan in the ethernet driver.

By what mechanism does the vlan driver (8021q.ko) tell the Ethernet hardware about a vlan?

Is it a special api call to the ethernet driver to set up a vlan in hardware, or should the vlan driver be adding the vlan tags to the packet?

Any info on vlan implementation would also be helpful too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.