<!--
{
  "availability" : [
    "driverkit: 24.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkingDriverKit",
  "identifier" : "/documentation/NetworkingDriverKit/IOUserNetworkPacket/setVlanTag",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "NetworkingDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserNetworkPacket@F@setVlanTag#s#"
  },
  "title" : "setVlanTag"
}
-->

# setVlanTag

```
void setVlanTag(uint16_t vlanTag);
```

## Parameters

`vlanTag`

to be stored in the packet.

## Discussion

\abstract Set the Vlan Tag for the packet.
\abstract Set the Vlan Tag for the packet, where the driver has enabled
the <code>kFeatureHardwareVlan</code> capability, or the case that feature is
not enabled, this method should not be used.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)