{
    "mode": "man",
    "parameter": "vlan",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/vlan/8/json",
    "generated": "2026-09-10T04:09:21Z",
    "synopsis": "tc ... action vlan { pop | popeth | PUSH | MODIFY | PUSHETH } [ CONTROL ]\nPUSH := push [ protocol VLANPROTO ]  [ priority VLANPRIO ] id VLANID\nMODIFY := modify [ protocol VLANPROTO ]  [ priority VLANPRIO ] id VLANID\nPUSHETH := pusheth dstmac LLADDR srcmac LLADDR\nCONTROL := { reclassify | pipe | drop | continue | pass | goto chain CHAININDEX }",
    "sections": {
        "NAME": {
            "content": "vlan - vlan manipulation module\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "tc ... action vlan { pop | popeth | PUSH | MODIFY | PUSHETH } [ CONTROL ]\n\nPUSH := push [ protocol VLANPROTO ]  [ priority VLANPRIO ] id VLANID\n\nMODIFY := modify [ protocol VLANPROTO ]  [ priority VLANPRIO ] id VLANID\n\nPUSHETH := pusheth dstmac LLADDR srcmac LLADDR\n\nCONTROL := { reclassify | pipe | drop | continue | pass | goto chain CHAININDEX }\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  vlan  action allows one to perform 802.1Q en- or decapsulation on a packet, reflected by\nthe operation modes POP, PUSH and MODIFY.  The POP mode is simple, as no further  information\nis required to just drop the outer-most VLAN encapsulation. The PUSH and MODIFY modes require\nat least a VLANID and allow one to optionally choose the VLANPROTO to use.\n\nThe vlan action can also be used to add or remove the base Ethernet header. The popeth mode,\nwhich  takes no argument, is used to remove the base Ethernet header. All existing VLANs must\nhave been previously dropped. The opposite operation, adding a base Ethernet header, is  done\nwith  the pusheth mode. In that case, the packet must have no MAC header (stacking MAC head‐\ners is not permitted). This mode is mostly useful when a previous action has encapsulated the\nwhole original frame behind a network header and one needs to prepend an Ethernet header  be‐\nfore forwarding the resulting packet.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "pop    Decapsulation mode, no further arguments allowed.\n\npush   Encapsulation mode. Requires at least id option.\n\nmodify Replace mode. Existing 802.1Q tag is replaced. Requires at least id option.\n",
            "subsections": [
                {
                    "name": "pop_eth",
                    "content": "Ethernet  header  decapsulation mode. Only works on a plain Ethernet header: VLANs, if\nany, must be removed first.\n"
                },
                {
                    "name": "push_eth",
                    "content": "Ethernet header encapsulation mode. The Ethertype is automatically set using the  net‐\nwork  header  type.  Chaining Ethernet headers is not allowed: the packet must have no\nMAC header when using this mode. Requires the dstmac and srcmac options.\n\nid VLANID\nSpecify the VLAN ID to encapsulate into.  VLANID is an  unsigned  16bit  integer,  the\nformat  is  detected  automatically (e.g. prefix with '0x' for hexadecimal interpreta‐\ntion, etc.).\n\nprotocol VLANPROTO\nChoose the VLAN protocol to use. At the time  of  writing,  the  kernel  accepts  only\n802.1Q or 802.1ad.\n\npriority VLANPRIO\nChoose the VLAN priority to use. Decimal number in range of 0-7.\n\ndstmac LLADDR\nChoose the destination MAC address to use.\n\nsrcmac LLADDR\nChoose the source MAC address to use.\n\nCONTROL\nHow to continue after executing this action.\n\nreclassify\nRestarts  classification  by  jumping back to the first filter attached to this\naction's parent.\n\npipe   Continue with the next action, this is the default.\n\ndrop   Packet will be dropped without running further actions.\n\ncontinue\nContinue classification with next filter in line.\n\npass   Return to calling qdisc for packet processing.  This  ends  the  classification\nprocess.\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "The  following  example encapsulates incoming ICMP packets on eth0 from 10.0.0.2 into VLAN ID\n123:\n\n#tc qdisc add dev eth0 handle ffff: ingress\n#tc filter add dev eth0 parent ffff: pref 11 protocol ip \\\nu32 match ip protocol 1 0xff flowid 1:1 \\\nmatch ip src 10.0.0.2 flowid 1:1 \\\naction vlan push id 123\n\nHere is an example of the pop function: Incoming VLAN packets on eth0  are  decapsulated  and\nthe classification process then restarted for the plain packet:\n\n#tc qdisc add dev eth0 handle ffff: ingress\n#tc filter add dev $ETH parent ffff: pref 1 protocol 802.1Q \\\nu32 match u32 0 0 flowid 1:1 \\\naction vlan pop reclassify\n\nFor an example of the popeth and pusheth modes, see tc-mpls(8).\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "tc(8), tc-mpls(8)\n\niproute2                                     12 Jan 2015           VLAN manipulation action in tc(8)",
            "subsections": []
        }
    },
    "summary": "vlan - vlan manipulation module",
    "flags": [],
    "examples": [
        "The  following  example encapsulates incoming ICMP packets on eth0 from 10.0.0.2 into VLAN ID",
        "123:",
        "#tc qdisc add dev eth0 handle ffff: ingress",
        "#tc filter add dev eth0 parent ffff: pref 11 protocol ip \\",
        "u32 match ip protocol 1 0xff flowid 1:1 \\",
        "match ip src 10.0.0.2 flowid 1:1 \\",
        "action vlan push id 123",
        "Here is an example of the pop function: Incoming VLAN packets on eth0  are  decapsulated  and",
        "the classification process then restarted for the plain packet:",
        "#tc qdisc add dev eth0 handle ffff: ingress",
        "#tc filter add dev $ETH parent ffff: pref 1 protocol 802.1Q \\",
        "u32 match u32 0 0 flowid 1:1 \\",
        "action vlan pop reclassify",
        "For an example of the popeth and pusheth modes, see tc-mpls(8)."
    ],
    "see_also": [
        {
            "name": "tc",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/tc/8/json"
        },
        {
            "name": "tc-mpls",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/tc-mpls/8/json"
        },
        {
            "name": "tc",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/tc/8/json"
        }
    ]
}