3.7. VLAN Classification Commands

3.7.1. vlan classifier activate

Command Purpose

Use this command to apply vlan classifier group to an interface.

To remove it, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

vlan classifier activate GROUP_NUMBER based ( ip | mac | protocol )

no vlan classifier activate

Parameter

Parameter Description

Parameter Value

GROUP_NUMBER

VLAN classifier group id

0-31, only group id 31 can be used for protocol

ip

Based on ip

-

mac

Based on MAC

-

protocol

Based on protocol

-

Command Mode

Interface Configuration

Default

None

Usage

An interface can only be applied by one vlan classifier group.

One vlan classifier group can apply more than one interface.

This command applies vlan classifier group to interface, and the interface can classify packets to different vlan according to the rule in vlan classifier group.

To create the rule, refer to vlan classifier rule command.

To create the group, refer to vlan classifier group command.

Examples

This example shows how to apply vlan classifier group 1 to the interface:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# vlan classifier activate 1 based ip

This example shows how to remove the vlan classifier group 1 from the interface:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no vlan classifier activate

3.7.2. vlan classifier group

Command Purpose

Use this command to add or delete rule to vlan classifier group. Use the no form of this command to delete the group.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

vlan classifier group GROUP_NUMBER ( add | delete ) rule RULE

no vlan classifier group group

Parameter

Parameter Description

Parameter Value

GROUP_NUMBER

VLAN classifier group id

0-31, only group id 31 can be used for protocol

add

Add rule to vlan classifier group

-

delete

Delete rule to vlan classifier group

-

RULE

The id of rule

0-4095

Command Mode

Global Config

Default

None

Usage

To create the rule, refer to vlan classifier rule command.

To apply the vlan classifier group to an interface, refer to vlan classifier activate command.

When add a rule to the group by this command, the rule will be active immediately if the group has been applied to an interface already.

When delete a rule from the group by this command, the rule on this interface will be inactive immediately if the group is still applied to that interface.

The vlan classifier group will be deleted when the last rule on this group is deleted.

Examples

This example shows how to add rule1 to vlan classifier group 1:

Switch# configure terminal
Switch(config)# vlan classifier group 1 add rule 1

This example shows how to delete rule1 from vlan classifier group 1:

Switch# configure terminal
Switch(config)# vlan classifier group 1 delete rule 1

This example shows how to delete vlan classifier group 1:

Switch# configure terminal
Switch(config)# no vlan classifier group 1

Related Commands

vlan classifier activate

vlan classifier rule

3.7.3. vlan classifier rule

Command Purpose

Use this command to create vlan classifier rule.

To remove the vlan classifier rule, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

vlan classifier rule RULE ( ip IP_ADDR | ip IP_ADDR/PREFIX-LENGTH | ipv6 IPV6_ADDR | mac MAC_ADDR | protocol ( arp | ip | mpls | mpls-mcast | pppoe | rarp ) ) vlan VLAN_ID

no vlan classifier rule RULE

Parameter

Parameter Description

Parameter Value

RULE

The id of vlan classifier rule

0-4095

IP_ADDR

The source of ipv4 address in packets

IPv4 address

PREFIX-LENGTH

Prefix length for the ip address.

1-32

IPV6_ADDR

The source of ipv6 address in packets

IPv6 address

MAC_ADDR

The source of mac address in packets

Mac address in HHHH.HHHH.HHHH format

protocol

Specify an ethernet protocol classification

-

arp

Specifiy ARP protocol

-

ip

Specifiy IP protocol

-

mpls

Specifiy MPLS protocol

-

mpls-mcast

Specifiy MPLS multi cast protocol

-

pppoe

Specifiy PPPOE protocol

-

rarp

Specifiy RARP protocol

-

VLAN_ID

The vlan id to be assigned

1-4094

Command Mode

Global Config

Default

None

Usage

The rule will be effective only in inbound on interface.

The vlan id assigned by vlan classifier rule will be appended to the packets which match the rule.

To add this rule to vlan classifier group or apply the group to an interface, refer to vlan classifier group and vlan classifier activate command.

Examples

This example shows how to create rule1 which will classify all ipv4 packets to vlan11:

Switch# configure terminal
Switch(config)# vlan classifier rule 1 protocol ip vlan 11

This example shows how to delete rule1:

Switch# configure terminal
Switch(config)# no vlan classifier rule 1

Related Commands

vlan classifier group

vlan classifier activate

3.7.4. vlan classifier default-action

Command Purpose

Use this command to set action when not hit vlan classifier rule. Use the no form of this command to restore default action.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

vlan classifier default-action drop

no vlan classifier default-action drop

Command Mode

Interface Configuration

Default

None

Usage

When packet input the port which enable vlan classifier and not hit any vlan classifier rule, the packet will be dropped.

Examples

This example shows how to set default action drop:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# vlan classifier default-action drop

This example shows how to set default action not drop:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# no vlan classifier default-action drop

Related Commands

vlan classifier activate

3.7.5. show vlan classifier group

Command Purpose

Use this command to show the information about vlan classifier group.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show vlan classifier group GROUP_ID

Parameter

Parameter Description

Parameter Value

GROUP_ID

VLAN classifier group id

0-31, only group id 31 can be used for protocol

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example shows how to display information about vlan classifier group 1:

Switch# show vlan classifier group 1

Related Commands

show vlan classifier interface

show vlan classifier rule

3.7.6. show vlan classifier interface

Command Purpose

Use this command to show the information about vlan classifier group on interface.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show vlan classifier interface group GROUP_ID

Parameter

Parameter Description

Parameter Value

GROUP_ID

VLAN classifier group id

0-31, only group id 31 can be used for protocol

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example shows how to display information about vlan classifier group 1 on interface:

Switch# show vlan classifier interface group 1

Related Commands

show vlan classifier group

show vlan classifier rule

3.7.7. show vlan classifier rule

Command Purpose

Use this command to show the information about vlan classifier rule.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show vlan classifier rule ( RULE | )

Parameter

Parameter Description

Parameter Value

RULE

The id of vlan classifier rule

0-4095

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example shows how to display information about all the vlan classifier rules:

Switch# show vlan classifier rule

This example shows how to display information about the vlan classifier rule1:

Switch# show vlan classifier rule 1

Related Commands

show vlan classifier group

show vlan classifier interface

3.7.8. show resource vlan-classification

Command Purpose

Use this command to display the resource statistic used by vlan classification rules.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show resource vlan-classification

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

The following is sample output from the show resource vlan-classification command:

Switch# show resource vlan-classification

VLAN-CLASS
Resource                             Used          Capability
=============================================================
MAC Based VLAN Classification    0             512
IPv4 Based VLAN Classification   0             512

Related Commands

None