switchport
Supported in the
following platforms:
- Service Platforms —
NX5500, NX7500, NX9500, NX9600, VX9000
switchport [access|mode|trunk]
switchport access vlan [<1-4094>|<VLAN-ALIAS-NAME>]
switchport mode [access|trunk]
switchport trunk [allowed|native]
switchport trunk allowed vlan [<VLAN-ID>|add <VLAN-ID>|none|remove <VLAN-ID>]
switchport trunk native [tagged|vlan [<1-4094>|<VLAN-ALIAS-NAME>]]
Parameters
switchport access vlan [<1-4094>|<VLAN-ALIAS-NAME>]
access vlan [<1-4094>|
<VLAN-ALIAS-NAME>] |
Configures the VLAN to which this port-channel interface is mapped when the switching mode is set to access.
- <1-4094> – Specify the SVI VLAN ID from 1 - 4094.
- <VLAN-ALIAS-NAME> – Specify the VLAN alias name (should be existing and configured).
|
switchport mode [access|trunk]
mode [access|trunk] |
Configures the VLAN switching mode over the port channel
- access – If selected, the port channel accepts packets only form the native VLANs. Frames are forwarded out the port untagged with no 802.1Q header. All frames received on the port are expected as untagged and are mapped to the native VLAN. This is the default setting.
- trunk – If selected, the port channel allows packets from a list of VLANs you add to the trunk. A port channel configured as Trunk supports multiple 802.1Q tagged VLANs and one Native VLAN which can be tagged or untagged.
|
switchport trunk allowed vlan [<VLAN-ID>|add <VLAN-ID>|none|remove <VLAN-ID>]
trunk allowed |
If configuring the VLAN switching mode as trunk, use this option to configure the VLANs allowed on this port channel. Add VLANs that exclusively send packets over the port channel. |
vlan [<VLAN-ID>| add <VLAN-ID>|
none| remove <VLAN-ID> |
Use this keyword to add/remove the allowed
VLANs
- <VLAN-ID> – Allows a group of VLAN IDs.
Specify the VLAN IDs, can be either a range
(55-60) or a comma-separated list (35, 41,
etc.)
- none –
Allows no VLANs to transmit or receive through the
layer 2 interface
- add
<VLAN-ID> – Adds VLANs to the current
list
- <VLAN-ID> – Specify the VLAN IDs. Can
be either a range of VLAN (55-60) or a list
of comma separated IDs (35, 41, etc.)
- remove
<VLAN-ID> – Removes VLANs from the current
list
- <VLAN-ID> – Specify the VLAN IDs. Can
be either a range of VLAN (55-60) or a list
of comma separated IDs (35, 41, etc.)
Allowed VLANs are configured only when the switching
mode is set to “trunk”.
|
switchport trunk native [tagged|vlan [<1-4094>|<VLAN-ALIAS-NAME>]]
trunk |
If configuring the VLAN switching mode as trunk, use this option to configure the native VLAN on this port channel. |
native [tagged| vlan [<1-4094>|
<VLAN-ALIAS-NAME>]] |
Configures the native VLAN ID for the trunk-mode port The native VLAN allows an Ethernet device to associate untagged frames to a VLAN when no 802.1Q frame is included in the frame. Additionally, the native VLAN is the VLAN untagged traffic is directed over when using a port in trunk mode.
- tagged – Tags the native VLAN. When a frame is tagged, the 12 bit frame VLAN ID is added to the 802.1Q header enabling upstream Ethernet devices to know which VLAN ID the frame belongs to. The device reads the 12 bit VLAN ID and forwards the frame to the appropriate VLAN. When a frame is received with no 802.1Q header, the upstream device classifies the frame using the default or native VLAN assigned to the Trunk port. A native VLAN allows an Ethernet device to associate untagged frames to a VLAN when no 802.1Q frame is included in the frame.
- vlan [<1-4094>|<VLAN-ALIAS-NAME>] – Sets the native VLAN for classifying untagged traffic when the interface is in trunking mode.
- <1-4094> – Specify a value from 1 - 4094.
- <VLAN-ALIAS-NAME> – Specify the VLAN alias name used to identify the VLANs. The VLAN alias should be existing and configured.
|
Example
nx9500-6C8809(config-profile-testNX9000-if-port-channel1)#switchport mode trunk
nx9500-6C8809(config-profile-testNX9000-if-port-channel1)#show context
interface port-channel1
description "This port-channel is for enabling dynamic LACP."
speed 100
duplex full
switchport mode trunk
switchport trunk native vlan 1
no switchport trunk native tagged
switchport trunk allowed vlan 1
ipv6 nd trust
ipv6 nd header-mismatch-validation
spanning-tree portfast
spanning-tree bpduguard enable
spanning-tree bpdufilter enable
spanning-tree mst 1 port-priority 1
spanning-tree mst 1 cost 20000
ip arp trust
port-channel load-balance src-dst-mac
nx9500-6C8809(config-profile-testNX9000-if-port-channel1)#
Related Commands
no |
Removes the packet switching parameters configured on this port-channel interface |