On Sun, Jan 25, 2015 at 8:38 AM, Andrew Holway andrew.holway@gmail.com wrote:
On 25 January 2015 at 15:12, Boris Epstein borepstein@gmail.com wrote:
OK... but why does it need to be a trunk port?
Because a trunk port will "trunk" the vlan.
A VLAN is basically a 4 byte "tag" that gets injected into the packet header when the packet enters the VLAN network. When we trunk a VLAN we say to the switch "pass packets on VLAN x but do not strip the tag out".
You can either terminate the VLAN at the switch port (untagged) which will strip out the VLAN tag or you can pass the packet containing the VLAN tag to the computer or other device(tagged/trunk). This device can then pull out the tag. On linux this mechanism is done by an 8021q VLAN interface.
Hope this is useful.
Just to add to that - normally if a host only needs to be on one subnet you would use an access port on the switch to select a single vlan and deliver those packets untagged so the host does not need to care about tags or vlan numbers. And to that end, switches default to treating everything as access ports on native/untagged vlan 0 unless configured otherwise. However, if the host needs interfaces on multiple subnets, you can do it on a single network connection by giving it a trunk connection from the switch and letting it split out the vlan interfaces internally.