思科交换机命令大全(完整版)

时间:2022-11-25 10:57:26 作者:壹号 字数:1986字

思科交换机命令大全

思科交换机命令大全

1.设置主机名/系统名

IOS:switch(config)# hostname "hostname"

CLI:switch(enable) set system name name-string

2.设置登录口令

IOS:switch(config)# enable password level 1 password

CLI:switch(enable) set password

switch(enable) set enalbepass

3.设置远程访问

IOS:switch(config)# interface vlan 1

switch(config-if)# ip address ip-address netmask

switch(config-if)# ip default-gateway ip-address

CLI:switch(enable) set interface sc0 ip-address netmask broadcast-address

switch(enable) set interface sc0 vlan

switch(enable) set ip route default gateway

4.启用和浏览CDP信息

IOS:switch(config-if)# cdp enable

switch(config-if)# no cdp enable

CLI:switch(enable) set cdp {enable|disable} module/port

5.查看Cisco邻接设备的CDP通告

IOS:switch# show cdp interface [type modle/port]

switch# show cdp neighbors [type module/port] [detail]

CLI:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]

6.端口描述 IOS:switch(config-if)#description escription-string

CLI:switch(enable)set port name module/number description-string

7.设置端口速度

IOS:switch(config-if)# speed{10|100|auto}

CLI:switch(enable) set port speed moudle/number {10|100|auto}

switch(enable) set port speed moudle/number {4|16|auto}

8.设置以太网的链路模式

IOS:switch(config-if)# duplex {auto|full|half}

CLI:switch(enable) set port duplex module/number {full|half}

9.配置静态VLAN

IOS:switch# vlan database

switch(vlan)# vlan vlan-num name vla

switch(vlan)# exit

switch# configure teriminal

switch(config)#interface interface module/number

…… 此处隐藏0字 ……

switch(config-if)# switchport mode access

switch(config-if)# switchport access vlan vlan-num

switch(config-if)# end

CLI:switch(enable) set vlan vlan-num [name name]

switch(enable) set vlan vlan-num mod-num/port-list

10.配置VLAN中继线

IOS:switch(config)# interface interface mod/port

switch(config-if)# switchport mode trunk