- 论坛徽章:
- 0
|
(An example of mod/port is 1/1,2/1-12,3/1-2,4/1-12)
set vlan [name ] [type ] [state ]
[pvlan-type ]
[said ] [mtu ] [ring ]
[decring ]
[bridge ] [parent ]
[mode ] [stp ]
[translation ] [backupcrf ]
[aremaxhop ] [stemaxhop ]
[rspan]
(name = 1..32 characters, state = (active, suspend)
type = (ethernet, fddi, fddinet, trcrf, trbrf)
said = 1..4294967294, mtu = 576..18190
pvlan-type = (primary,isolated,community,none)
hex_ring_number = 0x1..0xfff, decimal_ring_number = 1..4095
bridge_number = 0x1..0xf, parent = 2..1005, mode = (srt, srb)
stp = (ieee, IBM, auto), translation = 1..1005
hopcount = 1..13)
Set vlan commands:
----------------------------------------------------------------------------
set vlan Set vlan information
set vlan mapping Map an 802.1q vlan to an Ethernet vlan
CatosSwitch> (enable) set vlan 2 name cisco_vlan_2
Vlan 2 configuration successful
Note: You can verify the VLAN configuration by using the show vlan command, as shown below:
CatosSwitch> (enable) show vlan
VLAN Name Status IfIndex Mod/Ports, Vlans
---- -------------------------------- --------- ------- ------------------------
1 default active 5 1/1-2
3/1-48
4/1-16
2 cisco_vlan_2 active 75
1002 fddi-default active 6
1003 token-ring-default active 9
1004 fddinet-default active 7
1005 trnet-default active 8
VLAN Type SAID MTU Parent RingNo BrdgNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ ------ ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
2 enet 100002 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 trcrf 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - - - 0 0
1005 trbrf 101005 1500 - - - IBM - 0 0
(Output Suppressed...)
Step 4 If you want to add ports to the VLAN, use the set vlan ... command.
CatosSwitch> (enable) set vlan 2 3/1-12
VLAN 2 modified.
VLAN 1 modified.
VLAN Mod/Ports
---- -----------------------
2 3/1-12
15/1
Note: You can also create the VLAN and add the ports to that VLAN with all the information in a single command.
For example, if you want to create the third VLAN and then assign ports 3/13-3/15 to that VLAN, use the following command:
CatosSwitch> (enable) set vlan 3 3/13-15
Vlan 3 configuration successful
VLAN 3 modified.
VLAN 1 modified.
VLAN Mod/Ports
---- -----------------------
3 3/13-15
15/1
Step 5 Verify VLAN configuration by using show vlan command.
CatosSwitch> (enable) show vlan
VLAN Name Status IfIndex Mod/Ports, Vlans
---- -------------------------------- --------- ------- ------------------------
1 default active 5 1/1-2
3/16-48
4/1-16
2 cisco_vlan_2 active 75 3/1-12
3 VLAN0003 active 76 3/13-15
1002 fddi-default active 6
1003 token-ring-default active 9
1004 fddinet-default active 7
1005 trnet-default active 8
VLAN Type SAID MTU Parent RingNo BrdgNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ ------ ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
2 enet 100002 1500 - - - - - 0 0
3 enet 100003 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 trcrf 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - - - 0 0
1005 trbrf 101005 1500 - - - IBM - 0 0
(Output Suppressed...)
To remove ports from a VLAN, use the set vlan ... command and place the ports in a different VLAN. This is essentially what you are doing when you assign a port to any VLAN, because the ports initially belonged to VLAN 1.
To delete the VLAN, use the clear vlan command, but the ports will remain a part of that VLAN and be deactivated because they no longer belong to any VLAN. The switch will display a warning and give you the opportunity to cancel the current request.
CatosSwitch> (enable) clear vlan 3
This command will deactivate all ports on vlan 3
in the entire management domain.
Do you want to continue(y/n) [n]?y
Vlan 3 deleted
CatosSwitch> (enable) show vlan
VLAN Name Status IfIndex Mod/Ports, Vlans
---- -------------------------------- --------- ------- ------------------------
1 default active 5 1/1-2
3/16-48
4/1-16
2 cisco_vlan_2 active 75 3/1-12
1002 fddi-default active 6
1003 token-ring-default active 9
1004 fddinet-default active 7
1005 trnet-default active 8
VLAN Type SAID MTU Parent RingNo BrdgNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ ------ ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
2 enet 100002 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 trcrf 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - - - 0 0
1005 trbrf 101005 1500 - - - IBM - 0 0
(Output Suppressed...)
Note: Ports 3/13-3/15 are not displayed in the above show vlan command, as they are deactivated by the removal of VLAN 3. Unless you add them back in any other VLAN, they will not be displayed. |
|