CISCO交换机的常用操作项-思科常用命令手册速查手册

CISCO交换机的常用操作项-思科常用命令手册速查手册
CISCO交换机的常用操作项-思科常用命令手册速查手册

交换机的常用操作项

1、更改主机名

switch(config)#hostname sw1

2、设置进入特权模式的密码

switch(config)#enable password 1234

switch(config)#enable secret cisco

3、设置console口密码

switch(config)#line console 0

switch(config-line)#password 123

switch(config-line)#login

4、查看mac地址列表

switch#show mac-address-table

5、查看mac地址列表刷新时间

switch#show mac-address-table aging-time

6、更改mac地址列表刷新时间

switch(config)#mac-address-table aging-time 200 7、查看当前配置(RAM)

switch#show running-config

8、查看交换机的配置(NVRAM)

switch#show startup-config

9、保存配置

switch#copy running-config startup-config

switch#write

10、恢复出厂默认设置

switch#erase startup-config

switch#reload

11、查看cdp的全局信息

switch#show cdp

12、查看接口的cdp配置信息

switch#show cdp interface f0/2

13、查看有关cdp包的统计信息

switch#show cdp traffic

14、查看邻居信息

switch#show cdp neighbors

15、查看所有入口项的详细信息

switch#show cdp neighbors detail

switch#show cdp entry *

16、添加接口的描述信息

switch(config-if)# description connection to routerA 17、设置交换机的网关

switch(config)#ip default-gateway 192.168.1.1

18、关掉DNS解析

switch(config)# no ip domain-lookup

19、实现交换机的远程管理

switch(config)#enable secret cisco

switch(config)#interface vlan 1

switch(config-if)#ip address 192.168.1.100 255.255.255.0

switch(config-if)#no shutdown

switch(config)#line vty 0 4

switch(config-line)#password 123

switch(config-line)#login

c:\>telnet 192.168.1.100

20、交换机的密码恢复

1、将交换机的电源拔下

2、按mode键将电源插上,当出现switch:时将手松开

3、switch:flash_init //加载到flash中

4、switch:dir flash: //查看flash中的文件

5、rename flash:config.text flash:config.old //更

改文件名

6、boot //重新启动交换机

7、rename flash:config.old flash:config.text //

将文件名改回

8、copy flash:config.text running-config

9、enable password cisco //重新设置密码

10、write //保存

21、创建vlan方法一

switch#vlan database

switch(vlan)#vlan 10 name sc

switch(vlan)#exit

22、创建vlan方法二

switch(config)#vlan 10

switch(config-vlan)#name sc

23、删除vlan方法一

switch(vlan)#no vlan 10

switch(vlan)#exit

24、删除vlan方法二

switch(config)#no vlan 10

25、删除vlan方法三

switch#delete vlan.dat

26、将端口加入到vlan中

switch(config-if)#switchport access vlan 10

27、将一组连续的端口加入到vlan中

switch(config)# interface range f0/1 – 5 (端口范

围管理

switch(config-if-range)#switchport access vlan 10 端口范围管理模式

28、将端口从vlan中删除

switch(config-if)#no switchport access vlan 10

switch(config-if)#switchport access vlan 1

switch(config-if-range)#no switchport access vlan 10 switch(config-if-range)#switchport access vlan 1 29、查看所有vlan的摘要信息

switch#show vlan brief

30、查看指定vlan的信息

switch#show vlan id 10

31、指定端口成为trunk

switch(config-if)#switchport mode trunk 两个端口全

要设成trunk

32、Trunk的自动协商

switch(config-if)#switchport mode dynamic desirable switch(config-if)#switchport mode dynamic auto

注意:如果中继链路两端都设置成auto将不能成为trunk 33、查看端口状态

switch#show interface f0/24 switchport

34、在trunk上移出vlan

switch(config-if)#switchport trunk allowed vlan remove 2

35、在trunk上添加vlan

switch(config-if)#switchport trunk allowed vlan add

2

36、Cisco 2600路由器的基本操作

从用户模式进入特权模式

router>enable

router#

从特权模式进入全局配置模式

router#config terminal

router(config)#

为路由器配置主机名

router(config)#hostname teacher

teacher(config)#

进入路由器的以太口配置模式

teacher(config)#interface fastethernet 0/0

teacher(config_if)#

37、查看Cisco 2600路由器的串口状态

router#show interface serial 0/0

serial 0/0 is up ,line protocol is up

可操作状态………serial 0/0 is up ,line protocol is up

连接问题…………serial 0/0 is up ,line protocol is down

接口问题…………serial 0/0 is down ,line protocol is

down

禁用状态…………serial 0/0 is administratively

down ,line protocol is down

38、 静态路由的实现

router(config)#hostname A

A(config)#interface f0/0 A(config-if)#ip address 192.168.1.1 255.255.255.0

A(config-if)#no shutdown

A(config)#interface f0/1

A(config-if)#ip address 192.168.2.1 255.255.255.0

A(config-if)#no shutdown

A(config)#ip

route 192.168.3.0 255.255.255.0

192.168.2.2

B(config)#ip

route 192.168.1.0 255.255.255.0 192.168.2.1

39、 配置默认路由

route(config)#ip route 0.0.0.0 0.0.0.0 下一跳地址

40、 查看路由表

router#show ip route

其中C 代表直连的网络,S 代表静态的路由,S*代表默认

的路由 192.168.1.1 192.168.2.2 192.168.2.1 192.168.3.1 192.168.1.10

192.168.3.10

41、为Cisco 2600路由器配置密码

配置控制台密码

router (config)#line console 0

router (config-line)# password cisco

router (config-line)# login

42、配置特权模式密码

router (config)#enable password cisco

43、配置安全的加密密码

router (config)#enable secret 1234

44、配置路由器标识

router(config)#banner motd $This is Aptech company’s Router! Please don’t change the configuration whithout permissions$

45、对所有密码进行加密

router (config)#service password-encryption

46、配置超时

router(config)#line console 0

router(config-line)#exec-timeout 0 0 //第一个0

代表分钟,第二个0代表秒

47、显示同步

router(config)#line console 0

router(config-line)#logging synchronous

48、配置禁用DNS

router(config)#no ip domain-lookup

49、利用三台路由器实现静态路由和默认路由

50、路由器密码恢复

重启路由器按Ctrl+Break键进入ROM Monitor 模式rommon 1>confreg 0x2142

rommon 2>reset

重启后选择no

router>enable

router#copy startup-config running-config

router#config terminal

router(config)#enable password cisco

router(config)#config-register 0x2102

router#copy running-config startup-config

router#reload

51、单臂路由——实现不同vlan之间的通信

V L A N1

1、划分vlan

switch#vlan database

switch(vlan)#vlan 2

写NAME,不行,

switch(vlan)#vlan 3

switch(vlan)#exit

2、将端口加入vlan

switch(config)#interface range f0/6 -8

switch(config-if-range)#switchport access vlan 2 switch(config-if-range)# interface range f0/9 -11 switch(config-if-range)#switchport access vlan 3 3、配置trunk

switch(config)#interface f0/12

switch(config-if)#switchport mode trunk

4、配置路由器的子接口封装dot1q,并设置IP地址

router(config)#interface f0/0.1

router(config-subif)#encapsulation dot1q 1

router(config-subif)#ip address 192.168.0.1 255.255.255.0

router(config-subif)#no shut

router(config)#interface f0/0.2

router(config-subif)#encapsulation dot1q 2

router(config-subif)#ip address 192.168.1.1 255.255.255.0

router(config-subif)#no shut

router(config)#interface f0/0.3

router(config-subif)#encapsulation dot1q 3

router(config-subif)#ip address 192.168.2.1 255.255.255.0

router(config-subif)#no shut

router(config)#interface f0/0

router(config-if)#no shut

5、设置pc的IP地址和默认网关

52、RIP版本V1和V2 的区别

RIP v1

发送路由更新时不携带子网掩码,属于有类路由协议

发送路由更新时,目标地址为广播地址:255.255.255.255

RIP v2

发送路由更新时携带子网掩码,属于无类路由协议

发送路由更新时,目标地址为组播地址:224.0.0.9

53、 RIP V1的配置

配置步骤:

1、配置路由器接口IP 地址

routerA(config)#interface f0/0

routerA(config-if)#ip

address 192.168.1.1 255.255.255.0

routerA(config-if)#no shutdown

routerA(config-if)#interface f0/1

routerA(config-if)# ip address 10.0.0.2 255.0.0.0

routerA(config-if)#no shutdown

routerB(config)#interface f0/0

routerB(config-if)#ip address 10.0.0.1 255.0.0.0 192.168.2.0/24

192.168.1.0/24

routerB(config-if)#no shutdown

routerB(config)#interface f0/1

routerB(config-if)#ip address 20.0.0.2 255.0.0.0 routerB(config-if)#no shutdown

routerC(config)#interface f0/0

routerC(config-if)#ip address 20.0.0.1 255.0.0.0 routerC(config-if)#no shutdown

routerC(config)#interface f0/1

routerC(config-if)#ip address 192.168.2.2 255.255.255.0

routerC(config-if)#no shutdown

2、在路由器上启动RIP进程,并宣告网络号:

routerA(config)#router rip

routerA(config-router)#network 10.0.0.0

routerA(config-router)#network 192.168.1.0

routerB(config)#router rip

routerB(config-router)#network 10.0.0.0

routerB(config-router)#network 20.0.0.0

routerC(config)#router rip

routerC(config-router)#network 20.0.0.0

routerC(config-router)#network 192.168.2.0

3、验证配置是否正确

1)查看路由表

router#show ip route

2)查看路由协议配置

router#show ip protocols

3)打开RIP协议调试命令

router#debug ip rip

4)退出

router# no debug ip rip

4、在PC上设置IP地址、子网掩码、默认网关,用ping

命令测试连通性

54、RIP V2的配置

10.1.1.0/24 192.168.1.0/24

1、配置各路由器接口IP地址

routerA(config)#interface f0/0

routerA(config-if)#ip address 10.1.1.1 255.255.255.0

routerA(config-if)#no shutdown

routerA(config-if)#interface f0/1

routerA(config-if)# ip address 192.168.1.1 255.255.255.0

routerA(config-if)#no shutdown

routerB(config)#interface f0/0

routerB(config-if)#ip address 10.1.2.1 255.255.255.0

routerB(config-if)#no shutdown

routerB(config)#interface f0/1

routerB(config-if)#ip address 192.168.1.2 255.255.255.0

routerB(config-if)#no shutdown

routerC(config)#interface f0/0

routerC(config-if)#ip address 192.168.1.3 255.255.255.0

routerC(config-if)#no shutdown

routerC(config)#interface f0/1

routerC(config-if)#ip address 192.168.2.1 255.255.255.0

routerC(config-if)#no shutdown

2、在路由器上配置RIP V2 路由协议

routerA(config)#router rip

routerA(config-router)#version 2

routerA(config-router)#no auto-summary

不合并同段网络

routerA(config-router)#network 10.0.0.0 routerA(config-router)#network 192.168.1.0 routerB(config)#router rip

routerB(config-router)#version 2

routerB(config-router)# no auto-summary routerB(config-router)#network 10.0.0.0 routerB(config-router)#network 192.168.1.0 routerC(config)#router rip

routerC(config-router)# version 2

routerC(config-router)# no auto-summary routerC(config-router)#network192.168.1.0 routerC(config-router)#network 192.168.2.0 3、验证配置是否正确

1)查看路由表

router#show ip route

2)查看路由协议配置

router#show ip protocols

3)打开RIP协议调试命令

router#debug ip rip

4、在PC上设置IP地址、子网掩码、默认网关,用ping

命令测试连通性

55、上传路由器上的IOS

router#show flash //查看IOS文件名

router#copy flash tftp

Source filename []? c2600-ik8o3s-mz.122-11.T.bin

Address or name of remote host []? 192.168.1.11

Destination filename [c2600-ik8o3s-mz.122-11.T.bin]?

下载IOS到路由器

router#copy tftp flash

上传路由器上配置文件

router#copy nvram:startup-config tftp:

Address or name of remote host []? 192.168.1.11

Destination filename [router-config]? startup-config

下载配置文件到路由器

router#copy tftp:startup-config nvram

C2600路由器IOS被删除的恢复方法:

1、ctrl+break

rommon 1>IP_ADDRESS=192.168.0.100 //路由器接口地址

rommon 2>IP_SUBNET_MASK=255.255.255.0

rommon 3>DEFAULT_GATEWAY=192.168.0.100

rommon 4>TFTP_SERVER=192.168.0.254

rommon 5>TFTP_FILE=c2600-ik8o3s-mz.122-11.T.bin

rommon 6>tftpdnld

希望各位学员努力学习,将交换机和路由器的操作命令练会、练熟

学如逆水行舟,不进则退

思科交换机命令大全

思科交换机命令大全集团文件发布号:(9816-UATWW-MWUB-WUNN-INNUL-DQQTY-

思科交换机常用命令大全 1.1 用户模式与特权模式 用户模式:可以使用一些基本的查询命令 特权模式:可以对交换机进行相关的配置 进入特权模式命令:Switch>enable 退出特权模式命令:Switch#exit 启用命令查询: 时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求) 显示信息命令:Switch#show 可选参数 注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数 查看交换机配置: Switch#show running-config 保存交换机配置:Switch#copy running-config startup-config Switch#wr

查看端口信息:Switch#show interface 查看MAC地址表:Switch#show mac-address-table 查看交换机CPU的状态信息:Switch#show processes 1.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

思科交换机-常用命令及配置

思科交换机-常用命令及配置 switch> 用户模式 1:进入特权模式enable switch> enable switch# 2:进入全局配置模式configure terminal switch> enable switch#configure terminal switch(conf)# 3:交换机命名hostname name 以cisco001 为例 switch> enable switch#c onfigure terminal switch(conf)#hostname cisco001 cisco001(conf)# 4:配置使能口令(未加密)enable password cisco 以cisco 为例switch> enable switch#configure terminal cisco001(conf)# enable password cisco 5:配置使能密码(加密)enable secret ciscolab 以cicsolab 为例switch> enable switch#configure terminal switch(conf)# enable secret ciscolab

6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#configure terminal switch(conf)# interface vlan 1 switch(conf)# ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码 switch (conf-if)#no shut 激活端口 switch (conf-if)#exit switch (conf)#ip default-gateway 192.168.254 设置网关地址 7:进入交换机某一端口interface fastehernet 0/17 以17 端口为例 switch> enable switch#configure terminal switch(conf)# interface fastehernet 0/17 switch(conf-if)# 8:查看命令show switch> enable switch# show version 察看系统中的所有版本信息 show interface vlan 1 查看交换机有关ip 协议的配置信息 show running-configure 查看交换机当前起作用的配置信息 show interface fastethernet 0/1 察看交换机1 接口具体配置和统计信息 show mac-address-table 查看mac 地址表

思科交换机命令大全

思科交换机常用命令大全 1.1 用户模式与特权模式 用户模式:可以使用一些基本的查询命令 特权模式:可以对交换机进行相关的配置 进入特权模式命令:Switch>enable 退出特权模式命令:Switch#exit 启用命令查询:? 时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求) 显示信息命令:Switch#show 可选参数 注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数 查看交换机配置: Switch#show running-config 保存交换机配置:Switch#copy running-config startup-config Switch#wr 查看端口信息:Switch#show interface 查看MAC地址表:Switch#show mac-address-table 查看交换机CPU的状态信息:Switch#show processes 1.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 1 1.3 接口配置模式 进入接口配置模式:Switch(config)#interface 端口名称(可选参数) 启用端口:Switch(config-if)#no shutdown 停用端口:Switch(config-if)#shutdown 进入同种类型多端口配置:Switch(config)# interface range fastethernet 0/1-5 进入不同类型多端口配置:Switch(config)#interface range fastethernet 0/1-5,gigabitethernet 0/1-2

cisco交换机配置口令大全

cisco交换机配置口令大全 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.在基于IOS的交换机上启用和浏览CDP信息: switch(config-if)# cdp enable switch(config-if)# no cdp enable 为了查看Cisco邻接设备的CDP通告信息: switch# show cdp interface [type modle/port] switch# show cdp neighbors [type module/port] [detail] 在基于CLI的交换机上启用和浏览CDP信息: switch(enable) set cdp {enable|disable} module/port 为了查看Cisco邻接设备的CDP通告信息: switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述: switch(config-if)# description description-string 基于CLI的交换机的端口描述: switch(enable)set port name module/number description-string 6.在基于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} 7.在基于IOS的交换机上设置以太网的链路模式: switch(config-if)# duplex {auto|full|half}

思科交换机路由器命令大全

思科交换机路由器命令 大全 YUKI was compiled on the morning of December 16, 2020

1. 交换机支持的命令:交换机基本状态: 交换机口令设置: 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 ;返回命令 交换机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 2switch(config-if)#switchport mode trunk ;设置为干线switch(config- if)#switchport trunk allowed vlan 1,2 ;设置允许 的vlanswitch(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模式 交换机设置IP地址: 交换机显示命令:

Cisco IOS 基本命令

Cisco IOS 基本命令一、基本路由器的检验命令 show version show processes show protocols show mem show ip route show startup-config show running-config show flash show interfaces 二、基本路由配置命令 进入:config terminal/memory/network 配置网络时常采用的命令:copy和load 1.标识:hostname 标识名 2.启动标识:banner 启动标识 3.接口:interface 端口号 4.密码:line 0 6 login passwd 口令 enable password/secret 口令 5.接口:

1)配置端口 interface 端口号 clock rate 时钟速率(64000)/* 在串口中配置*/ bandwidth 带宽(缺省56)/* 在串口中配置*/ media-type 介质类型/* 在以太网口上*/ early-token release /* 在令牌环网口上*/ ring-speed 16 /* 在令牌环网口上*/ no shutdown write memory 2)检验端口 show interfaces show controllers 6.配置环境 1)引导方式 boot system flash IOS-filename boot system tftp IOS-filename tftp-address boot system rom 2)配置Register值 config-register 0x2102 7.查看邻居路由 show cdp interface show cdp neighbors [detail]

Cisco交换机常用配置命令

Cisco交换机常用配置命令 CISCO交换机基本配置 switch>ena 進入特权模式 switch#erasenvram 全部清除交换机的所有配置 switch#reload 重新启动交换机(初始提示符为switch> ) ------------------------------------------------------------------------------------ CISCO交换机基本配置:Console端口连接 用户模式hostname>; 特权模式hostname(config)# ; 全局配置模式hostname(config-if)# ; 交换机口令设置: switch>enable ;进入特权模式 switch#config;进入全局配置模式 switch(config)#hostname cisco ;设置交换机的主机名 switch(config)#enable secret csico1 ;设置特权加密口令 switch(config)#enable password csico8 ;设置特权非密口令 switch(config)#line console 0 ;进入控制台口 switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;虚拟终端允许登录 switch(config-line)#password csico6 ;设置虚拟终端登录口令csico6 switch#write 保存配置設置 switch#copy running-config startup-config 保存配置設置,與write一樣switch#exit;返回命令 配置终端过一会时间就会由全局配置模式自动改为用户模式,将超时设置为永不超时 switch#conf t switch(config)#line con 0 switch(config-line)#exec-timeout 0 --------------------------------------------------------------------------------- 交换机显示命令: switch#write;保存配置信息 switch#showvtp;查看vtp配置信息 switch#show run ;查看当前配置信息 switch#showvlan;查看vlan配置信息 switch#showvlan name vlan2 switch#show interface ;查看端口信息

思科交换机配置维护手册

思科交换机配置维护手册

目录

一、端口配置 1.1 配置一组端口 当使用interface range命令时有如下的规则: ?有效的组范围: o vlan从1 到4094 o fastethernet槽位/{first port} - {last port}, 槽位为0 o gigabitethernet槽位/{first port} - {last port},槽位为0 o port-channel port-channel-number - port-channel-number, port-channel号从1到64 ?端口号之间需要加入空格,如:interface range fastethernet 0/1 – 5是有效的,而interface range fastethernet 0/1-5是无效的. ?interface range命令只能配置已经存在的interface vlan ?所有在同一组的端口必须是相同类别的。

见以下例子: Switch# configure terminal Switch(config)# interface range fastethernet0/1 - 5 Switch(config-if-range)# no shutdown 以下的例子显示使用句号来配置不同类型端口的组: Switch# configure terminal Switch(config)# interface range fastethernet0/1 - 3, gigabitethernet0/1 - 2 Switch(config-if-range)# no shutdown 1.2 配置二层端口 1.2.1 配置端口速率及双工模式

思科交换机基本配置(非常详细)

cisco交换机基本配置 1.Cisco IOS简介 Cisco Catalyst系列交换机所使用的操作系统是IOS(Internetwork Operating System,互联网际操作系统)或COS(Catalyst Operating System),其中以IOS使用最为广泛,该操作系统和路由器所使用的操作系统都基于相同的内核和shell。 IOS的优点在于命令体系比较易用。利用操作系统所提供的命令,可实现对交换机的配置和管理。Cisco IOS操作系统具有以下特点: (1)支持通过命令行(Command-Line Interface,简称CLI)或Web界面,来对交换机进行配置和管理。 (2)支持通过交换机的控制端口(Console)或Telnet会话来登录连接访问交换机。 (3)提供有用户模式(user level)和特权模式(privileged level)两种命令执行级别,并提供有全局配置、接口配置、子接口配置和vlan数据库配置等多种级别的配置模式,以允许用户对交换机的资源进行配置。 (4)在用户模式,仅能运行少数的命令,允许查看当前配置信息,但不能对交换机进行配置。特权模式允许运行提供的所有命令。 (5)IOS命令不区分大小写。 (6)在不引起混淆的情况下,支持命令简写。比如enable通常可简约表达为en。 (7)可随时使用?来获得命令行帮助,支持命令行编辑功能,并可将执行过的命令保存下来,供进行历史命令查询。 1.搭建交换机配置环境 在对交换机进行配置之前,首先应登录连接到交换机,这可通过交换机的控制端口(Console)连接或通过Telnet登录来实现。 (1)通过Console口连接交换机 对于首次配置交换机,必须采用该方式。对交换机设置管理IP地址后,就可采用Telnet登录方式来配置交换机。 对于可管理的交换机一般都提供有一个名为Console的控制台端口(或称配置口),该端口采用RJ-45接口,是一个符合EIA/TIA-232异步串行规范的配置口,通过该控制端口,可实现对交换机的本地配置。 交换机一般都随机配送了一根控制线,它的一端是RJ-45水晶头,用于连接交换机的控制台端口,另一端提供了DB-9(针)和DB-25(针)串行接口插头,用于连接PC机的COM1或COM2串行接口。Cisco的控制线两端均是RJ-45水晶头接口,但配送有RJ-45到DB-9和RJ-45到DB-25的转接头。 通过该控制线将交换机与PC机相连,并在PC上运行超级终端仿真程序,即可实现将PC机仿真成交换机的一个终端,从而实现对交换机的访问和配置。 Windows系统一般都默认安装了超级终端程序,对于Windows 2000 Server系统,该程序位于【开始】菜单下【程序】中【附件】的【通讯】群组下面,若没有,可利用控制面板中的【添加/删除程序】来安装。单击【通讯】群组下面的【超级终端】,即可启动超级终端。 首次启动超级终端时,会要求输入所在地区的电话区号,输入后将显示下图所示的连接创建对话框,在【名称】输入框中输入该连接的名称,并选择所使用的示意图标,然后单击确定按钮。 图9-2 超级终端连接创建对话框

思科路由器命令大全详解

一 switch> 用户模式 1:进入特权模式enable switch> enable switch# 2:进入全局配置模式configure terminal switch> enable switch#c onfigure terminal switch(conf)# 3:交换机命名hostname aptech2950 以aptech2950为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令enable password cisco 以cisco为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码enable secret ciscolab 以cicsolab为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab 6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface vlan 1 aptech2950(conf-if)#ip address 配置交换机端口ip和子网掩码 aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit aptech2950(conf)#ip default-gateway 设置网关地址 7:进入交换机某一端口interface fastehernet 0/17 以17端口为例switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface fastehernet 0/17 aptech2950(conf-if)# 8:查看命令show switch> enable

思科交换机配置常用命令(精编文档).doc

【最新整理,下载后即可编辑】 Cisco三层交换机配置命令及解释 (2011-07-11 08:54:50) 分类:IT资讯 标签: cisco 杂谈 基本配置 S> enable 进入特权模式 S# configure terminal 进入全局配置模式 S(config)# hostname name 改变交换机名称 S(config)# enable password level level_# password 设置用户口令(level_#=1)或特权口令(level_#=15) S(config)# line console 0 进入控制台接口 S(config-line)# password console_password 接上一条命令,设置控制台口令 S(config)# line vty 0 15 进入虚拟终端 S(config-line)# password telnet_password 接上一条命令,设置Telnet口令 S(config-line)# login 允许Telnet登录 S(config)# enable password|secret privilege_password 配置特权口令(加密或不加密) S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进入接口子配置模式 S(config-if)# [no] shutdown 关闭或启用该接口(默认启用) S(config)# ip address IP_address sunbet_mask 指定IP地址 S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认网关 S# show running-config 查看当前的配置 S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中

思科交换机配置常用命令

Cisco三层交换机配置命令及解释 (2011-07-11 08:54:50) 标签: 分类:IT资讯 cisco 杂谈 基本配置 S> enable 进入特权模式 S# configure terminal 进入全局配置模式 S(config)# hostname name 改变交换机名称 S(config)# enable password level level_# password 设置用户口令(level_#=1)或特权口令(level_#=15) S(config)# line console 0 进入控制台接口 S(config-line)# password console_password 接上一条命令,设置控制台口令 S(config)# line vty 0 15 进入虚拟终端 S(config-line)# password telnet_password 接上一条命令,设置Telnet口令 S(config-line)# login 允许Telnet登录 S(config)# enable password|secret privilege_password 配置特权口令(加密或不加密)S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进入接口子配置模式 S(config-if)# [no] shutdown 关闭或启用该接口(默认启用) S(config)# ip address IP_address sunbet_mask 指定IP地址 S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认网关 S# show running-config 查看当前的配置 S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中 S> show interface [type slot_#/port_#] 查看所有或指定接口的信息 S> show ip 显示交换机的IP配置(只在1900系列上可用) S> show version 查看设备信息 S# show ip interface brief 验证IP配置 S(config-if)# speed 10|100|auto 设置接口速率 S(config-if)# duplex auto|full|half 设置接口双工模式 S> show mac-address-table 查看CAM表 S# clear mac-address-table 清除CAM表中的动态条目 1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM 表中创建静态条目 2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# 在CAM表中创建静态条目 1900(config)# mac-address-table restricted static MAC_address source_port list_of_allowed_interface 设置静态端口安全措施 1900(config-if)# port secure 启用粘性学习 1900(config-if)# port secure max-mac-count value 设置粘性学习特性能够学到的地址数量(默认132,取值范围是1-132)

CISCO 常用命令解释

视图模式介绍: 普通视图 router> 特权视图 router# /在普通模式下输入enable 全局视图 router(config)# /在特权模式下输入config t 接口视图 router(config-if)# /在全局模式下输入int 接口名称例如int s0或int e0 路由协议视图 router(config-route)# /在全局模式下输入router 动态路由协议名称 1、基本配置: router>enable /进入特权模式 router#conf t /进入全局配置模式 router(config)# hostname xxx /设置设备名称就好像给我们的计算机起个名字 router(config)#enable password /设置特权口令 router(config)#no ip domain lookup /不允许路由器缺省使用DNS解析命令 router(config)# Service password-encrypt /对所有在路由器上输入的口令进行暗文加密router(config)#line vty 0 4 /进入设置telnet服务模式 router(config-line)#password xxx /设置telnet的密码 router(config-line)#login /使能可以登陆 router(config)#line con 0 /进入控制口的服务模式 router(config-line)#password xxx /要设置console的密码 router(config-line)#login /使能可以登陆 2、接口配置: router(config)#int s0 /进入接口配置模式 serial 0 端口配置(如果是模块化的路由器前面加上槽位编号,例如serial0/0 代表这个路由器的0槽位上的第一个接口) router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码router(config-if)#enca hdlc/ppp 捆绑链路协议 hdlc 或者 ppp 思科缺省串口封装的链路层协议是HDLC所以在show run配置的时候接口上的配置没有,如果要封装为别的链路层协议例如PPP/FR/X25就是看到接口下的enca ppp或者enca fr router(config)#int loopback /建立环回口(逻辑接口)模拟不同的本机网段 router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码给环回口 在物理接口上配置了ip地址后用no shut启用这个物理接口反之可以用shutdown管理性的关闭接口 3、路由配置: (1)静态路由 router(config)#ip route xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 下一条或自己的接口router(config)#ip route 0.0.0.0 0.0.0.0 s 0 添加缺省路由 (2)动态路由 rip协议 router(config)#router rip /启动rip协议 router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段 router(config-router)#version 2 转换为rip 2版本 router(config-router)#no auto-summary /关闭自动汇总功能,rip V2才有作用 router(config-router)# passive-int 接口名 /启动本路由器的那个接口为被动接口

思科2960交换机配置命令

思科2960交换机配置命令 交换机的端口工作模式一般可以分为三种:Access(普通模式),Multi(多vlan模式),Trunk(中继模式)。1、允许多个vlan的是multi模式,而不是trunk 模式。2、两个都设为trunk模式:一:如果在同一交换机上,则决不会在同一vlan;二:如果是两个交换机上,且两端口物理连接的话,共享vlan信息。但是这两个端口已经被使用,所以只能说,使用与这两个端口相同vlan的端口的计算机是同一虚拟局域网。3、access和multi模式下,端口用于计算机;trunk 模式下,端口用于交换机间连接。所以access和trunk没有可比性。 交换机基本状态: switch ;ROM状态,路由器是rommon hostname ;用户模式 hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态 交换机口令设置: switchenable ;进入特权模式 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 ;设置登录口令xx switch#exit ;返回命令

nb思科交换机常用命令

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.在基于IOS的交换机上启用和浏览CDP信息:

switch(config-if)# cdp enable switch(config-if)# no cdp enable 为了查看Cisco邻接设备的CDP通告信息: switch# show cdp interface [type modle/port] switch# show cdp neighbors [type module/port] [detail] 在基于CLI的交换机上启用和浏览CDP信息: switch(enable) set cdp {enable|disable} module/port 为了查看Cisco邻接设备的CDP通告信息: switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述: switch(config-if)# description description-string 基于CLI的交换机的端口描述: switch(enable)set port name module/number description-string 6.在基于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}

CISCO基本命令

端口速度:设置端口速度为:100Mbps/s 半双工模式 Switch# configure terminal Switch(config)# interface range gigabitethernet0/1 - 2 Switch(config-if-range)# speed 100 Switch(config-if)# duplex half 定义端口聚合并存储到NVRAM:定义名称为enet_list的端口组。 Switch# configure terminal Switch(config)# define interface-range enet_list gigabitethernet0/1 - 2 Switch(config)# end Switch# show running-config | include define Switch# define interface-range enet_list gigabitethernet0/1 – 2 Switch# configure terminal Switch(config)# no define interface-range enet_list Switch(config)# end Switch# show run | include define Switch# 设置端口类型: Switch(config-if)media-type auto-select | rj45 | sfp Switch#show interfaces interface-id transceiver properties

思科交换机配置命令大全

思科交换机配置命令大全 switch> 用户模式 1:进入特权模式 enable switch> enable switch# 2:进入全局配置模式 configure terminal switch> enable switch#configure terminal switch(conf)# 3:交换机命名 hostname aptech2950 以aptech2950为例 switch> enable switch#configure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令 enable password cisco 以cisco为例 switch> enable switch#configure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码 enable secret ciscolab 以cicsolab为例 switch> enable switch#configure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab 6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#configure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface vlan 1 aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码 aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit aptech2950(conf)#ip default-gateway 192.168.254 设置网关地址 7:进入交换机某一端口 interface fastehernet 0/17 以17端口为例switch> enable switch#configure terminal

相关文档
最新文档