配置命令
1、 交换机模式介绍
用户模式:主要用于查看系统信息和一些基本的测试功能,如ping trraceroute等
switch>
特权模式:执行enable进入特权模式,该模式下啊用户可以执行IOS提供的所有命令,键入?可以获得提示。Exit离开特权模式。Reload重启交换机
Switch>enable
Switch#
全局配置模式:特权模式下执行configure terminal命令进入。该模式只要输入一条有效的配置命令并回车,内存中正在运行的配置就会立即改变生效。该模式下的配置命令的作用域是全局性的,是对整个交换机起作用。
Switch#
switch#conf ter
switch(config)#
接口配置模式:在全局配置模式下,执行interface命令进入接口配置模式。该模式下可以对端口进行配置。
Switch(config)#
Switch(config)#interfacefastethernet 0/1
Switch(config-if)#
Line配置模式:在全局配置模式下,执行Line vty或Line console命令,进入Line配置模式,该模式主要用于对虚拟终端(VTY)和控制台端口进行配置,主要配置VTY和控制台用户级登录密码
switch(config)# Line console 0
switch(config-line)#
2、 交换机名称、密码配置
交换机名称:
switch(config)# hosotname cisco01 将交换机名称修改为cisco01
cisco01(config)#
特权模式密码
switch(config)# enable password 123456 设置进入特权模式的密码为123456 明文
switch(config)# enable secret 123456 设置进入特权模式的密码为123456 密文
配置控制台登录密码
switch(config)# line console 0 进入line配置模式,控制端口编号为0
switch(config-line)# password 222 设置console本地端口登录密码为222
switch(config-line)# login 启用密码检查,让密码生效
配置Vty密码
switch(config)# line vty 0 4 进入Line配置模式,允许5个telnet连接
switch(config-line)# password111 设置VTY密码为111 (telnet登录时使用)
switch(config-line)#login 启用密码检查,让密码生效
3、 管理Ip、网关配置
switch(config)#vlan 951
switch(config)# interface vlan 951
switch(config-if)# ip address 10.10.10.10255.255.255.0
switch(config-if)# no shutdown
网关
switch(config)# IP Default-gateway 10.10.10.1
4、 VTP配置
switch(config)# VTP mode server\client\transparent VTP模式
switch(config)# vtp domain book VTP域名
switch(config)# vtp password 2222 VTP密码
switch(config)# vtp version 2 VTP版本
5、 Vlan划分
6、 本地登录和远程登录
7、 端口封装、端口模式
8、 NTP、log服务配置
查看命令
1、 查看交换机所有配置
Show running
2、 查看日志
Show log
3、 查看端口
Show interfaces tatus
4、 查看Vlan
Show vlan bri
5、 通过MAC查看IP,通过IP查看MAC
Show mac address-table / Show arp
6、 查看VTP
Show vtp status