CISCO常用命令

CISCO常用命令
CISCO常用命令

交换机命令总结

交换机口令设置:

switch>enable 进入特权模式

switch#config terminal 进入全局配置模式

switch(config)#hostname 设置交换机的主机名

switch(config)#enable secret xxx 设置特权加密口令

switch(config)#enable password xxa 设置特权非密口令

使用Telnet远程式管理

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

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

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

switch(config)#line vty 0 4 进入虚拟终端

switch(config-line)#login 允许登录

switch(config-line)#password xx 设置登录口令

switch#exit 返回命令

控制台口令

switch(config)#line console 0 进入控制台口

switch(config-line)#login 允许登录

switch(config-line)#password xx 设置登录口令

switch#exit 返回命令

基本接口配置

switch(config)#interface f0/1 进入f0/1接口

switch(config-if)#duplex full 配置全双工模式

switch(config-if)#speed 100 配置速率

switch(config-if)#description to ***** 接口描述

switch(config)#ip domain-name ***.com 设置或名服务器

switch(config)#mac-address-table aging-time <10-1000000> 设置mac表超时时间switch#write 保存配置信息

switch#copy running-config startup-config 保存当前配置nvram

switch#erase startup-config 清除配置文件

交换机VLAN设置:

switch#vlan database 进入VLAN设置

switch(vlan)#vlan 2 建VLAN 2

switch(vlan)#name 名字建VLAN 2的名称

switch(vlan)#no vlan 2 删vlan 2

注:删除vlan时原属于此vlan的端口处于非激活状态,直到重新分配为止

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

switch(config-if)#switchport mode access 当前端口工作莫试

switch(config-if)#switchport access vlan 2 当前端口加入vlan 2

switch(config-if)#switchport mode trunk 设置为干线

switch(config-if)#switchport trunk encapsulation dot1q 设置vlan 中继协议switch(config-if)#no switchport mode 或( switchport mode access) 禁用干线switch(config-if)#switchport trunk allowed vlan add 1,2 ;从Trunk中添加vlans

switch(config-if)#switchport trunk allowed vlan remove 1,2 ;从Trunk中删除vlans

switch(config-if)#switchport trunk pruning vlan remove 1,2 ;从Trunk中关闭局部修剪

以太网通道配置

switch(config)#interface range fasternet0/1 - 2 将fasternet0/1和0/2 口捆绑(成双不成单) switch(config-if)#channel-group 1 mode on 配置以太通道模式

switch(config-if)#port-channel load-balance {dst-mac | src-mac}在链路间实现负载均衡

switch#show etherchannel 1 summary 查看通道信息

switch#show etherchannel load-balance 查看通道信息

vtp配置

switch(config)#vtp domain 设置vtp域名

switch(config)#vtp password 设置vtp密码

switch(config)#vtp mode server 设置vtp服务器模式

switch(config)#vtp mode client 设置vtp客户机模式

switch(config)#vtp mode transparent 设置vtp 透明模式

switch(config)#vtp version <1> <2> 设置vtp版本

switch(config)#vtp pruning 启用vtp修解

switch(config)#no vtp pruning 关闭vtp修解

注:要想从vtp中减少一台交换机只需将该交换机vtp 名更改

生成树stp:

switch(config)#spanning-tree vlan 启用stp生成树(基于vlan)

switch(config)#spanning-tree vlan root primary 指定根交换机(基于vlan)switch(config)#spanning-tree vlan root secondary 指定备用根交换机(基于vlan)switch(config)#spanning-tree vlan priority <0-65535> 指定交换机优先级(基于vlan)switch(config)#no spanning-tree vlan priority 将交换机的优先级恢复默认值(基于vlan)

switch(config-if)#spanning-tree vlan cost <0-200000000> 指定端口成本(起用trunk 的端口模式下)

switch(config-if)#spanning-tree vlan port-prioty <0-255> 指定交换机端口优先级(基于vlan)

switch(config-if)#spanning-tree portfast 配置速端口(连接终端设备的端口状态)如pc机switch(config)#spanning-tree uplinkfast 配置上行速端口

注:在配置上行速端口前要先将基于vlan上的网桥优先级,网桥成本恢复默认值。起用了该命令后在进行优先级更改,

switch(config)#spanning-tree vlan hello-time <1-10> 配置交换机hello时间(基于vlan)

switch(config)#spanning-tree vlan forward-time <4-30> 修改转发延迟计时器(基于vlan)

switch(config)#spanning-tree vlan max-time <6-40> 修改最大老化时间(基于vlan)

注:vlan为可选参数,当没有该参数时将修改所有vlan网桥的优先级\及所有的vlan端口成本switch#show spanning-tree summery 检测vlan生成树配置

switch#show spanning-tree vlan detail 浏览详细生成树配置信息

switch#show spanning-tree interface detail 浏览详细生成树端口配置信息

交换机显示命令:

switch#show vtp status 查看vtp配置信息

switch#show running-config 查看当前配置信息

switch#show vlan 查看vlan配置信息

switch#show interface 查看端口信息

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

switch#dir flash: 查看闪存

switch#show version 查看当前版本信息

switch#show mac-address-table aging-time 查看mac超时时间

switch#show cdp cisco设备发现协议(可以查看聆接设备)

switch#show cdp traffic 杳看接收和发送的cdp包统计信息

switch#show cdp neighbors 查看与该设备相邻的cisco设备

switch#show interface f0/1 switchport 查看有关switchport的配置

switch#show cdp neighbors 查看与该设备相邻的cisco设备2950交换机密码恢复

拨下交换机的电源线

用手按在mode按键上,插上电源线。

看到出现flash_init load_helper boot switch: 画面时松开mode键

在switch:后执行flash_init命令查看flash中的文件

把config.text 文件改名为"config.old rename flash:config.text flash:config.old

执行boot命令启动交换机

交换机出现是否进入配置的对话, 执行no命令

进入特权模式查看flash文件执行enable 在switch#show flash:

把config.old改为config.text rename flash:config.old flash:config.text

把config.text考入系统的running-config

copy flash:config.text system:running-config

重新设置密码并存盘

路由器命令总结

路由器命令状态:

>> 路由器处于rxboot状态,开机60秒内按ctrl+break可进入此状态用于软件升级和手工引导.

router>用户命令状态,只能查看一些基本信息

router#特权命令状态

router(config)#全局设置状态

router(config-if)#接口设置状态

路由器口令设置:

router>enable 进入特权模式

router#config terminal 进入全局配置模式

router(config)#hostname 设置交换机的主机名

router(config)#enable secret xxx 设置特权加密口令

router(config)#enable password xxx 设置特权非密口令

控制台口令

router(config)#line console 0 进入控制台口

router(config-line)#login 要求口令验证

router(config-line)#password xx 设置登录口令

使用Telnet远程式管理

router(config)#line vty 0 4 进入虚拟终端

router(config-line)#login 要求口令验证

router(config-line)#password xx 设置登录口令

路由器基本配置:

router(config)#int s0/0 进入Serail接口

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

router(config-if)#ip address second 设置第二个IP

router(config-if)#description to ***** 接口描述

router(config-if)#no shutdown 激活当前接口

router(config-if)#clock rate 64000 设置同步时钟(仅用于串口)

router(config-if)#clock rate 64 设置带宽(仅用于串口)

router(config-if)#ip ospf authentication-key 口令为ospf设置认证(不加密)

router(config-if)#ip ospf message-digest-key <钥匙号>md5 口令为ospf设置md5认证

router(config-if)#no ip ospf message-digest-key <钥匙号>md5 口令为ospf设置md5认证

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

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

router(config-subif.1)#encapsulation dot1q 序号绑定vlan中继协议(vlan三层路由) 注: dot1q 为IEEE802.1Q标准isl为思科专用

router#write 保存配置信息

router#copy running-config startup-config 保存当前配置nvram

router#debug ip rip 监测配置

router#no debug ip all 关闭监测配置

router#reload 重新起动

router#erase startup-config 清除配置文件

路由器显示命令:

router#show run 显示配置信息

router#show interface 显示接口信息

router#show ip route 显示路由信息

router#show ip arp 显示arp缓存

router#show cdp nei 显示邻居信息

静态路由:

router(config)#ip route <下一跳> 命令格式注: distance 改变默认管理开销

router(config)#ip route 0.0.0.0 0.0.0.0 <下一跳> 默认路

router(config)#ip classless 数据包不能转发时匹配给默认路由

router(config)#no ip classless 数据包不能转发时弃掉

动态路由rip:

router(config)#ip routing 启动路由转发

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

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

router(config-router)#version <1-2> 设置rip版板

router(config-router)#no auto-summary 禁用自动聚合(当子网不连续时)v2版本

router(config-if)#ip rip send version 1 允许v2给v1发送报文(运行v2的接口模式下)router(config-if)#ip rip receive version 1 允许v2接收v1的报文(运行v2的接口模式下)router(config-if)#ip rip send version 1 2 同时发送v1, v2报文(在运行v2的接口模式下)注: 当运行rip version 2 的路由器和运行rip version 1的路由器相联时,可以通过接口兼容性开关来实现

也可以在一个接口上同时发送和接收v1, v2 两个版本

动态路由ospf:

router(config)#router ospf 启用ospf进程

router(config-router)#network <返掩码>area 启用ospf进程

例: network 192.168.10.2 0.0.0.0 area 0只在某一接口上启用sopf

network 192.168.0.0 0.0.255.255 area 0将属于192.168.0.0网段的所有接口启用ospf router#show ip interface 查看指定接口信息

router#show ip interface 查看指定接口信息

router#show ip ospf neighbor 查看邻居结构信息

router#show ip ospf database router 查看路由器

router#show ip interface 查看指定接口信息

router#show ip ospf neighbor 查看邻居结构信息

router#show ip route 查看网络条目(数据包要转发的目的网络)

router#debug ip adj 查看邻接关系的建立

基本访问控制列表:

router(config)#ip access-list { standard | extended } name 命名访问列表

router(config)#access-list <1-99> permit <返掩码>

router(config)#access-list <1-99> deny <主机> <返掩码>

注: 0.0.0.0 255.255.255.255 简写为any 允许或拘绝所有网络

0.0.0.0 简写为host 允许或拘绝某个主机返掩码

router(config-if)#ip access-group <1-99> in/out 在接口上定义access-list的方向

router(config-if)#ip access-group name in/out 在接口上定义命名access-list的方向

扩展访问控制列表:

router(config)#access-list {permit|deny } protocol [precedence<0-7>][tos<0-15>

基于ip的访问列表

注: 扩展列表范围为100-199之间。protocol是个变量包括(eigrp gre icmp igrp ip ipinip nos ospf tcp udp)

precedence和tos 是可选变量,它们可以在ip报头的优先级字段和服类类型字段建寻找匹配。router(config)#access-list {permit|deny }tcp [operator port] [operator port] [established]

[precedence<0-7>] [tos<0-15> 基于tcp的访问列表

注: operaor是指定逻辑操作,可选项是(eq等于neq不等于gt 大于lt 小于range指明包

括的端口范围

port指明端口号,常用端口号telnet(23) ftp(20 21) smtp(25) snmp(169) dns(53) tftp(69) www(80)

established 检查ack 和rst标记

router(config)#access-list {permit|deny }udp [operator port] [operator port] [precedence<0-

7>] [tos<0-15> 基于udp的访问列表

router(config)#access-list {permit|deny }icmp [icmp-type] [icmp-code] [precedence<0-7>]

[tos<0-15> 基于icmp的访问列表

注: 多个接口可以调用相同的访问列表,但是在任意一个接口上,对每种协议仅能有一个进入和离开的访问列表。

安全过滤通常是做为入站过滤,流量过滤通常是出站过滤。标准访问列表尽可能被放置在靠近目标的地方,扩展访问列表应该放置在靠近源点的地方。

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 <私有IP> <公网IP> 静态nat配置

Router(config)#access-list <1> permit 192.168.100.0 0.0.0.255 定义访问列表(动态nat) Router(config)#ip nat pool <起始地址><中止地址> netmask<子网掩码>定义合法ip地址池(动态nat)

Router(config)#ip nat inside destination list <1> pool 访问列表与地址池邦定(动态nat)

Router(config)#ip nat inside source list <2> interface overload 复用外部接口地址tcp负载均衡配置

Router(config)#access-list <1> permit <虚拟主机ip> 定义访问列表

Router(config)#ip nat pool <起始地址><中止地址> prefix-length <24> type rotary

注: <起始地址><中止地址>需要实现负载的几个主机地址

Router(config)#ip nat inside destination list <1> pool 访问列表与地址池邦定Router#show ip nat translation

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

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

配置PPP验证:

RouterA(config)#usename password

RouterA(config)#int s0

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

路由器认证:

步骤:

定义一个带名字的钥匙链

定义在钥匙链上的钥匙

在接口上启动认证并指定使用的钥匙链

指定这个接口合用名文还是MD5认证

可选地配置钥匙的管理

config)#key chain 钥匙链名

config-keychain)#key 1

config-keychain-key)#key-string 口令

config-keychain-key)#interface ethernet 0

config-if)#ip rip authentication key-chain 钥匙链名

config-if)#ip rip authentication mode md5

cisco2600路由器密码恢复

重启路由器,在启动过程中按下ctrl+break键,使路由器进入rom monitor模式

在提示符下输入命令修改配置寄存器的值,然后重器路由器

router>confreg 0x2142 跳过配置文件

router>reload 重新引导

重新起动后为了路由器恢复密码后配置不变,把startup-config保存到running-config中然后重新设置密码。

将配置寄存器的值改回来router(config)#config-register 0x2102

保存当前配置文件到startup-config

思科交换机命令大全

思科交换机常用命令大全 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

思科交换机命令大全

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

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命令全集

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 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]

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

思科交换机路由器命令 大全 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配置命令大全

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).配置拨号字符串

思科基本配置命令详解

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

目录 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 IOS 基本命令

思科交换机命令大全 (一) 序号/类别基于ios的交换机命令基于CLI的交换机命令 1.设置主机名/系统名switch(config)# hostname "hostname" switch(enable) set system 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 sc0 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 port name module/number description-string 7.设置端口速度switch(config-if)# speed{10|100|auto} switch(enable) set port speed moudle/number {10|100|auto} switch(enable) set port speed moudle/number {4|16|auto} 8.设置以太网的链路模式switch(config-if)# duplex {auto|full|half} switch(enable) 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 switch(config-if)# switchport mode trunk switch(config-if)#switchport trunk encapsulation {isl|dotlq} switch(config-if)# switchport trunk allowed vlan remove vlan-list switch(config-if)# switchport trunk allowed vlan add vlan-list switch(enable)set trunk module/port [on|off|desirable|auto|nonegotiate] Vlan-range [isl|dotlq|dotl0|lane|negotiate] 11.配置VTP管理域switch# vlan database

思科交换机配置常用命令(精编文档).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基本命令

端口速度:设置端口速度为: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

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

Cisco常用命令

路由器实验: router> enable 从用户模式进入特权模式 router# disable or exit 从特权模式退出到用户模式 router# show sessions 查看本机上的TELNET会话router# disconnect 关闭所有的TELNET会话 router# show users 查看本机上的用户 router# erase startupconfig 删除NVRAM中的配置 router# reload 重启路由器 router# config terminal 从用户模式进入特权模式 router(config)# hostname rl 配置用户名为rl router(config)# #banner welcome# 配置开机话语

router# show controllers serial0 查看串口0的物理层信息(主要是查看DTE/DCE)router# show ip interface 查看端口的IP配置信息 router# show hosts 查看主机表 end or ctrl+z 从各种配置模式退到特权模式 rl(config)# no ipdomainlookup 关闭动态域名解析 rl(config)# ipdomainlookup 打开动态域名解析 rl(config)# ipnameserver 202.106.0.20 打开动态域名解析之后便可以指定DNS服务rl(config)# interface serial 0 进入serial 0的接口配置模式 rl(configif)# no shutdown 路由器出厂默认所有端口关闭,使用此命令使它们打开rl(configif)# encapsulation ppp 封装ppp rl(configif)# clockrate 64000 如果是DCE使需要设置时钟速率,如果是DTE使不必设置

思科交换机配置命令大全

思科交换机配置命令大全 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

Cisco 路由器常用命令

Cisco 路由器常用命令 1 Exec commands: <1-99> 恢复一个会话 bfe 手工应急模式设置 clear 复位功能 clock 管理系统时钟 configure 进入设置模式 connect 打开一个终端 copy 从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上debug 调试功能 disable 退出优先命令状态 disconnect 断开一个网络连接 enable 进入优先命令状态 erase 擦除快闪内存 exit 退出exce模式 help 交互帮助系统的描述 lat 打开一个本地传输连接 lock 锁定终端 login 以一个用户名登录 logout 退出终端 mbranch 向树形下端分支跟踪多路由广播 mrbranch 向树形上端分支跟踪反向多路由广播 name-connection 给一个存在的网络连接命名 no 关闭调试功能 pad 打开X.29 PAD连接 ping 发送回显信息 ppp 开始点到点的连接协议 reload 停机并执行冷启动 resume 恢复一个活动的网络连接 rlogin 打开远程注册连接 rsh 执行一个远端命令 send 发送信息到另外的终端行 setup 运行setup命令 show 显示正在运行系统信息 slip 开始SLIP协议 start-chat 在命令行上执行对话描述 systat 显示终端行的信息 telnet 远程登录 terminal 终端行参数 test 测试子系统内存和端口 tn3270 打开一个tin3270连接 trace 跟踪路由到目的地 undebug 退出调试功能 verify 验证检查闪烁文件的总数 where 显示活动的连接 which-route 执行OSI路由表查找并显示结果 write 把正在运行的设置写入内存、网络、或终端 x3 在PAD上设置X.3参数

(完整版)cisco命令大全解释、注释

cisco命令大全解释、注释 Dynamips作为一款十分优秀的Cisco路由器模拟软件,实验模拟效果远比Boson NetSim更加真实可信。Boson NetSim是对IOS命令行的模拟,而Dynamips是通过在计算机中构建运行IOS的虚拟机来真正运行IOS实现对Cisco路由器的模拟。 收录最常用的Cisco命令分类如下: cisco命令大全 1. switch配置命令 (1)模式转换命令 用户模式----特权模式,使用命令"enable" 特权模式----全局配置模式,使用命令"config t" 全局配置模式----接口模式,使用命令"interface+接口类型+接口号" 全局配置模式----线控模式,使用命令"line+接口类型+接口号" 注: 用户模式:查看初始化的信息. 特权模式:查看所有信息、调试、保存配置信息 全局模式:配置所有信息、针对整个路由器或交换机的所有接口 接口模式:针对某一个接口的配置 线控模式:对路由器进行控制的接口配置 (2)配置命令 show running config 显示所有的配置 show versin 显示版本号和寄存器值 shut down 关闭接口 no shutdown 打开接口 ip add +ip地址配置IP地址 secondary+IP地址为接口配置第二个IP地址 show interface+接口类型+接口号查看接口管理性 show controllers interface 查看接口是否有DCE电缆 show history 查看历史记录

show terminal 查看终端记录大小 hostname+主机名配置路由器或交换机的标识 config memory 修改保存在NVRAM中的启动配置 exec timeout 0 0 设置控制台会话超时为0 service password-encryptin 手工加密所有密码 enable password +密码配置明文密码 ena sec +密码配置密文密码 line vty 0 4/15 进入telnet接口 password +密码配置telnet密码 line aux 0 进入AUX接口 password +密码配置密码 line con 0 进入CON接口 password +密码配置密码 bandwidth+数字配置带宽 no ip address 删除已配置的IP地址 show startup config 查看NVRAM中的配置信息 copy run-config atartup config 保存信息到NVRAM write 保存信息到NVRAM erase startup-config 清除NVRAM中的配置信息 show ip interface brief 查看接口的谪要信息 banner motd # +信息+ # 配置路由器或交换机的描素信息description+信息配置接口听描素信息 vlan database 进入VLAN数据库模式 vlan +vlan号+ 名称创建VLAN switchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式 ip add +ip地址为VLAN配置管理IP地址 vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名 vtp +password +密码配置SW的密码

相关文档
最新文档