Cisco常用命令

Cisco常用命令
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使不必设置

rl(configif)# bandwidth 64 设置端口带宽为64K

rl(configif)# ctrl+c 或者ctrl+z 快捷键退出到特权模式

rl# show interface serial 0 查看s0信息,如果看到serial和line protocol都显示up,说明链路两端都设置成功注意:如果出现serial down, line down 可能对方的端口没有打no shutdown或者电缆没有插好;如果出现serial up, line down 可能是DCE端没有设置clock rate, 也可能是封装格式不对

rl# show cdp neighbors 查看CDP邻居信息

rl# show cdp entry *

rl(configif)# ip add 10.0.0.1 255.0.0.0 进入相应的接口,配置相应的IP地址

[!empirenews.page] rl# ping 10.0.0.2 使用ping命令查看邻居的连通性

rl# show ip route 查看路由表,可以看到以C打头的路由信息,这是直连的路由信息;可以看到R开头的路由信息,是从rip学来的路由信息;可看到以I开头的路由信息取代了以R开头的路由信息,这是因为igrp 的管理距离是100,小于rip的120

rl(configif)# router rip 启动RIP路由协议

rl(configrouter)# network 10.0.0.0 发布网段(注意network后面是接的网络号而不是IP地址)

rl# show ip protocol 查看配置的路由协议

rl(config)# router igrp 300 一定要注意在IGRP后面加自治系统号,考试的时候题目会告诉你AS NUMBER,照敲就是

rl(configrouter)# network 10.0.0.0

rl(config)# line vty0 4 进入虚拟线程配置模式,在此模式可对telnet功能进行配置

rl(configline)# login

rl(configline)# password cisco 配置telnet密码,默认的网络设备telnet的功能是关闭的,配了密码之后会自动打开

rl(config)# enable password cisco 配置进入enable模式的密码,区分大小写

rl(config)# enable secret ciscocisco 配置进入enable模式的密码,是加密的密码,

show run是看不见的

rl(config)# line console 0

rl(configline)# login

rl(configline)# password cisco 配置进入用户模式的密码

rl(configline)# logging synchronous 输入同步

rl(configline)# exectimeout 0 0 禁止因为一段时间没有输入而跳出

rl# copy running-config startup-config 保存配置,考试的时候注意题目的要求,如果题目里要求你保存配置就一定不能少了这一项

r1# copy tftp startup-config

r1# copy runnin-gconfigtftp

r1# copy tftp flash

交换机实验:

switch(config)# ip address 192.168.0.177 255.255.255.0 与路由器在接口上的配置

IP不同,交换机是在全局配置模式配置

switch(config)# ipdefaultgateway 192.158.0.1 给交换机配置一个缺省网关,请注意,不用写掩码

switch(config)# vlan2 name cisco 配置一个vlan2并且指定名字叫CISCO

switch# show interfaces 查看端口状态

switch(config)# interface e0/10 进入端口e0/10

switch(configif)# vlanmembership static 2 将端口放进vlan2里面

switch(config)# int f0/26 进入快速以太网端口f0/26

switch(configif)# trunk on 启用trunk,注意:只能在百兆以上端口启用trunk

switch(configif)# notrunkvlan 51 52 在主干上关闭VLAN51、52的传输

思科交换机命令大全

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

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]

思科交换机命令大全

思科交换机常用命令大全 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 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 接口名 /启动本路由器的那个接口为被动接口

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使不必设置

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的密码

Cisco Pix日常维护常用命令

一、Cisco Pix日常维护常用命令 1、Pix模式介绍 “>”用户模式 firewall>enable 由用户模式进入到特权模式 password: “#”特权模式 firewall#config t 由特权模式进入全局配置模式 “(config)#”全局配置模式 firewall(config)# 防火墙的配置只要在全局模式下完成就可以了。 1、 基本配置介绍 1、端口命名、设备命名、IP地址配置及端口激活 nameif ethernet0 outside security0 端口命名 nameif gb-ethernet0 inside security100 定义端口的名字以及安全级别,“outside”的安全级别默认为0,“inside”安全级别默认为100,及高安全级别的可以访问低安全级别的,但低安全级别不能主动地到高安全级别。firewall(config)#hostname firewall 设备名称 firewall(config)#ip address outside 1.1.1.1 255.255.255.0 内外口地址设置 firewall(config)#ip address inside 172.16.1.1 255.255.255.0 firewall(config)# interface ethernet0 100full 激活外端口 firewall(config)# interface gb-ethernet0 1000auto 激活内端口 2、telnet、ssh、web登陆配置及密码配置 防火墙默认是不允许内/外网用户通过远程登陆或WEB访问的,需要相应得开启功能。firewall(config)#telnet 192.168.10.0 255.255.255.0 inside 允许内网此网断内的机器Telnet 到防火墙 配置从外网远程登陆到防火墙 Firewall(config)#domain-name https://www.360docs.net/doc/412989130.html, firewall(config)# crypto key generate rsa firewall(config)#ssh 0.0.0.0 0.0.0.0 outside 允许外网所有地址可以远程登录防火墙,也可以定义一格具体的地址可以从外网登陆到防火墙上,如: firewall(config)#ssh 218.240.6.81 255.255.255.255 outside firewall(config)#enable password cisco 由用户模式进入特权模式的口令 firewall(config)#passrd cisco ssh远程登陆时用的口令

思科交换机配置常用命令

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交换机基本配置 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 超级终端连接创建对话框

最新思科常用命令大全

思科常用命令大全 1用户模式 2:特权模式 enable show vlan show version show interface show mac-address-table show running-config copy running-config startup-config 3:全局配置模式 config terminal hostname enable password ip default-gateway 4:接口配置模式 interface 端口 switchport mode trunk 5:line模式 line console 0 第2章交换机的基本配置 1.配置主机 hostname 2.查看交换机的配置 show running-config 使能口令 enable password 加密保存的使能口令 enable secret 配置IP地址 interface vlan1 ip address no shutdown 配置交换机的网关 ip default-gateway ipaddress 查看交换机的MAC地址表show mac-address-table 使用CDP协议 show cdp show cdp interface

show cdp neighbors show cdp neighbors detail show cdp traffic 保存与删除交换机配置 copy running-config startup-config 第三章:虚拟局域网(VLAN) VLAN的概述 VLAN是对连接在第2层交换机端口的网络用户的逻辑分段。 VLAN的作用: 1。广播控制 2。安全(副产品) 3。带宽利用 4。延迟 VLAN的种类 静态:基于端口的VLAN 动态:基于MAC地址的VLAN 在交换机上配置静态VLAN 创建VLAN 1。CONFIG TERMINAL VLAN 2 NAME 2 2。特权模式下 VLAN DATABASE VLAN 2 NAME 2 查看VLAN SHOW VLAN 删除VLAN NO VLAN 2 验证:SHOW VLAN BRIEF 在VLAN中添加端口 INTERFACE F0/2 INTERFACE RANGE F0/2 - 5 SWITCHPORT MODE ACCESS SWITCHPORT ACCESS VLAN 2

自己长期总结的cisco交换机常用命令

14.50 1.在基于IOS的交换机上设置主机名/系统名: witch(config)# hostname hostname 在基于CLI的交换机上设置主机名/系统名: witch(enable) set system name name-string 2.在基于IOS的交换机上设置登录口令: witch(config)# enable password level 1 password 在基于CLI的交换机上设置登录口令: witch(enable) set password witch(enable) set enalbepass 3.在基于IOS的交换机上设置远程访问: witch(config)# interface vlan 1 witch(config-if)# ip address ip-address netmask witch(config-if)# ip default-gateway ip-address 在基于CLI的交换机上设置远程访问: witch(enable) set interface sc0 ip-address netmask broadcast-address witch(enable) set interface sc0 vlan witch(enable) set ip route default gateway 4.在基于IOS的交换机上启用和浏览CDP信息: witch(config-if)# cdp enable witch(config-if)# no cdp enable 为了查看Cisco邻接设备的CDP通告信息: witch# show cdp interface [type modle/port] witch# show cdp neighbors [type module/port] [detail] 在基于CLI的交换机上启用和浏览CDP信息: witch(enable) set cdp {enable|disable} module/port 为了查看Cisco邻接设备的CDP通告信息: witch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述: witch(config-if)# description description-string 基于CLI的交换机的端口描述: witch(enable)set port name module/number description-string 6.在基于IOS的交换机上设置端口速度: witch(config-if)# speed{10|100|auto} 在基于CLI的交换机上设置端口速度: witch(enable) set port speed moudle/number {10|100|auto} witch(enable) set port speed moudle/number {4|16|auto} 7.在基于IOS的交换机上设置以太网的链路模式: witch(config-if)# duplex {auto|full|half} 在基于CLI的交换机上设置以太网的链路模式: witch(enable) set port duplex module/number {full|half} 8.在基于IOS的交换机上配置静态VLAN: witch# vlan database witch(vlan)# vlan vlan-num name vla

相关文档
最新文档