Mellanox Switch Port Types in MLNX-OS: Access, Trunk and Hybrid - 夜莺博客

Mellanox Switch Port Types in MLNX-OS: Access, Trunk and Hybrid

Mellanox (now NVIDIA) switches running MLNX-OS / ONYX give you five switchport modes — access, access-DCB, trunk, hybrid and dot1q-tunnel — and each one has precise rules about which frames are tagged and which are dropped. Picking the wrong mode is a classic cause of "link up but no traffic" in RoCE and storage fabrics. This article explains each port type, the configuration commands, and how to verify your choices with show interfaces switchport.

The Five Port Types

  • Access — untagged ingress only; tagged packets are dropped. The PVID is assigned on ingress. Used for switch-to-server links.
  • Access-DCB — like access, but egress frames get a priority tag (VLAN ID 0). Used in lossless DCB fabrics.
  • Trunk — tagged frames only; untagged frames are dropped. Multiple VLANs allowed, no PVID. Used switch-to-switch or when a server carries multiple VLANs.
  • Hybrid — accepts both tagged and untagged frames; PVID applies to untagged ingress.
  • Dot1q-tunnel — Q-in-Q mode for service-provider transparency.

Configuration Examples

switch (config) # vlan 10
switch (config) # vlan 100-200          # range
switch (config) # interface ethernet 1/1
switch (config interface ethernet 1/1 ) # switchport mode access
switch (config interface ethernet 1/1 ) # switchport access vlan 1
switch (config) # interface ethernet 1/1
switch (config interface ethernet 1/1 ) # switchport mode trunk
switch (config interface ethernet 1/1 ) # switchport trunk allowed-vlan all
switch (config interface ethernet 1/1 ) # switchport trunk allowed-vlan 100-200

Note: switchport trunk allowed-vlan all automatically includes VLANs added to the table later — watch out for silent trunk expansion.

Hybrid and PVID

switch (config) # interface ethernet 1/1
switch (config interface ethernet 1/1 ) # switchport mode hybrid
switch (config interface ethernet 1/1 ) # switchport hybrid allowed-vlan 100-200
switch (config interface ethernet 1/1 ) # switchport access vlan 1   # PVID / native VLAN

Verification

switch (config) # show interfaces switchport
Interface  Mode    Access vlan  Allowed vlans
---------------------------------------------
Eth1/1     hybrid  1            100
Eth1/2     hybrid  1            100
Eth1/3     access  1
Eth1/5     trunk   N/A          1, 100
# show vlan
VLAN  Name     Ports
----  -------  --------------------------------
1     default  Eth1/1, Eth1/2, ...
100           Eth1/1, Eth1/5

Related: NVIDIA MLNX-OS CLI 指南 covers MLNX-OS CLI modes, and ONIE 与 ONYX 安装 explains ONYX installation on bare-metal switches.

原文链接:https://enterprise-support.nvidia.com/s/article/howto-configure-switch-port-types-with-mlnx-os