交换机常用设备信息查看命令最终版.doc
交换机维护常用show命令

交换机维护常用show命令1.查看交换机的版本信息通过show ver命令可以查看交换机具体型号、软件版本、硬件版本、交换机序列号等信息2.查看交换机CPU利用率通过show cpu进行查看,可以查看5分钟、1分钟、5秒钟的CPU利用率。
说明:健康状态下,“CPU utilization in five minutes”应该维持在30%以下;承载业务的压力越大,CPU会越高,也属正常现象,但超出60%时就务必引起注意3.查看交换机内存利用率通过show memory进行查看,可以查看总的内存大小,可用内存大小及当前内存利用率4.查看交换机的电源信息通过show power命令可以查看交换机的电源供电状态5.查看交换机的风扇信息通过show fan命令可以查看交换机的风扇是否正常6.查看交换机的温度通过show tem命令可以查看交换机的温度7.查看交换机时间命令在特权模式下使用showclock命令查看交换机的时间,如下:Ruijie#show clock ------>查看交换机的时间18:01:03 beijing Tue, Dec 3, 20138.查看交换机的log信息:在特权模式下使用show log命令查看日志信息2)通过more flash:xxx来查看保存到flash中的log信息说明:需要用命令Ruijie(config)#logging file flash:syslog 131072来将缓存区的log保存到flash9.查看交换机FLASH空间大小及文件通过dir命令进行查看,可以查看主程序文件、配置文件、总FLASH空间大小及当前空闲的FLASH空间大小10.查看交换机的MAC地址表在特权模式下使用show mac-address-table来查看交换机上学习到的mac地址Ruijie#show mac-address-tableVlan MAC Address Type Interface---------- -------------------- -------- -------------------1 1414.4b19.ecc0 DYNAMIC GigabitEthernet 0/2如果要查看MAC地址的统计信息,可以使用show mac-address-table count命令11.查看交换机本身的MAC地址我司交换机有两个MAC地址,一个是二层协议(如STP、RLDP、LLDP等)使用的MAC 地址,一个是三层协议(如ARP、VRRP、OSPF等)使用的MAC地址,对于二层协议使用的MAC地址,可以通过show member命令进行查看说明:1)对于高端交换机(S86、S78、S12K)没有该命令,可以通过show arp来确认,自己的IP对应的MAC地址就是交换机的三层MAC 地址。
华为交换机配置命令大全

华为交换机配置命令大全华为交换机是一种高性能、高可靠的数据通信设备,广泛应用于各种网络环境中。
为了更好地使用华为交换机,我们需要了解一些基本的配置命令。
本文将为大家详细介绍华为交换机的配置命令大全,帮助大家更好地了解和使用华为交换机。
1. 登录华为交换机。
首先,我们需要登录华为交换机进行配置。
一般来说,我们可以通过串口、Telnet或SSH方式登录交换机。
以SSH方式登录为例,我们可以使用以下命令:```shell。
ssh -l username 192.168.1.1。
```。
其中,username为登录用户名,192.168.1.1为交换机的IP地址。
登录成功后,我们需要输入密码进行验证。
2. 查看交换机当前配置。
在登录成功后,我们可以使用以下命令查看交换机的当前配置信息:```shell。
display current-configuration。
```。
这条命令可以显示出交换机当前的全部配置信息,包括接口配置、VLAN配置、路由配置等。
3. 配置交换机接口。
接下来,我们可以对交换机的接口进行配置。
比如,我们可以通过以下命令配置一个VLAN接口:```shell。
interface Vlanif1。
ip address 192.168.1.1 255.255.255.0。
```。
这条命令将为VLAN接口Vlanif1配置IP地址为192.168.1.1,子网掩码为255.255.255.0。
4. 配置交换机VLAN。
除了配置接口,我们还可以对交换机的VLAN进行配置。
比如,我们可以使用以下命令创建一个VLAN:```shell。
vlan 10。
```。
这条命令将创建一个VLAN ID为10的VLAN。
5. 配置交换机路由。
在需要进行路由配置时,我们可以使用以下命令添加静态路由:```shell。
ip route-static 0.0.0.0 0.0.0.0 192.168.1.254。
```。
(完整版)锐捷交换机命令大全

【第一部分】交换机支持的命令:1.交换机基本状态:switch: ;ROM状态,路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态2.交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令3.交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain;设置发vtp域名switch(config)#vtp password;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式4.交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address;设置IP地址switch(config)#ip default-gateway;设置默认网关switch#dir flash: ;查看闪存5.交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息【第二部分】路由器支持的命令:1.路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动2.路由器口令设置:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xx router(config)#(Ctrl+z) ;返回特权模式router#exit ;返回命令3.路由器配置:router(config)#int s0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address;设置IP地址router(config-if)#ip address second ;设置第二个IProuter(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address;设置子接口IProuter(config-subif.1)#encapsulation dot1q;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导4.路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftprouter#copy startup-config tftp ;开机配置存到tftprouter#copy tftp flash: ;下传文件到flashrouter#copy tftp startup-config;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset;重新引导rommon>copy xmodem: flash: ;从console传输文件rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP rommon>TFTP_FILE=c2600.bin ;指定下载的文件rommon>tftpdnld ;从tftp下载rommon>dir flash: ;查看闪存内容rommon>boot ;引导IOS5.静态路由:ip route;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例6.动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。
(完整版)华为交换机命令大全

华为交换机基本配置命令详解1、配置文件相关命令[Quidway]display current-configuration 显示当前生效的配置[Quidway]display saved-configuration显示flash中配置文件,即下次上电启动时所用的配置文件reset saved-configuration 檫除旧的配置文件reboot 交换机重启display version 显示系统版本信息2、基本配置[Quidway]super password 修改特权用户密码[Quidway]sysname 交换机命名[Quidway]interface ethernet 1/0/1 进入接口视图[Quidway]interface vlan 1进入接口视图[Quidway-Vlan-interfacex]ip address 10.1.1.11 255.255.0.0配置VLAN的IP地址[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.1.1.1静态路由=网关3、telnet配置[Quidway]user-interface vty 0 4 进入虚拟终端[S3026-ui-vty0-4]authentication-mode password 设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple xmws123设置口令[S3026-ui-vty0-4]user privilege level 3 用户级别4、端口配置[Quidway-Ethernet1/0/1]duplex {half|full|auto} 配置端口工作状态[Quidway-Ethernet1/0/1]speed {10|100|auto} 配置端口工作速率[Quidway-Ethernet1/0/1]flow-control 配置端口流控[Quidway-Ethernet1/0/1]mdi {across|auto|normal} 配置端口平接扭接[Quidway-Ethernet1/0/1]port link-type {trunk|access|hybrid} 设置端口工作模式[Quidway-Ethernet1/0/1]undo shutdown 激活端口[Quidway-Ethernet1/0/2]quit 退出系统视图5、链路聚合配置[DeviceA] link-aggregation group 1 mode manual 创建手工聚合组1[Qw_A] interface ethernet 1/0/1 将以太网端口Ethernet1/0/1加入聚合组1 [Qw_A-Ethernet1/0/1] port link-aggregation group 1[Qw_A-Ethernet1/0/1] interface ethernet 1/0/2 将以太网端口Ethernet1/0/1加入聚合组1[Qw_A-Ethernet1/0/2] port link-aggregation group 1[Qw_A] link-aggregation group 1 service-type tunnel # 在手工聚合组的基础上创建t unnel业务环回组。
迈普交换机常用命令手册

资料范本本资料为word版本,可以直接编辑和打印,感谢您的下载迈普交换机常用命令手册地点:__________________时间:__________________说明:本资料适用于约定双方经过谈判,协商而共同承认,共同遵守的责任与义务,仅供参考,文档可直接下载或修改,不需要的部分可直接删除,使用时请详细阅读内容迈普交换机常用命令手册目录TOC \o "1-3" \h \z \u HYPERLINK \l "_Toc311107200" 1、各种命令模式介绍及模式间切换方法 PAGEREF _Toc311107200 \h 2 HYPERLINK \l "_Toc311107201" 1)普通用户模式 PAGEREF_Toc311107201 \h 2HYPERLINK \l "_Toc311107202" 2)特权用户模式 PAGEREF_Toc311107202 \h 2HYPERLINK \l "_Toc311107203" 3)全局模式 PAGEREF_Toc311107203 \h 2HYPERLINK \l "_Toc311107204" 4)端口配置模式 PAGEREF_Toc311107204 \h 3HYPERLINK \l "_Toc311107205" 2、交换机维护常用命令 PAGEREF _Toc311107205 \h 3HYPERLINK \l "_Toc311107206" 1)查看当前交换机的配置信息PAGEREF _Toc311107206 \h 3HYPERLINK \l "_Toc311107207" 2)查看当前交换机端口的概述信息 PAGEREF _Toc311107207 \h 3HYPERLINK \l "_Toc311107208" 3)查看当前交换机端口的POE状态 PAGEREF _Toc311107208 \h 4HYPERLINK \l "_Toc311107209" 4)查看当前交换机的MAC地址表的内容 PAGEREF _Toc311107209 \h 5HYPERLINK \l "_Toc311107210" 5)查看当前交换机的ARP映射表PAGEREF _Toc311107210 \h 5HYPERLINK \l "_Toc311107211" 6)查看当前交换机的型号 PAGEREF _Toc311107211 \h 6HYPERLINK \l "_Toc311107212" 7)开启和关闭交换机端口 PAGEREF _Toc311107212 \h 6HYPERLINK \l "_Toc311107213" 8)开启和关闭交换机端口POE 功能 PAGEREF _Toc311107213 \h 6HYPERLINK \l "_Toc311107214" 9)配置交换机端口的模式(access/hybrid/trunk)及归属VLAN。
华为、锐捷交换机配置常用命令

锐捷
锐捷
查看版本信息 查看mac地址 进入端口 关闭端口 开启端口 查看端口信息
命令 登录账号:huawei123 sys display current-configuration (dis cu) display mac-address | include Ethernet display vlan interface Ethernet 0/0/1 no shutdown shutdown interface GigabitEthernet 0/0/1 display this display transceiver interface GigabitEthernet 0/0/1 verbose reboot 登录账号:root enable 登录密码:mduadmin 提示符由>变成# (disp cu) 登录密码:Huawei@123
交换机厂家
交换机型号
中文注释 登录账号/登录密码 进入特权模式/进入配置模式 查看交换机配置信息 查看mac地址 查看交换机vlan 进入电口 开启端口 关闭端口 进入光口 查看当前配置 查看端口光路情况
交换机
华为
重启设备 登录账号/登录密码 特权模式 配置模式 查看onu配置信息 查看单板及端口状态
show version show mac-address-table interface fastethernet 0/1-24 shutdown no shutdown show run int f 0/1
config提示符由#变成(config)# display current-configuration display board 0/1 display vlan all display mac-address vlan **** display onu info switch language-mode interface gponnni 0/0/1 display port state 账号 ruijie enable show vlan show interface brief 密码:ruijie show running-config
交换机查询及配置命令

计算机命令PCA login: root password: linux # shutdown -h now # init 0 # logout # login # ifconfig# ifconfig eth0 <ip address> netmask <netmask># ifconfig eht0 <ip address> netmask <netmask> down# route add 0.0.0.0 gw <ip># route del 0.0.0.0 gw <ip># route add default gw <ip># route del default gw <ip># route# ping <ip># telnet <ip>交换机命令[Quidway] dis cur[Quidway]display current-configuration[Quidway] display interfaces[Quidway] display vlan all[Quidway] display version[Quidway ]super password[Quidway] sysname[Quidway] interface ethernet 0/1[Quidway] interface vlan x[Quidway-Vlan-interfacex ]ip address 10.65.1.1 255.255.0.0[Quidway] ip route-static 0.0.0.0 0.0.0.0 10.65.1.2[Quidway ]rip[Quidway] local-user ftp[Quidway] user-interface vty 0 4[S3026-ui-vty0-4]authentication-mode password [S3026-ui-vty0-4]set authentication-mode password simple 222 [S3026-ui-vty0-4]user privilege level 3;使用root 用户;口令是linux;关机;关机;用户注销;用户登录;显示IP 地址;设置IP 地址;禁用IP 地址;设置网关;删除网关;设置网关;删除网关;显示网关;发ECHO 包;远程登录;显示当前配置;显示当前配置;显示接口信息;显示路由信息;显示版本信息;修改特权用户密码;交换机命名;进入接口视图;进入接口视图;配置VLAN 的IP 地址;静态路由=网关;三层交换支持;进入虚拟终端;设置口令模式;设置口令;用户级别[Quidway] vlan 3 [Quidway-vlan3] port e0/1 [Quidway-vlan3] port ethernet 0/1 to ethernet 0/4[Quidway]interface ethernet 0/1 [Quidway] int e0/1 [Quidway-Ethernet0/1] duplex {half|full|auto} [Quidway-Ethernet0/1] speed {10|100|auto} [Quidway-Ethernet0/1 ]flow-control [Quidway-Ethernet0/1] [Quidway-Ethernet0/1] [Quidway-Ethernet0/1][Quidway-Ethernet0/2][Quidway-Ethernet0/3] [Quidway-Ethernet0/1] [Quidway-Ethernet0/1] [Quidway-Ethernet0/1]mdi {across|auto|normal} port link-type {trunk|access|hybrid} port access vlan 3 port trunk permit vlan {ID|All} port trunk pvid vlan 3 undo shutdown shutdown quit;进入端口模式 ;进入端口模式 ;配置端口工作状态 ;配置端口工作速率 ;配置端口流控 ;配置端口平接扭接 ;设置端口工作模式 ;当前端口加入到 VLAN ;设 trunk 允许的VLAN ;设置 trunk 端口的 PVID ;激活端口; 关闭端口 ;返回[Quidway] monitor-port <interface_type interface_num> [Quidway ]port mirror <interface_type interface_num> [Quidway] port mirror int_list observing-port int_type int_num ;指定镜像端口 ;指定被镜像端口 ;指定镜像和被镜像[Quidway] description string [Quidway] description符[Quidway] display vlan [vlan_id] ;指定 VLAN 描述字符;删除 VLAN 描述字;查看 VLAN 设置[Quidway] stp {enable|disable} [Quidway] stp priority 4096[Quidway] stp root {primary|secondary} [Quidway-Ethernet0/1] stp cost 200;设置生成树 ,默认关闭 ;设置交换机的优先级 ;设置为根或根的备份 ;设置交换机端口的花费[Quidway ]link-aggregation e0/1 to e0/4 ingress|both [Quidway ]undo link-aggregation e0/1|all ; 端口的聚合; 始端口为通道号[SwitchA-vlanx] isolate-user-vlan enable[SwitchA] isolate-user-vlan <x> secondary <list> [Quidway-Ethernet0/2] port hybrid pvid vlan <id> [Quidway-Ethernet0/2] port hybrid pvid [Quidway-Ethernet0/2] port hybrid vlanvlan_id_list untagged;设置主 vlan;设置主 vlan 包括的子 vlan ;设置 vlan 的 pvid ;删除 vlan 的 pvid ;设置无标识的 vlan[Quidway-vlan3] port e0/1 to e0/4如果包的 vlan id 与 PVId 一致,则去掉 vlan 信息 . 默认 PVID=1 。
(完整word版)思科交换机命令大全.doc

思科交换机常用命令大全1.1用户模式与特权模式用户模式:可以使用一些基本的查询命令特权模式:可以对交换机进行相关的配置进入特权模式命令:Switch>enable退出特权模式命令:Switch#exit启用命令查询:?时间设置:Switch#clock set时间(自选参数,参数必须符合交换机要求)显示信息命令: Switch#show 可选参数注意:可以用 TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数查看交换机配置 :Switch#show running-config保存交换机配置:Switch#copy running-config startup-configSwitch#wr查看端口信息: Switch#show interface查看 MAC地址表:Switch#show mac-address-table查看交换机 CPU的状态信息:Switch#show processes1.2全局配置模式进入全局配置模式:Switch#configure terminal主机名修改:Switch(config)#hostname 主机名(自选参数)特权模式进入密码:Switch(config)#enable secret 密码(自选参数)取消特权模式密码:Switch(config)#no enable secret取消主机名设置:Switch(config)#no hostname退出配置模式:Switch(config)#exit需要特别注意的是在配置模式中无法使用show命令,如果要使用的话show 前必须加do 和空格,例如:do show *指定根交换机命令:Switch(config)#spanning-tree vlan 自选参数( VLAN号)root primary例如:Switch(config)#spanning-tree vlan 1 root primary需要注意的是:设置根交换机是基于VLAN的关闭生成树协议命令:Switch(config)#no spanning-tree vlan 自选参数(VLAN 号)例如: Switch(config)#no spanning-tree vlan 11.3接口配置模式进入接口配置模式:Switch(config)#interface端口名称(可选参数)启用端口:Switch(config-if)#no shutdown停用端口:Switch(config-if)#shutdown进入同种类型多端口配置:Switch(config)# interface range fastethernet0/1-5进入不同类型多端口配置:Switch(config)#interface range fastethernet0/1-5 ,gigabitethernet 0/1-2退出接口配置模式:Switch(config-if)#exit1.4二层端口的配置端口速率: Switch(config-if)#speed可选参数双工模式: Switch(config-if)#duplex可选参数禁用链路协商: Switch(config-if)#no negotiation auto启用链路协商: Switch(config-if)#negotiation auto1.5 VLAN 的配置新建 VLAN:Switch(config)#vlan 自选参数(VLAN号)Switch(config-vlan)#name自选参数(VLAN名)例如: Switch(config)#vlan 1Switch(config-vlan)#name lab1Switch(config-vlan)#exit删除 VLAN: Switch#vlan databaseSwitch(vlan)#no vlan自选参数(vlan号)例如: Switch#vlan databaseSwitch(vlan)#no vlan 2将一个接口加入VLAN:Switch(config)#interface可选参数(接口号)Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 自选参数(VLAN号)Switch(config-if)#no shutdownSwitch(config-if)#exit例如: Switch(config)#interface f0/1 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 1 Switch(config-if)#no shutdown Switch(config-if)#exit将一个接口退出VLAN:Switch(config)#interface 可选参数(接口号)Switch(config-if)#no switchport access vlan 自选参数(VLAN号)例如: Switch(config)#interface f0/1Switch(config-if)#no switchport access vlan 2修改一个接口为端口汇聚模式Switch(config)#interface 可选参数(接口号)Switch(config-if)#switchport mode trunkVLAN的验证命令:Switch#show vlan 显示VLAN列表Switch#show interface switchport 查看具体接口的VLAN成员资格信息1.6 VTP 的配置VTP Domain Name( VTP域名)Switch#configure terminalSwitch(config)#vtp domain自选参数例如: Switch(config)#vtp domain Lab_NetworkVTP mode(VTP模式)Switch(config)#vtp mode可选参数(Server|Client| Transparent) 例如: Switch(config)#vtp mode ServerVTP Pruning (VTP修剪)Switch(config)#vtp pruning注意:有的交换机不支持VTP修剪命令查看 VTP的配置命令:Switch#show vtp status显示交换机运行的VTP模式,配置修订号和交换机所属的VTP域Switch#show vtp counters显示 VTP消息相关的统计数据1.7远程登录交换机设置配置管理 VLAN:Switch(conf)#interface vlan 1Switch(config-if)#ip address x.x.x.x 255.255.255.0Switch(config-if)#no shutdown注意: IP 地址必须与远程连接交换机的PC机地址在同一网段在交换机上指定默认网关:Switch(config)#ip default-gateway x.x.x.x注意:指定的默认网关仅当前交换机有效。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
交换机常用设备信息查看命令
Ruijie#show running-config
查看设备当前的配置
2)Ruijie#show version
查看设备的软件版本信息
3) Ruijie#show log
查看设备的日志
4)Ruijie#show ip interface brief
查看设备的三层接口ip和掩码
5)Ruijie#show interface f0/1
查看f0/1接口的信息,包括mac地址,流量信息等等
6)Ruijie#show interface status
查看交换接口的信息,包括状态、vlan、双工、速度和使用介质7)Ruijie#show vlan
查看交换接口所属的vlan信息
交换机的基本命令有以下四种:
一、模式命令:
1. 用户模式:Switch>
2. 特权模式:Switch>enable
Switch#
3. 全局配置模式:Switch#config terminal
Switch(config)#
4. 接口配置模式:Switch(config)#interface fastethernet0/1 Switch(config-if)#
5. Line模式:Switch(config)#line console 0
Switch(config-line)#
二、特权模式下的命令:
1. 查看机MAC地址:Switch#show mac-address-table
2. 发现(CDP):
Switch#show cdp
Switch#show cdp interface fastethernet0/1
Switch#show cdp neighbors
Switch#show cdp neighbors detail
Switch#show cdp entry
3. 保存机配置:
Switch#copy running-config startup-config或者Switch#write 4. 恢复交换机出厂值:
Switch#erase startup-config
Switch#reload
三、全局配置模式下的命令:
1. 配置主机名:Switch(config)#hostname Sw1
Sw1(config)#
2、设置登陆台密码:Switch(config)#line console 0 Switch(config-line)#password 密码
Switch(config-line)#login
3. 使能口令:Switch(config)#enable Password 密码
4. 加密保存的使能口令:Switch(config)#enable secret 密码
5. 配置IP地址:
Switch(config)#interface vlan 1
Switch(config-if)#ip address IP地址网关
Switch(config-if)#no shutdown
6. 配置交换机网关:Switch(config)#ip default-gateway 网关
四、VLAN配置命令:
1. 创建vlan命令:
a) 全局配置模式下:
Switch(config)#vlan 2
Switch(config)#name v2
Switch(config)#mtu 数值
Switch(config)#end
b) Vlan数据库下:
Switch#vlan database
Switch#vlan 2 name v2
Switch#vlan 2 mut 数值
Switch#exit
2. 删除vlan命令:
a) 全局配置模式下:
Switch(config)#no vlan 2
Switch(config)#end
b) Vlan数据库下:
Switch#no vlan 2 name v2
Switch#exit
3. 在vlan中添加端口:
Switch#config terminal
Switch(config)#interface f0/1(端口)
Switch(config-if)#Switchport mode access
Switch(config-if)#switchport access vlan 2
Switch(config-if)#end
一次将多个端口添加到vlan中:
Switch#config terminal
Switch(config)#interface range f0/1 - 5(端口)
Switch(config-if)#switchport access vlan 2
Switch(config-if)#end
注:switch#show vlan biref(查看vlan信息)
4. 配置vlan trunk:
1. 配置接口为trunk命令:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport mode trunk
2. 配置接口为动态协商模式的命令:
Switch(config)# interface f0/1(端口)
Switch(config-if)#switchport mode dynamic desirable/auto 3. 从trunk中删除vlan:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport trunk allowed vlan remove 2 4. 在trunk中添加vlan:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport trunk allowed vlan add 2。