vlan
vlan - configure the VLAN parameters for a port on a card on a chassis
SYNOPSIS
vlan sub-command options
DESCRIPTION
The vlan command is used to configure the VLAN-specific information used when building 802.1q-type packets. See IEEE 802.1p/q for a complete definition of VLAN tag fields. It is enabled using protocol config -enable802dot1qTag true
STANDARD OPTIONS
cfi
Canonical Format Indicator is a single bit flag value. Options include:
Option |
Value |
Usage |
---|---|---|
resetCFI |
0 |
(default) sets the CFI bit to low |
setCFI |
1 |
sets the CFI bit to high |
maskval
When mode is set to vCtrRandom, this option indicates which bits of the VID counter may vary and which must remain constant. (default = 0000XXXXXXXXXXXX)
mode
Specifies how the vlanID tag is incremented or decremented. Only the top two VLAN elements in a stacked VLAN may used these values. Possible values include:
Option |
Value |
Usage |
---|---|---|
vIdle |
0 |
(default) No change to VlanID tag regardless of repeat |
vIncrement |
1 |
The VlanID tag is incremented by step for repeat number of times. |
vDecrement |
2 |
The VlanID tag is decremented by step for repeat number of times. |
vContIncrement |
3 |
The VlanID tag is continuously incremented by step. |
vContDecrement |
4 |
The VlanID tag is continuously decremented by step. |
vCtrRandom |
5 |
Generate random VlanID tag for each frame |
vNestedIncrement |
100 |
For the second VLAN in a stackedVlan, this may be used to performed nested increment with respect to the first stack element. |
vNestedDecrement |
101 |
For the second VLAN in a stackedVlan, this may be used to performed nested decrement with respect to the first stack element. |
name
Read-only. The name of the VLAN element, which may have been set in IxExplorer.
protocolTagId
The protocol ID field of the VLAN tag.
Option |
Value |
Usage |
---|---|---|
vlanProtocolTag8100 |
0x8100 |
(default) |
vlanProtocolTag9100 |
0x9100 |
|
vlanProtocolTag9200 |
0x9200 |
|
vlanProtocolTag88A8 |
0x88A8 |
|
vlanProtocolTag9300 |
0x9300 |
|
repeat
The number of times the counter is to be repeated with the same value. If the mode option is set to idle then this value is ignored. Note that the repeat value is a 32-bit signed integer. (default = 10)
step
If mode is set to one of the increment or decrement settings, this is the step size between generated values. (default = 1)
userPriority
The user priority field is three bits in length, representing eight priority levels, 0 though 7. The use and interpretation of this field is defined in ISO/IEC 15802-3. (default = 0)
vlanID
The 12-bit VLAN Identifier (VID). (default = 0)
COMMANDS
The vlan command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
vlan cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the vlan command.
vlan config option value
Modify the vlan configuration options of the port. If no option is specified, returns a list describing all of the available vlan options (see STANDARD OPTIONS) for port.
vlan decode capFrame [chasID cardID portID]
Decodes a captured frame in the capture buffer and updates TclHal. vlan cget option command can be used after decoding to get the option data.
vlan get chasID cardID portID
Gets the current UDP configuration of the port with id portID on card cardID, chassis chasID. Call this command before calling vlan cget option to get the value of the configuration option.
vlan set chasID cardID portID
Sets the vlan configuration of the port with id portID on card cardID, chassis chasID by reading the configuration option values set by the vlan config option value command.
vlan setDefault
Sets to IxTclHal default values for all configuration options.
EXAMPLES
package require IxTclHal
set host loopback
# Now connect to the chassis
if {[ixConnectToChassis $host]} {
ixPuts $::ixErrorInfo
return 1
}
# Get the chassis ID to use in port lists
set chas [chassis cget -id]
set card 2
set port 4
set portList [list [list $chas $card $port]]
# Case 1: single VLAN
stream setDefault
protocol setDefault
protocol config -name ipV4
protocol config -ethernetType ethernetII
protocol config -enable802dot1qTag vlanSingle
vlan setDefault
vlan config -vlanID 42
vlan config -mode vIncrement
vlan config -step 4
vlan config -repeat 10
if {[vlan set $chas $card $port]} {
ixPuts $::ixErrorInfo
return 1
}
if {[stream set $chas $card $port 1]} {
ixPuts $::ixErrorInfo
return 1
}
# Case 2: stacked VLAN with three elements
stream setDefault
protocol setDefault
protocol config -name ipV4
protocol config -ethernetType ethernetII
protocol config -enable802dot1qTag vlanStacked
stackedVlan setDefault
# Top (outer) VLAN element
vlan setDefault
vlan config -vlanID 2
vlan config -userPriority 1
vlan config -cfi resetCFI
vlan config -mode vIncrement
vlan config -repeat 10
vlan config -protocolTagId vlanProtocolTag9200
# Top element must be modified by a setVlan
if {[stackedVlan setVlan 1]} {
ixPuts $::ixErrorInfo
return 1
}
# Next (inner) VLAN element
vlan setDefault
vlan config -vlanID 20
vlan config -userPriority 1
vlan config -cfi resetCFI
vlan config -mode vNestedIncrement
vlan config -repeat 100
vlan config -protocolTagId vlanProtocolTag 9200
# Second element must be modified by a setVlan
if {[stackedVlan setVlan 2]} {
ixPuts $::ixErrorInfo
return 1
}
# Third stack element
vlan setDefault
vlan config -vlanID 42
vlan config -userPriority 2
vlan config -cfi resetCFI
vlan config -protocolTagId vlanProtocolTag 9100
# Third element must be added by addValn
if {[stackedVlan addVlan]} {
ixPuts $::ixErrorInfo
return 1
}
if {[stackedVlan set $chas $card $port]} {
ixPuts $::ixErrorInfo
return 1
}
if {[stream set $chas $card $port 2]} {
ixPuts $::ixErrorInfo
return 1
}
ixWriteConfigToHardware portList