SlideShare a Scribd company logo
VLAN ON LINUX / SP
09/2023
IEEE 802.1Q, often referred to as Dot1q, is the networking standard that supports virtual local area networking (VLANs) on an IEEE 802.3 Ethernet
network. The standard defines a system of VLAN tagging for Ethernet frames and the accompanying procedures to be used by bridges and switches in
handling such frames. The standard also contains provisions for a quality-of-service prioritization scheme commonly known as IEEE 802.1p and defines
the Generic Attribute Registration Protocol.
Portions of the network which are VLAN-aware (i.e., IEEE 802.1Q conformant) can include VLAN tags. When a frame enters the VLAN-aware portion of
the network, a tag is added to represent the VLAN membership. Each frame must be distinguishable as being within exactly one VLAN. A frame in the
VLAN-aware portion of the network that does not contain a VLAN tag is assumed to be flowing on the native VLAN.
The standard was developed by IEEE 802.1, a working group of the IEEE 802 standards committee, and continues to be actively revised with notable
amendments including IEEE 802.1ad, IEEE 802.1ak and IEEE 802.1s. The 802.1Q-2014 revision incorporated the IEEE 802.1D-2004 standard.
802.1Q adds a 32-bit field between the source MAC address and the EtherType fields of the original frame. Under 802.1Q, the maximum frame size is
extended from 1,518 bytes to 1,522 bytes.
The minimum frame size remains 64 bytes, but a bridge may extend the minimum size frame from 64 to 68 bytes on transmission.
This allows a tag to be popped without needing additional padding. Two bytes are used for the tag protocol identifier (TPID), the other two bytes for tag
control information (TCI). The TCI field is further divided into PCP, DEI, and VID.
https://en.wikipedia.org/wiki/IEEE_802.1Q
https://www.ieee802.org/1/pages/802.1Q-2014.html
https://www.ietf.org/rfc/rfc2674.txt
How to manage VLAN networks on gnu/linux
HARDWARE
NETWORK CARD
GNU/LINUX KERNEL
NETWORK
STACK
IFNAMES
/etc/network/
interfaces
DPDK
VLAN CONTENT
LIBPCAP
MODULE 802.1Q
PROBE
# Check if the module is loaded
lsmod | grep 8021q
# Else load the module if required
sudo modprobe 8021q
# Create a sub network interface (Eg : eth0.100) using a VLAN ID equal to 100 ; similar to an ip alias
ip link add link eth0 name eth0.100 type vlan id 100
# Enable the network interface
ip link set dev eth0.100 up
HARDWARE
NETWORK CARD
GNU/LINUX KERNEL
NETWORK
STACK
IFNAMES
DPDK
VLAN CONTENT
LIBPCAP
MODULE 802.1Q
PROPOSAL #1 : by streaming from the probe that receive the vlan extracted from the vlan
PROBE
VLAN CONTENT
ffmpeg -i pipe: …
PIPE
same thing with a dpdk probe !
HARDWARE
NETWORK CARD
GNU/LINUX KERNEL
NETWORK
STACK
IFNAMES
VLAN CONTENT
MODULE 802.1Q
CUSTOM DRIVER VLAN
/dev/vlan
Loading with parameters
vlan reader binary ffmpeg -i pipe: …
PIPE
PROPOSAL #2 : using a custom driver
Netfilter Hooks:
Consider using Netfilter hooks to intercept packets before
they are processed by the networking stack. You can use the
NF_INET_PRE_ROUTING hook to capture incoming packets
before routing.
VLAN Tag Handling:
You'll need to handle VLAN tagging and untagging, which
involves adding or removing the VLAN header from
incoming and outgoing packets.
Use functions like vlan_insert_tag() and vlan_kill_tag() to
handle VLAN tags.

More Related Content

PPT
Ethernet protocol
PDF
Ieee 802
PDF
IEEE 802
PPT
Vlan
PDF
Network Monitoring in the age of the Cloud
PPTX
5 IEEE standards
PDF
03 PO_SP2001_E01_0 L2 Technology_VLAN.pdf
PDF
VLAN Trunking Protocol
Ethernet protocol
Ieee 802
IEEE 802
Vlan
Network Monitoring in the age of the Cloud
5 IEEE standards
03 PO_SP2001_E01_0 L2 Technology_VLAN.pdf
VLAN Trunking Protocol

Similar to How to manage VLAN networks on gnu/linux (20)

PPTX
Ethernet technology
PPTX
Virtual Local Area Network
PDF
03 ft48923 en02gla0_general topics_
PPT
Tn 310 vlan-trunking
PDF
Ethernet Frames Explained
PDF
Dot1qtnl
PDF
What is IEEE and why?
PDF
IEEE 802 Standards
PDF
Ccent notes part 1
PPT
Ccna3 mod9-vtp
PPTX
Hardened Ethernet In ITS 2010
PPTX
Final_IoT_Protocol Stack.pptx
PPTX
08 VLAN Prىلتانىنinciples and Configuration.pptx
PPTX
08 VLAN Prىلتانىنinciples and Configuration.pptx
PPT
Ccna3 mod9-vtp
PPTX
Local Area Network – Wired LAN
PDF
Advanced TCP/IP-based Industrial Networking for Engineers & Technicians
PPTX
Ethernet Computer network
ODP
Routing vlans
PDF
OptiQNet-842-DM-v0.4-for-852
Ethernet technology
Virtual Local Area Network
03 ft48923 en02gla0_general topics_
Tn 310 vlan-trunking
Ethernet Frames Explained
Dot1qtnl
What is IEEE and why?
IEEE 802 Standards
Ccent notes part 1
Ccna3 mod9-vtp
Hardened Ethernet In ITS 2010
Final_IoT_Protocol Stack.pptx
08 VLAN Prىلتانىنinciples and Configuration.pptx
08 VLAN Prىلتانىنinciples and Configuration.pptx
Ccna3 mod9-vtp
Local Area Network – Wired LAN
Advanced TCP/IP-based Industrial Networking for Engineers & Technicians
Ethernet Computer network
Routing vlans
OptiQNet-842-DM-v0.4-for-852
Ad

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Approach and Philosophy of On baking technology
PDF
Empathic Computing: Creating Shared Understanding
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
Teaching material agriculture food technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Building Integrated photovoltaic BIPV_UPV.pdf
Network Security Unit 5.pdf for BCA BBA.
Approach and Philosophy of On baking technology
Empathic Computing: Creating Shared Understanding
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
NewMind AI Weekly Chronicles - August'25-Week II
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Programs and apps: productivity, graphics, security and other tools
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Diabetes mellitus diagnosis method based random forest with bat algorithm
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
The Rise and Fall of 3GPP – Time for a Sabbatical?
Ad

How to manage VLAN networks on gnu/linux

  • 1. VLAN ON LINUX / SP 09/2023
  • 2. IEEE 802.1Q, often referred to as Dot1q, is the networking standard that supports virtual local area networking (VLANs) on an IEEE 802.3 Ethernet network. The standard defines a system of VLAN tagging for Ethernet frames and the accompanying procedures to be used by bridges and switches in handling such frames. The standard also contains provisions for a quality-of-service prioritization scheme commonly known as IEEE 802.1p and defines the Generic Attribute Registration Protocol. Portions of the network which are VLAN-aware (i.e., IEEE 802.1Q conformant) can include VLAN tags. When a frame enters the VLAN-aware portion of the network, a tag is added to represent the VLAN membership. Each frame must be distinguishable as being within exactly one VLAN. A frame in the VLAN-aware portion of the network that does not contain a VLAN tag is assumed to be flowing on the native VLAN. The standard was developed by IEEE 802.1, a working group of the IEEE 802 standards committee, and continues to be actively revised with notable amendments including IEEE 802.1ad, IEEE 802.1ak and IEEE 802.1s. The 802.1Q-2014 revision incorporated the IEEE 802.1D-2004 standard. 802.1Q adds a 32-bit field between the source MAC address and the EtherType fields of the original frame. Under 802.1Q, the maximum frame size is extended from 1,518 bytes to 1,522 bytes. The minimum frame size remains 64 bytes, but a bridge may extend the minimum size frame from 64 to 68 bytes on transmission. This allows a tag to be popped without needing additional padding. Two bytes are used for the tag protocol identifier (TPID), the other two bytes for tag control information (TCI). The TCI field is further divided into PCP, DEI, and VID. https://en.wikipedia.org/wiki/IEEE_802.1Q https://www.ieee802.org/1/pages/802.1Q-2014.html https://www.ietf.org/rfc/rfc2674.txt
  • 5. # Check if the module is loaded lsmod | grep 8021q # Else load the module if required sudo modprobe 8021q # Create a sub network interface (Eg : eth0.100) using a VLAN ID equal to 100 ; similar to an ip alias ip link add link eth0 name eth0.100 type vlan id 100 # Enable the network interface ip link set dev eth0.100 up
  • 6. HARDWARE NETWORK CARD GNU/LINUX KERNEL NETWORK STACK IFNAMES DPDK VLAN CONTENT LIBPCAP MODULE 802.1Q PROPOSAL #1 : by streaming from the probe that receive the vlan extracted from the vlan PROBE VLAN CONTENT ffmpeg -i pipe: … PIPE same thing with a dpdk probe !
  • 7. HARDWARE NETWORK CARD GNU/LINUX KERNEL NETWORK STACK IFNAMES VLAN CONTENT MODULE 802.1Q CUSTOM DRIVER VLAN /dev/vlan Loading with parameters vlan reader binary ffmpeg -i pipe: … PIPE PROPOSAL #2 : using a custom driver
  • 8. Netfilter Hooks: Consider using Netfilter hooks to intercept packets before they are processed by the networking stack. You can use the NF_INET_PRE_ROUTING hook to capture incoming packets before routing. VLAN Tag Handling: You'll need to handle VLAN tagging and untagging, which involves adding or removing the VLAN header from incoming and outgoing packets. Use functions like vlan_insert_tag() and vlan_kill_tag() to handle VLAN tags.