VLAN Configuration

description

To add a VLAN name or a description for the VLAN use the description command in the VLAN configuration mode.

description string

Syntax Description

string

Specifies a name or a description for the VLAN. The range is 1-32 characters.

Command Default

None

Command Modes

VLAN Configuration

Examples

Device(config)# vlan 11
Device(config-if-vlan)# switchport ethernet 1/3
Device(config-if-vlan)# description "vlan1"

ingress acceptable-frame

To configure the type of frames or VLAN packtes that are acceptable on the port, use the ingress acceptable-frame command in the Interface configuration mode.

ingress acceptable-frame { all| tagged}

Syntax Description

all

Allows the port to receive tagged and untagged VLAN

tagged

Allows the port to receive only tagged VLAN packets.

Command Default

None

Command Modes

Interface configuration

Examples

This example shows how to configure the ingress acceptable-frame command:

Device(config)#interface ethernet 1/1 
Device(config-if-ethernet-1/1)#ingress acceptable-frame tagged 
Config acceptable-frame type successfully!

ingress filtering

To enable the forwarding of VLAN packets at the ingress of an interface, use the igress filtering command in the Interface configuration mode. To disable ingress filtering use the no form of the command.

ingress filtering

no ingress filtering

Syntax Description

ingress filtering

enables ingress filtering of VLAN packets.

Command Default

Ingress filtering is enabled by default

Command Modes

Interface configuration mode

Examples

This example shows how to disable ingress filtering for a port:

Device(config)# interface ethernet 1/4
Device(config-if-ethernet-1/4)# no ingress filtering

interface ethernet

To enter interface configuration mode for an Ethernet IEEE 802.3 interface, use the interface ethernet command in the global configuration mode.

interface ethernet port-number

Syntax Description

port-number

Specifies the port number within a particular slot.

Command Default

None

Command Modes

Global configuration mode

Examples

The following example shows how to enter interface configuration mode.

Device(config)# interface ethernet1/4

priority

To assign a priority value to a port use the priority command in the interface configuration mode. To restore the port priority to the default value use the no form of the command.

priority port-priority

no priority

Syntax Description

port-priority

Assigns a priority value to the port. The value can range from 0-7.

Command Default

None

Command Modes

Interface configuration mode

Examples

The following example shows how to configure the priority value of a port.

Device(config)# interface ethernet1/4
Device(config-if-ethernet-1/4)# priority 2

show ingress interface

To display the status of filtering on the ingress port use the show ingress interface command in the privileged EXEC mode or global configuration mode.

show ingress interface { ethernet port-number| gpon port-number}

Syntax Description

ethernet

Displays information about ethernet port.

gpon

Displays information about gpon port

Command Modes

Privileged EXEC
Global configuration (config)

Examples

The following is sample output for the show ingress interface command.

Device(config)#show ingress interface ethernet 1/4
Port     Filtering  Acceptable-frame
e1/4     enable     all
Total entries: 1 

show interface brief ethernet

To display the configurations of a port in brief use the show interface brief ethernet command in the priveleged EXEC mode.

show interface brief ethernet port-number

Syntax Description

port-number

Specifies the port for which the configurations will be displayed.

Command Default

None

Command Modes

Priviledged EXEC

Examples

This example shows the sample output for the show interface brief ethernet command:

Device# show interface brief ethernet 1/4
Port    Desc   Link shutdn Speed         Pri PVID Mode TagVlan    UtVlan
e1/4           down false  auto          2   1    acc             1
Total entries: 1 .

show interface ethernet

To display the configurations of a port in detail use the show interface ethernet command in the priveleged EXEC mode.

show interface ethernet port-number

Syntax Description

port-number

Specifies the port for which the configurations will be displayed.

Command Default

None

Command Modes

Priviledged EXEC

Examples

The following examples displays the output of the show interface ethernet command for the port etherent 1 / 4 :

Device# show interface ethernet 1/4 
Gigabit Ethernet e1/4 current state: enabled, port link is down
 Hardware address is 00:0a:5a:9b:18:15
 SetSpeed is auto, ActualSpeed is unknown, Duplex mode is unknown
 Current port type: 1000BASE-T
 Priority is 2
 Flow control is disabled
 Broadcast storm control target rate is 49984pps
 PVID is 1
 Port mode: access
 Untagged  VLAN ID: 1
 Input  : 0 packets, 0 bytes
          0 broadcasts, 0 multicasts, 0 unicasts
 Output : 0 packets, 0 bytes
          0 broadcasts, 0 multicasts, 0 unicasts

switchport default vlan

To configure a VLAN as the default VLAN use the swithcport default vlan command in the interface configuration mode. To restore the deafult vlan to port 1 use the no form of the command.

switchport default vlanvlan-id

no switchport default vlan

Syntax Description

vlan-id

Specifies the VLAN id that will be used as the default VLAN.

Command Default

None

Command Modes

Interface configuration mode

Examples

This example shows how to configure a default vlan:

Device(config)# interface ethernet 1/1
Device(config-if-ethernet-1/1)# switchport mode access
Device(config-if-ethernet-1/1)# switchport default vlan 100

switchport ethernet

To add an VLAN interface to a designated port or to all ports use the switchport ethernet command in the VLAN configuration mode.

switchport { ethernet port-number| all}

Syntax Description

all

Specifies that all the ports will be added to the VLAN interface.

port-number

Specifies the port numbers that will be added to the VLAN interface.

Command Default

None

Command Modes

VLAN configuration

Examples

This example shows how to add a VLAN to an ethernet port:

Device(config-if-vlan)# switchport ethernet 1/4

switchport hybrid

To allow the packets from specified VLANs to pass through the hybrid port, use the switchport hybrid command in the interface configuration mode. To prevent the packets from specified VLANs passing through the hybrid port use the no form of the command.

switchport hybrid{ tagged| untagged} vlan{ vlan-list| all}

no switchport hybrid{ tagged| untagged} vlan { vlan-list| all}

Syntax Description

tagged

Specifies the VLAN packets as tagged.

untagged

Specifies the VLAN packets as untagged.

vlan

Specifies the VLANs whose packets will be allowed to pass through the hybrid port.

vlan-list

Specifies a list of VLANs whose packets will be allowed to pass through the hybrid port.

all

Specifies that packets from all VLANs will be allowed to pass through the hybrid port.

Command Default

None

Command Modes

Interface configuration mode

Examples

This example shows how to allow the packets from the specified VLANs to pass through the hybrid port:

Device(config-if-ethernet-1/4)# switchport mode hybrid
Device(config-if-ethernet-1/4)# switchport hybrid tagged 2-4

switchport mode

To configure the VLAN mode for the interface use the switchport mode command in the interface configuration mode. You can set the VLAN mode to access, hybrid or trunk. The mode is set to hybrid by default.

switchport mode { access| hybrid| trunk}

Syntax Description

access

Specifies that the interface is in access mode.

hybrid

Specifies that the interface is in hybrid mode.

trunk

Specifies that the interface is in trunk mode.

Command Default

None

Command Modes

Interface configuration

Examples

This example shows how to configure the VLAN mode to trunk on an interface:

Device(config)# interface ethernet1/4
Device(config-if-ethernet-1/4)# switchport mode trunk

switchport trunk

To allow the packets from specified VLANs to pass through the trunk port, use the switchport trunk command in the interface configuration mode. To prevent the packets from specified VLANs passing through the hybrid port use the no form of the command.

switchport trunk allowed vlan{ vlan-list| all}

no switchport trunk allowed vlan{ vlan-list| all}

Syntax Description

allowed

Configures the VLANs whose packets will be allowed to pass through the trunk port.

vlan

Specifies the VLANs whose packets will be allowed to pass through the trunk port.

vlan-list

Specifies VLAN IDs of the allowed VLANs when the interface is in trunking mode.

all

Specifies all VLANs to be added to the current list.

Command Default

None

Command Modes

Interface configuration

Examples

This example shows how to allow the packets from the specified VLANs to pass through a trunk port:

Device(config-if-ethernet-1/4)# switchport mode trunk
Device(config-if-ethernet-1/4)# switchport trunk allowed vlan 2-4

vlan

To add a VLAN and to enter the VLAN configuration mode, use the vlan command in global configuration mode. To delete the VLAN, use the no form of this command.

vlan vlan list

no vlan vlan list

Syntax Description

vlan list

List of VLAN to be added and configured.The range is 1 to 4094.You can enter a single VLAN ID, a series of VLAN IDs separated by commas, or a range of VLAN IDs separated by hyphens.

Command Default

None

Command Modes

Global Configuration

Examples

This example shows how to create a VLAN and enter the VLAN configuration mode:

Device(config)# vlan 1