交换机专题2

王朝other·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

Configuring the VLAN on Catalyst 2900/3500 XL, 2950, and 3550 Series Switches

Step 1 Before you create VLANs, you must decide whether to useVTP in your network. Using VTP, you can make configuration changes centrally on a single switch, and have those changes automatically communicated to all the other switches in the network. The default VTP mode on the switches mentioned in this section is the server mode.

For details on VTP, refer to Understanding and Configuring VLAN Trunk Protocol

You can check the VTP status on the XL Series Switches, by using the show vtp status command.

3524XL#show vtp status

VTP Version : 2

Configuration Revision : 0

Maximum VLANs supported locally : 254

Number of existing VLANs : 5

VTP Operating Mode : Server!-- This is the default mode

VTP Domain Name :

VTP Pruning Mode : Disabled

VTP V2 Mode : Disabled

VTP Traps Generation : Disabled

MD5 digest : 0xBF 0x86 0x94 0x45 0xFC 0xDF 0xB5 0x70

Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00

Step 2 By default, there is only a single VLAN for all ports, and this VLAN is called the default. VLAN1 cannot be renamed or deleted. You can run show vlan command to check the VLAN information.

3524XL#show vlan

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4,

Fa0/5, Fa0/6, Fa0/7, Fa0/8,

Fa0/9, Fa0/10, Fa0/11, Fa0/12,

Fa0/13, Fa0/14, Fa0/15, Fa0/16,

Fa0/17, Fa0/18, Fa0/19, Fa0/20,

Fa0/21, Fa0/22, Fa0/23, Fa0/24,

Gi0/1, Gi0/2

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1 enet 100001 1500 - - - - - 1002 1003

1002 fddi 101002 1500 - - - - - 1 1003

1003 tr 101003 1500 1005 0 - - srb 1 1002

1004 fdnet 101004 1500 - - 1 IBM - 0 0

1005 trnet 101005 1500 - - 1 IBM - 0 0

3524XL#

Use the following set of commands in the privileged mode to create another VLAN:

3524XL#vlan database!-- You have to enter into vlan database, to configure any VLAN

3524XL(vlan)#vtp server

Device mode already VTP SERVER.

!-- You may skip the above command, if the switch is already in server mode,

and you want the switch to be in server mode

Note: A switch is only allowed to create VLANs if it is in VTP server or VTP transparent modes. For details on VTP, please refer to the Understanding and Configuring VLAN Trunk Protocol (VTP) document.

3524XL(vlan)#vlan ?

ISL VLAN index

3524XL(vlan)#vlan 2 ?

are Maximum number of All Route Explorer hops for this VLAN

backupcrf Backup CRF mode of the VLAN

bridge Bridging characteristics of the VLAN

media Media type of the VLAN

mtu VLAN Maximum Transmission Unit

name Ascii name of the VLAN

parent ID number of the Parent VLAN of FDDI or Token Ring type VLANs

ring Ring number of FDDI or Token Ring type VLANs

said IEEE 802.10 SAID

state Operational state of the VLAN

ste Maximum number of Spanning Tree Explorer hops for this VLAN

stp Spanning tree characteristics of the VLAN

tb-vlan1 ID number of the first translational VLAN for this VLAN (or zero

if none)

tb-vlan2 ID number of the second translational VLAN for this VLAN (or zero

if none)

3524XL(vlan)#vlan 2 name ?

WORD The ASCII name for the VLAN

3524XL(vlan)#vlan 2 name cisco_vlan_2

VLAN 2 added:

Name: cisco_vlan_2

3524XL(vlan)#exit!-- You have to exit from the VLAN database, for the changes to be committed

APPLY completed.

Exiting....

3524XL#

Step 3 Make sure that the VLAN is created by running the show vlan command.

3524XL#show vlan

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4,

Fa0/5, Fa0/6, Fa0/7, Fa0/8,

Fa0/9, Fa0/10, Fa0/11, Fa0/12,

Fa0/13, Fa0/14, Fa0/15, Fa0/16,

Fa0/17, Fa0/18, Fa0/19, Fa0/20,

Fa0/21, Fa0/22, Fa0/23, Fa0/24,

Gi0/1, Gi0/2

2 cisco_vlan_2 active

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1 enet 100001 1500 - - - - - 1002 1003

2 enet 100002 1500 - - - - - 0 0

1002 fddi 101002 1500 - - - - - 1 1003

1003 tr 101003 1500 1005 0 - - srb 1 1002

1004 fdnet 101004 1500 - - 1 IBM - 0 0

1005 trnet 101005 1500 - - 1 IBM - 0 0

Step 4 You may want to add the ports (interfaces) in the newly created VLAN. You have to go to interface configuration mode for each of the interfaces that you want to add into the new VLAN. Use the following set of commands in the privileged mode to add a particular interface in the VLAN.

3524XL#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

3524XL(config)#interface fastEthernet 0/2

3524XL(config-if)#switchport access ?

vlan Set VLAN when interface is in access mode

3524XL(config-if)#switchport access vlan ?

VLAN ID of the VLAN when this port is in access mode

dynamic When in access mode, this interfaces VLAN is controlled by VMPS

3524XL(config-if)#switchport access vlan 2!-- Assigning interface fa0/2 to vlan 2

3524XL(config-if)#exit

3524XL(config)#interface fastEthernet 0/3

3524XL(config-if)#switchport access vlan 2!-- Assigning interface fa0/3 to vlan 2

3524XL(config-if)#end

3524XL#

00:55:26: %SYS-5-CONFIG_I: Configured from console by console

3524XL#wr mem!-- Saving the configuration

Building configuration...

Step 5 Verify VLAN configuration by using show vlan command.

3524XL#show vlan

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6,

Fa0/7, Fa0/8, Fa0/9, Fa0/10,

Fa0/11, Fa0/12, Fa0/13, Fa0/14,

Fa0/15, Fa0/16, Fa0/17, Fa0/18,

Fa0/19, Fa0/20, Fa0/21, Fa0/22,

Fa0/23, Fa0/24, Gi0/1, Gi0/2

2 cisco_vlan_2 active Fa0/2, Fa0/3

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1 enet 100001 1500 - - - - - 1002 1003

2 enet 100002 1500 - - - - - 0 0

1002 fddi 101002 1500 - - - - - 1 1003

1003 tr 101003 1500 1005 0 - - srb 1 1002

1004 fdnet 101004 1500 - - 1 IBM - 0 0

1005 trnet 101005 1500 - - 1 IBM - 0 0

To remove ports from the VLAN, use the no switchport access vlan command in the interface configuration mode. Once the port is removed from the VLAN that is not VLAN 1 (the default VLAN), that port is automatically added back to the default VLAN.

For example, if y

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航