交换机常用命令:
设置vtp域名: vtp domain 域名
进入vlan数据库: vlan database
创建vlan : vlan vlan号 [name valn名]
设置端口为存取模式: switchport access vlan <valn 号>
交换机接口主动变为中继模式:switchport mode dynamic desirable
设置vtp工作模式:vtp mode server|client|transparent
显示vlan信息:show vlan
显示vtp状态:show vtp status
显示交换机端口信息:show interface 端口号 switchport
删除vlan :
Swhtch1(config)#int vlan10
Swhtch1(config-if)#no vlan 10
端口加入vlan:
Swhtch1(config)#int f0/2
Swhtch1(config-if)#switchport mode access
Swhtch1(config-if)#switchport access vlan 10
配置vlan管理地址:
Swhtch1(config-if)#int vlan10
Swhtch1(config-if)#ip add 192.168.1.2 255.255.255.0
配置默认网关地址:
Swhtch1(config)#ip default-gateway 192.168.1.254
思科实现:
Switch>en
Switch#setup
!进入初始配置阶段
--- System Configuration Dialog ---
Continue with configuration dialog? [yes/no]: y
At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[]'.
Basic management setup configures only enough connectivity
for management of the system, extended setup will ask you
to configure each interface on the system
Would you like to enter basic management setup? [yes/no]: y
!询问是否进入基本管理设置
Configuring global parameters:
Enter host name [Switch]: Switch1
!输入交换机名字
The enable secret is a password used to protect access to
privileged EXEC and configuration modes. This password, after
entered, becomes encrypted in the configuration.
Enter enable secret: 123
!输入特权密码
The enable password is used when you do not specify an
enable secret password, with some older software versions, and
some boot images.
Enter enable password: 456
!输入一般用户密码
The virtual terminal password is used to protect
access to the router over a network interface.
Enter virtual terminal password: 789
!输入远程密码
Configure SNMP Network Management? [no]:n
!配置ip
management network from the above interface summary: vlan1
!输入配置ip接口的名称
Configuring interface Vlan1:
Configure IP on this interface? [yes]: y
IP address for this interface: 192.168.1.1
!输入ip地址
Subnet mask for this interface [255.255.255.0] : 255.255.255.0
!子网掩码
Would you like to enable as a cluster command switch? [yes/no]:y
!是否保存
[0] Go to the IOS command prompt without saving this config.
[1] Return back to the setup without saving this config.
[2] Save this configuration to nvram and exit.
Enter your selection [2]: 2
!0不保存进入ios界面,1不保存重新进入setup,2保存进入ios界面