文档库 最新最全的文档下载
当前位置:文档库 › Cisco命令详解

Cisco命令详解

Cisco命令详解
Cisco命令详解

交换机支持的命令:

交换机基本状态switch 路由器是rommon>

hostname> 用户模式hostname# 特权模式

hostname(config)# 全局配置模式

hostname(config-if)# 接口状态交换机口令设置:

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 设置登录口令xx

switch#exit 返回命令交换机VLAN设置:

switch#vlan database 进入VLAN设置

switch(vlan)#vlan 2 建VLAN 2

switch(vlan)#no vlan 2 删vlan 2

switch(config)#int f0/1 进入端口1

switch(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模式

交换机设置IP地址:

switch(config)#interface vlan 1 进入vlan 1

switch(config-if)#ip address 设置IP地址

switch(config)#ip default-gateway 设置默认网关

switch#dir flash: 查看闪存交换机显示命令:

switch#write 保存配置信息

switch#show vtp 查看vtp配置信息

switch#show run 查看当前配置信息

switch#show vlan 查看vlan配置信息

switch#show interface 查看端口信息

switch#show int f0/0 查看指定端口信息

路由器支持的命令:

路由器显示命令:

router#show run 显示配置信息\

router#show interface 显示接口信息

router#show ip route 显示路由信息

router#show cdp nei 显示邻居信息

router#reload重新起动

路由器口令设置:

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 返回命令

路由器配置:

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 设置第二个IP

router(config-if)#int f0/0.1 进入子接口

router(config-subif.1)#ip address 设置子接口IP

router(config-subif.1)#encapsulation dot1q 绑定vlan中继协议

router(config)#config-register 0x2142 跳过配置文件

router(config)#config-register 0x2102 正常使用配置文件

router#reload 重新引导路由器文件操作:

router#copy running-config startup-config 保存配置

router#copy running-config tftp 保存配置到tftp

router#copy startup-config tftp 开机配置存到tftp

router#copy tftp flash: 下传文件到flash

router#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 引导IOS

静态路由:

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 默认路由举例动态路由:router(config)#ip routing 启动路由转发

router(config)#router rip 启动RIP路由协议。

router(config-router)#network 设置发布路由

router(config-router)#negihbor 点对点帧中继用。

帧中继命令:

router(config)#frame-relay switching 使能帧中继交换

router(config-s0)#encapsulation frame-relay 使能帧中继

router(config-s0)#fram-relay lmi-type cisco 设置管理类型

router(config-s0)#frame-relay intf-type DCE 设置为DCE

router(config-s0)#frame-relay dlci 16

router(config-s0)#frame-relay local-dlci 20 设置虚电路号

router(config-s0)#frame-relay interface-dlci 16

router(config)#log-adjacency-changes 记录邻接变化

router(config)#int s0/0.1 point-to-point 设置子接口点对点

router#show frame pvc 显示永久虚电路

router#show frame map 显示映射

基本访问控制列表:

router(config)#access-list permit|deny

router(config)#interface

default:deny any

router(config-if)#ip access-group in|out

default:out

例1:

router(config)#access-list 4 permit 10.8.1.1

router(config)#access-list 4 deny 10.8.1.0 0.0.0.255

router(config)#access-list 4 permit 10.8.0.0 0.0.255.255

router(config)#access-list 4 deny 10.0.0.0 0.255.255.255

router(config)#access-list 4 permit any

router(config)#int f0/0

router(config-if)#ip access-group 4 in

扩展访问控制列表:

access-list permit|deny icmp [type]

access-list permit|deny tcp [port]

例3:

router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo

router(config)#access-list 101 permit ip any any router(config)#int s0/0 router(config-if)#ip access-group 101 in

例3:

router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80 router(config)#access-list 102 permit ip any any

router(config)#interface s0/1

router(config-if)#ip access-group 102 out

删除访问控制例表:

router(config)#no access-list 102

router(config-if)#no ip access-group 101 in 路由器的nat配置

Router(config-if)#ip nat inside 当前接口指定为内部接口

Router(config-if)#ip nat outside 当前接口指定为外部接口

Router(config)#ip nat inside source static [p] <私有IP><公网IP> [port] Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1

Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80 Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0

Router(config)#ip nat inside source list 1 pool p1

Router(config)#ip nat inside destination list 2 pool p2

Router(config)#ip nat inside source list 2 interface s0/0 overload

Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary Router#show ip nat translation

rotary 参数是轮流的意思,地址池中的IP轮流与NAT分配的地址匹配。

overload参数用于PAT 将内部IP映射到一个公网IP不同的端口上。

外部网关协议配置:

routerA(config)#router bgp 100

routerA(config-router)#network 19.0.0.0

routerA(config-router)#neighbor 8.1.1.2 remote-as 200

配置PPP验证:

RouterA(config)#username password

RouterA(config)#int s0

RouterA(config-if)#ppp authentication {chap|pap} 3.

PIX防火墙命令Pix525(config)#nameif ethernet0 outside security0

命名接口和级别Pix525(config)#interface ethernet0 auto

设置接口方式Pix525(config)#interface ethernet1 100full

设置接口方式Pix525(config)#interface ethernet1 100full shutdown

Pix525(config)#ip address inside 192.168.0.1 255.255.255.0

Pix525(config)#ip address outside 133.0.0.1 255.255.255.252

Pix525(config)#global (if_name) natid ip-ip

定义公网IP区间Pix525(config)#global (outside) 1 7.0.0.1-7.0.0.15

例句Pix525(config)#global (outside) 1 133.0.0.1

例句Pix525(config)#no global (outside) 1 133.0.0.1 \

去掉设置

Pix525(config)#nat (if_name) nat_id local_ip [netmark]

Pix525(config)#nat (inside) 1 0 0 内网所有主机(0代表0.0.0.0)可以访问global 1指定的外网。

Pix525(config)#nat (inside) 1 172.16.5.0 255.255.0.0 内网172.16.5.0/16网段的主机可以访问global 1指定的外网。

Pix525(config)#route if_name 0 0 gateway_ip [metric] 命令格式

Pix525(config)#route outside 0 0 133.0.0.1 1

例句Pix525(config)#route inside 10.1.0.0 255.255.0.0 10.8.0.1 1

例句Pix525(config)#static (inside,outside) 133.0.0.1 192.168.0.8 表示内部ip地址192.168.0.8,访问外部时被翻译成133.0.0.1全局地址。

Pix525(config)#static (dmz,outside) 133.0.0.1 172.16.0.8 中间区域ip地址172.16.0.8,访问外部时被翻译成133.0.0.1全局地址。

Cisco路由器的基础配置

1、路由器模式详解:

Router>用户模式,通常用来查看统计信息,但不能修改路由器的设置。

Router#特权模式,可以查看并修改路由器的配置,通常在这里运行show命令。

Router(config)# 全局模式,在这里修改当前运行配置中的内容。

Router(config-if)#接口模式,用来配置路由器的物理接口和环回接口。

Router(config-line)#控制台接口模式,通常用来配置用户模式口令,如Telnet的登录密码。Router(config-subif)#子接口模式,用来配置在路由器中创建的逻辑接口

Router(config-router)#路由协议接口模式,在这里配置路由协议,如RIP、OSPF、IGRP等。

2、常用的show命令:

查看路由信息Router#show ip route

查看路由器版本Router#show version

查看路由器flash Router#show flash:

查看历史命令记录Router#show history

查看路由器ARP表Router#show arp

查看路由器的时间设置Router#show clock

查看接口简要信息Router#show ip interface brief

查看接口物理相关信息Router#show interfaces s0/0

查看接口协议相关信息Router#show ip interface s0/0

查看路由器运行配置文件Router#show running-config

查看当前所有连接到路由器的用户Router#show users

查看会话记录,经常在终端上使用Router#show session

查看特定接口的硬件信息Router#show controllers s0/0

查看全局和接口的第三层协议的特定状态Router#show protocols

查看下次路由器重新加载时将要使用的配置Router#show startup-config

CDP思科发现协议,查看直连的相邻设备及其详细信息

Router#show cdp neighbors

3、登录路由器必要的配置:

Router>enable //进入特权模式

Router#configure terminal //进入全局模式

Router(config)#hostname R1 //配置路由器的主机名

R1(config)#no ip domain-lookup//关闭动态的域名解析,作用是当我们输入错误命令的时候,路由器会认为这条命令没有错误,它只是一个域名的形式,路由器会进行解析,从而浪费宝贵的时间。R1(config)#line console 0 //进入控制台

R1(config-line)#exec-timeout 0 0 //关闭控制台的会话超时,也可用命令no exec-timeout,当长时间不去操作路由器的时候,路由器会自动的终止与我们的对话连接,跳转到非连接状态,这时候,需要输入enable 密码重新登录,从某种意义上来讲是对安全性得到了保证,但对我们的操作却是十分的不方便。

R1(config-line)#logging synchronous //关闭日志同步,抑制控制台的提示信息,使得路由器发送的控制台屏幕的消息不会附加到命令行中。

路由器的口令设置

Router>enable//进入特权模式

Router#configure terminal //进入全局模式

Router(config)#enable password cisco1 //配置进入特权模式的密码(明文密码),使用命令show running-config可以查看到设置的密码。

Router(config)#enable secret cisco2 //配置进入特权模式的密码(密文密码),使用命令show running-config查看时,设置的密码是以密文显示,权限更高。

Router(config)#line console 0 //进入控制台

Router(config-line)#password cisco //设置登录到路由器的密码,在进入用户模式时验证。Router(config-line)#login //启用登录

Router(config-line)#line vty 0 4 //设置telnet访问路由器的5条线路,也可在全局模式下进入

Router(config)#line vty 0 4。

Router(config-line)#password cisco //设置telnet到路由器的密码,如果不设置此密码,服务将无法启动。

Router(config-line)#login

Router(config-line)#line aux 0

Router(config-line)#password 123 //设置辅助接口的密码

Router(config-line)#login

Router(config-line)#exit //退出

Router(config)#service password-encryption//此命令用来加密口令,对路由器配置的所有口令都进行加密,如设置的enable password查看时是以明文显示,使用此命令后,通过命令show running-config查看时,是以密文显示。

路由器或交换机上常用的测试和诊断命令及其功能

1、通用测试、诊断命令

1) ping x.x.x.x -------- 标准ping命令,用于测试设备间的物理连通性

2) ping -------- 扩展ping命令,用于测试设备间的物理连通性。扩展ping命令还支持灵活定义ping参数,如ping数据包的大小、发送包的个数、等待响应数据包的超时时间等

3) traceroute x.x.x.x -------- 用于跟踪、显示路由信息

4) show running-config -------- 用于显示路由器、交换机运行配置文件的内容

5) show startup-config -------- 用于显示路由器、交换机启动配置文件的内容

6) show sessions -------- 用于显示从当前设备发出的所有呼出Telnet会话

7) disconnect -------- 用于断开与远程目标主机的Telnet会话

8) show users -------- 用于查看呼入Telnet会话情况

9) clear line -------- 用于断开远程主机的呼入Telnet连接

10) shutdown -------- 用于临时将某个接口关闭

11) no shutdown -------- 用于手动启动(激活)处于管理性关闭的接口

12) show arp -------- 用于显示ARP缓存(ARP表)的内容

13) show ip arp -------- 用于显示IP ARP缓存(ARP表)的内容

14) show ip interface -------- 用于显示IP接口的状态及配置信息

15) show version -------- 用于显示路由器硬件配置、软件版本等信息

16) show etherchannel summary -------- 用于显示端口捆绑的简要信息

17) Ctrl+Shift+6+x -------- 也被称为退出序列,用于终止正在执行的某条命令或操作,也用于从呼出Telnet会话中暂时切换到本地连接

18) dir flash -------- 用于显示闪存中的文件清单

19) dir nvram -------- 用于显示非易失性内存中的文件清单

20) show debugging -------- 用于显示正在进行的诊断过程清单

21) undebug all -------- 用于停止所有诊断过程

2、VLAN、VTP测试、诊断命令

1) show interface vlan vlan-num -------- 用于显示VLAN是否已激活、交换机MAC地址、接口参数等

2) show mac-address-table -------- 用于显示CAM,即桥接表的内容。该命令可列出学习到的主机MAC地址及其所属VLAN、所处端口、条目类型((静态static)、(动态dynamic)等)以及满足列表条件的MAC地址数目

3) show vlan -------- 用于查看VLAN创建情况。该命令可以显示系统所有的VLAN信息,包括VLAN编号、VLAN名称、VLAN状态、VLAN成员等信息

4) show vtp status -------- 用于检查VTP配置情况

3、生成树测试、诊断命令

1) show spanning-tree -------- 用于显示生成树协议中交换机及其端口的情况

2) show spanning-tree blockedports -------- 用于显示处于阻塞状态的端口

3) show spanning-tree detail -------- 用于显示生成树详细信息

4) show spanning-tree interface -------- 用于显示生成树中某端口相关状态

5) show spanning-tree vlan -------- 当有多个VLAN时,Catalyst交换机会为每个VLAN运行一个生成树实例。此命令用于显示指定VLAN的生成树内容

6) show spanning-tree summary -------- 用于显示生成树总结,包括本交换机是哪些VLAN 的根网桥、端口快速特性是否启用、处于生成树各个端口状态的端口数量等信息

4、路由和路由协议测试、诊断命令

1) show ip route -------- 用于显示当前路由表内容

2) show ip protocols -------- 用于显示动态路由协议的配置参数信息

5、ACL测试、诊断命令

1) show access-lists -------- 用于显示所有已定义的访问控制列表内容及命中情况

2) show ip access-lists -------- 用于显示所有已定义的ip访问控制列表内容及命中情况

6、NAT测试、诊断命令

1) show ip nat translation -------- 显示当前正在进行的NAT情况

2) show ip nat translation verbose -------- 用于显示当前正在进行的NAT更为详细的情况

3) show ip nat statistics -------- 用于显示NAT运行情况统计

4) debug ip nat -------- 用于打开对NAT的诊断

7、远程访问测试、诊断命令

1) show line -------- 用于查看当前系统所有的线路及其状态

2) show modemcap -------- 用于显示当前路由器可以自动配置的Modem列表

3) debug ppp negotiation -------- 用于打开对ppp参数协商的诊断

4) debug ppp authentication -------- 用于打开对ppp身份认证过程的诊断

8、CDP测试、诊断命令

1) show cdp -------- 用于显示CDP全局参数信息

2) show cdp neighbors -------- 用于显示CDP邻居设备的摘要信息

3) show cdp neighbors detail -------- 用于显示CDP邻居设备的详细信息,包括:邻居设备名称、邻居设备接口IP地址、邻居设备软件版本信息、设备性能、设备平台、本地设备接口、邻居设备接口、CDP缓存条目保持时间、CDP广播版本、接口双工方式等

4) show cdp entry -------- 用于显示指定邻居设备的相关信息

5) show cdp interface -------- 用于显示本地设备各个接口的状态、接口封装格式、CDP包的周期发送时间以及CDP保持时间等

6) show cdp traffic -------- 用于显示和CDP相关的流量统计信息,包括接收和发送的CDP 包数量,包括头部错误、校验错误、封装错误等在内的错误数量等

思科交换机命令大全

思科交换机常用命令大全 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配置命令汇总 第一章 命令作用简便拼法 show version 检验路由器启动过程①sh ve enable 进入特权执行模式en conf t 进入全局配置模式conf (enter两次)在全局配置模式下Router(config)# hostname name 命名路由器ho +name enable secret password 设置使能密码ena s line console 0 进入console配置模式li co (config-line)#password password 配置console口密码pa +name config-line)#login 登陆logi line vty 0 4 设置远程控制接口限制li v config-line)#password 设置远程控制登陆密码pa +password (config-line)#login 登陆logi interface type number (such as f0/0 se0/0/0) 进入接口配置模式int + (such as f0/0 se0/0/0) config-if)# ip address address mask 设置接口ip地址和子网掩码ip add(删除前面加no)config-if)#description 设置描述内容de config-if)#no shutdown 开启no sh(关闭shutdown)在特权模式下(Router#) copy running-config startup-config 保存路由器更改cop run sta show running-config 查看路由器运行文件sh run show ip route 查看路由表sh ip rou show ip interface brief 查看各个接口状态sh ip int br show interfaces 查看各个接口的详细信息sh int clock rate+number 配置串行接口上的时钟信号cl ra+number show controllers+接口 (s0/0/0) 确定路由器接口连接的电缆sh co debug ip routing 启动调试功能de ip rou

CISCO命令全集

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 地址和掩码

cisco交换机(Switch)配置命令大全

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} 在基于CLI的交换机上设置以太网的链路模式: switch(enable) set port duplex module/number {full|half}

思科交换机命令大全

思科交换机命令大全集团文件发布号:(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

Cisco设备的基本配置命令

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 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#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface fastehernet 0/17 aptech2950(conf-if)#

思科命令解释大全

CISCO 命令 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 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#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface fastehernet 0/17 aptech2950(conf-if)#

Cisco的命令大全

Cisco的命令大全 序号/类别基于ios的交换机命令基于CLI的交换机命令 1.设置主机名/系统名 switch(config)# hostname "hostname" switch(enable) set sys tem name name-string 2.设置登录口令 switch(config)# enable password level 1 password switch(enable) set password switch(enable) set enalbepass 3.设置远程访问 switch(config)# inte***ce vlan 1 switch(config-if)# ip address ip-address netmask switch(config-if)# ip default-gateway ip-address switch(enable) set inte***ce s c0 ip-address netmask broadcast-address switch(enable) set inte***ce sc0 vlan switch(enable) set ip route default gateway 4.启用和浏览CDP信息 switch(config-if)# cdp enable switch(config-if)# no cdp enable switch(enable) set cdp {enable|disable} module /port 5.查看Cisco邻接设备的CDP通告 switch# show cdp inte***ce [type modle/port] switch# show cdp neighbors [type module/port] [detail] switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 6.端口描述 switch(config-if)#description escription-string switch(enable)set p ort name module/number description-string 7.设置端口速度 switch(config-if)# speed{10|100|auto} switch(enable) set port s peed moudle/number {10|100|auto} switch(enable) set port speed moudle/number {4|16|auto} 8.设置以太网的链路模式 switch(config-if)# duplex {auto|full|half} switch(enabl e) set port duplex module/number {full|half 9.配置静态VLAN switch# vlan database switch(vlan)# vlan vlan-num name vla switch(vlan)# exit switch# configure teriminal switch(config)#inte***ce inte***ce module/number switch(config-if)# switchport mode access switch(config-if)# switchport access vlan vlan-num switch(config-if)# end switch(enable) set vlan vlan-num [name name] switch(enable) set vlan vlan-num mod-num/port-list 10.配置VLAN中继线 switch(config)# inte***ce inte***ce mod/port

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

思科交换机路由器命令 大全 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常用命令解释汇总

视图模式介绍: 普通视图ro u ter>特权视图router#/ 在普通模式下输入en abl e 全局视图rou ter(con fi g)#/ 在特权模式下输入con figt 接口视图rou ter(con fi g-i f)#/在全局模式下输入in t 接口名称例如in ts0或 in te0路由协议视图 ro uter(con fi g-rou te )#/ 在全局模式下输入ro u ter动态路由协议名称 1、基本配置: ro uter>en abl e/进入特权模式 ro uter#con ft/ 进入全局配置模式 ro uter(con fi g)#ho stn a mex xx/设置设备名称就好像给我们的计算机起个名字 ro uter(con fi g)#en abl epasswo rd/设置特权口令ro uter(con fi g)#n oi pdo ma inl ook up/不允许路由器缺省使用DN S解析命令 ro uter(con fi g)#Serv icepa sswo rd-en crypt/对所有在路由器上输入的口令进行暗文加密

ro uter(con fi g)#li n ev ty04/进入设置teln et服务模式ro uter(con fi g-l in e)#passwo rdx xx/设置teln et 的密码ro uter(con fi g-l in e)#lo gi n/使能可以登陆 ro uter(con fi g)#li n econ0/进入控制口的服务模式 ro uter(con fi g-l in e)#passwo rdx xx/要设置con so l e 的密码rou ter(con fi g-lin e)#lo gi n/使能可以登陆 2、接口配置: ro uter(con fi g)#in ts0/ 进入接口配置模式seria l0 端口配置(如果是模块化的路由器前面加上槽位编号,例如seria l0/0代表这个路由器的0 槽位上的第一个接口) ro uter(con fi g-i f)#ipa ddxx x.xxx.x xx.x xxx xx.x xx.xx x.xx x/添加ip地址和掩码 ro uter(con fi g-i f)#enca hdl c/ppp捆绑链路协议hdlc或者ppp思科缺省串口封装的链路层协议是 H DLC所以在sho wru n配置的时候接口上的配置没有,如果要封装为别的链路层协议例如 PPP/FR/X25就是看到接口下的en cappp 或者en ca fr ro uter(con fi g)#in tl oo pba ck/建立环回口(逻辑接口)模拟不同的本机网段

cisco配置命令大全

933a LMI使用Q933A标准.LMI(Local management Interface)有3种:ANSI:T1.617;CCITTY:Q933A和CISCO特有的标准。 # fram-relay intf-typ ABC ABC为帧中继设备类型,它们分别是DTE设备,DCE交换机或NNI(网络接点接口)支持。# frame_relay interface_dlci 110 br 配置DLCI(数据链路连接标识符)。 # frame-relay map ip ABCD XXXX broadcast 建立帧中继映射。ABCD为对方ip地址,XXXX为本地DLCI号,broadcast允许广播向前转发或更新路由。 # no shutdown 激活本端口. # exit ---- 5 .帧中继子接口的配置: # conf t # int s0.1 point-to-point

对应S0的子接口1,点对点方式。 # ip addr ABCD XXXX ABCD为子口1的IP地址,XXXX为子网掩码。# frame-relay intreface-dlci 100 br 6.配置拨号备份 (1).配置备份主口 # conf t # int s0 S0为主口. # backup int asy 1 A1口为备份口. # backup delay 0 1 延时1秒. (2).配置虚拟接口 # conf t # ip addr ABCD XXXX

ABCD为虚拟接口IP地址,XXXX为子网掩码。 # encap ppp 封装ppp协议. # dialer in-band 激活随叫随拨功能. # dialer idle-timeout 7200 # dialer map ip ABCD modem-script call broadcast 6225481 br 映射对应的拨号口.ABCD为对方拨号口的ip地址,6225481为对应的电话号码。 # dialer_group 1 定义拨号组成员. (3).配置防火墙 # dialer_list 1 pro ip permit 允许ip协议通过。 (4).配置连接口令 # user name ABCD pass XXXX ABCD为对方主机名,XXXX为连接口令. (5).配置拨号字符串

思科路由器命令大全详解

一 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

思科基本配置命令详解

思科交换机基本配置实例讲解

目录 1、基本概念介绍............................................... 2、密码、登陆等基本配置....................................... 3、CISCO设备端口配置详解...................................... 4、VLAN的规划及配置........................................... 4.1核心交换机的相关配置..................................... 4.2接入交换机的相关配置..................................... 5、配置交换机的路由功能....................................... 6、配置交换机的DHCP功能...................................... 7、常用排错命令...............................................

1、基本概念介绍 IOS: 互联网操作系统,也就是交换机和路由器中用的操作系统VLAN: 虚拟lan VTP: VLAN TRUNK PROTOCOL DHCP: 动态主机配置协议 ACL:访问控制列表 三层交换机:具有三层路由转发能力的交换机 本教程中“#”后的蓝色文字为注释内容。 2、密码、登陆等基本配置 本节介绍的内容为cisco路由器或者交换机的基本配置,在目前版本的cisco交换机或路由器上的这些命令是通用的。本教程用的是cisco的模拟器做的介绍,一些具体的端口显示或许与你们实际的设备不符,但这并不影响基本配置命令的执行。 Cisco 3640 (R4700) processor (revision 0xFF) with 124928K/6144K bytes of memory. Processor board ID 00000000 R4700 CPU at 100MHz, Implementation 33, Rev 1.2

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 接口名 /启动本路由器的那个接口为被动接口

思科命令大全

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]

cisco调试用命令大全

Cisco系列网络设备测试命令大全 ? Cisco系列网络设备测试命令大全 ?1、show命令: 1)全局命令: show version ;显示系统硬件和软件版本、DRAM、Flash show startup-config ;显示写入NVRAM中的配置内容 show running-config ;显示当前运行的配置内容 show buffers ;详细输出buffer的名称和尺寸 show stacks ;提供路由器进程和处理器利用率信息,用stack decode show tech-support ;显示几个show命令的输出 show access-lists ;查看访问列表配置 show memory ;用于测试内存问题 2)接口相关命令 show queueing [fair|priority|custom] show queue e0/1 ;查看接口上队列的设置和操作 show interface e0/1 ;Cisco缺省的Ethernet封装方法是ARPA show ip interface e0/1 ;显示指定接口的TCP/IP配置信息 3)进程相关命令 show processes cpu ;显示路由器CPU的使用率和当前的进程 show processes memory ;显示路由器当前进程的内存使用情况 4) TCP/IP协议相关命令 Show ip access-list ;显示IP访问列表(1-199) Show iparp ;显示路由器的ARP缓存(IP、MAC、封装类型、接口) Show ip protocols ;显示运行在路由器上的IP路由协议的信息 Show ip route ;显示IP路由表中的信息 Show ip traffic ;显示IP流量统计信息 ?2、debug命令 DEBUG不应在CPU使用率超过50%的路由器上运行。 1)限制debug输出 在使用DEBUG获得所需数据后,要关闭Debug 使路由器对所有消息都配置使用时间戳: Router#service timestamps debug datetimemseclocaltime Router#service timestamp log datetimemseclocaltime 缺省,error和debug信息仅发送到console,telnet到路由器上看不到debug和log

思科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 ;返回命令

相关文档