Tag Archives: cisco

Cisco catalyst configuring VLANs

一. 设置当前交换机为server模式
switch>enable
switch# configure t
switch(config)>vtp mode server
switch(config)>exit

二. 删除原先的vlan
switch>enable
switch# configure t
switch(config)>no vlan VLAN-ID
switch(config)>exit

三. 增加一个新的vlan
switch>enable
switch# configure t
switch(config)>vlan VLAN-ID
switch(config)>name VLAN-NAME
switch(config)>exit

比如

Switch# configure terminal
Switch(config)# vlan 20
Switch(config-vlan)# name test20
Switch(config-vlan)# end

四. 分配一个到指定的vlan

Switch# configure terminal 
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface gigabitethernet0/1 
Switch(config-if)# switchport mode access 
Switch(config-if)# switchport access vlan 2
Switch(config-if)# end 

五. 重载配置

copy running-config startup-config

六. 备忘录
vlan的id 比如10 20 30,这些你在网关上要对应,我这是使用的routeros。这样才能起到一个局域网内有不同的网段以及网段之间的阻隔。