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参数
xremote 进入xremote模式
2 #show ?
access-expression 显示访问控制表达式access-lists 显示访问控制表
apollo Apollo 网络信息
appletalk Apple Talk 信息
arap 显示Appletalk 远端通道统计
arp 地址解析协议表
async 访问路由接口的终端行上的信息bridge 前向网络数据库
buffers 缓冲池统计
clns CLNS网络信息
clock 显示系统时钟
cmns 连接模式网络服务信息
compress 显示压缩状态
configuration 非易失性内存的内容controllers 端口控制状态
debugging 调试选项状态
decnet DEC网络信息
dialer 拨号参数和统计
dnsix 显示Dnsix/DMPP信息
entry 排队终端入口
extended 扩展端口信息
flash 系统闪烁信息
flh-log 闪烁装载帮助日志缓冲区
frame-relay 帧中继信息
history 显示对话层历史命令
hosts IP域名,查找方式,名字服务,主机表interfaces 端口状态和设置
ip IP信息
ipx Novell IPX信息
isis IS-IS路由信息
keymap 终端键盘映射
lat DEC LAT信息
line 终端行信息
llc2 IBM LLC2 环路信息
lnm IBM 局网管理
local-ack 本地认知虚环路
memory 内存统计
netbios-cache NetBios命名缓冲存贮器内存node 显示已知LAT节点
ntp 网络时间协议
processes 活动进程统计
protocols 活动网络路由协议
queue 显示队列内容
queueing 显示队列设置
registry 功能注册信息
rhosts 远程主机文件
rif RIF存贮器入口
route-map 路由器信息
sdlle 显示sdlc-llc2转换信息
services 已知LAT服务
sessions 远程连接信息
smds SMDS信息
source-bridge 源网桥参数和统计
spanning-tree 跨越树形拓朴
stacks 进程堆栈应用
standby 热支持协议信息
stun STUN状态和设置
subsystem 显示子系统
tcp TCP连接状态
terminal 显示终端设置
tn3270 TN3270 设置
translate 协议转换信息
ttycap 终端容易表
users 显示终端行的信息
version 系统硬、软件状态
vines VINES信息
whoami 当前终端行信息
x25 X.25信息
xns XNS信息
xermote Xremote统计
3 #config ?
Memory 从非易失性内存设置
Network 从TFTP网络主机设置
Overwrite-network 从TFTP网络主机设置覆盖非易失性内存Terminal 从终端设置
4 Configure commads:
Access-list 增加一个访问控制域
Apollo Apollo全局设置命令
appletalk Appletalk 全局设置命令
arap Appletalk远程进出协议
arp 设置一个静态ARP入口
async-bootp 修改系统启动参数
autonomous-system 本地所拥有的特殊自治系统成员banner 定义注册显示信息
boot 修改系统启动时参数
bridge 透明网桥
buffers 调整系统缓冲池参数
busy-message 定义当连接主机失败时显示信息
chat-s cript 定义一个调制解调器对话文本
clns 全局CLNS设置子命令
clock 设置时间时钟
config-register 定义设置寄存器
decnet 全局DEC网络设置子命令
default-value 缺省字符位值
dialer-list 创建一个拨号清单入口
dnsix-nat 为审计提供DMDM服务
enable 修改优先命令口令
end 从设置模式退出
exit 从设置模式退出
frame-relay 全局帧中继设置命令
help 交互帮助系统的描述
hostname 设置系统网络名
iterface 选择设置的端口
ip 全局地址设置子命令
ipx Novell/IPX全局设置命令
keymap 定义一个新的键盘映射
lat DEC本地传输协议
line 设置终端行
lnm IBM局网管理
locaddr-priority-list 在LU地址上建立优先队列
logging 修改注册(设备)信息
login-string 定义主机指定的注册字符串
map-class 设置静态表类
map-list 设置静态表清单
menu 定义用户接口菜单
mop 设置DEC MOP服务器
netbios NETBIOS通道控制过滤
no 否定一个命令或改为缺省设置
ntp 设置NTP
priority-list 建立特权列表
prompt 设置系统提示符
queue-list 建立常规队列列表
rcmd 远程命令设置命令
rcp-enable 打开Rep服务
rif 源路由进程
router-map 建立路由表或进入路由表命令模式
router 打开一个路由进程
rsh-enable 打开一个RSH服务
sap-priority-list 在SAP或MAC地址上建立一个优先队列service 修改网络基本服务
snmp-server 修改SNMP参数
state-machine 定义一个TCP分配状态的机器
stun STUN全局设置命令
tacacs-server 修改TACACS队列参数
terminal-queue 终端队列命令
tftp-server 为网络装载请求提供TFTP服务
tn3270 tn3270设置命令
translate 解释全局设置命令
username 建立一个用户名及其权限
vines VINES全局设置命令
x25 X.25 的第三级
x29 X.29 命令
xns XNS 全局设置命令
xremote 设置Xremote
5 (config)#ip
Global IP configuration subcommands:
Accounting-list 选择保存IP记帐信息的主机
Accounting-threshold 设置记帐入口的最大数
accounting-transits 设置通过入口的最大数
alias TCP端口的IP地址取别名
as-path BGP自治系统路径过滤
cache-invalidate-delay 延迟IP路由存贮池的无效
classless 跟随无类前向路由规则
default-network 标志网络作为缺省网关候选
default-gateway 指定缺省网(如果没有路由IP)
domain-list 完成无资格主机的域名
domain-lookup 打开IP域名服务系统主机转换
domain-name 定义缺省域名
forward-protocol 控制前向的、物理的、直接的IP广播
host 为IP主机表增加一个入口
host-routing 打开基于主机的路由(代理ARP和再定向)
hp-host 打开HP代理探测服务
mobile-host 移动主机数据库
multicast-routing 打开前向IP
name-server 指定所用名字服务器的地址
ospf-name-lookup 把OSPF路由作为DNS名显示
pim PIM 全局命令
route 建立静态路由
routing 打开IP路由
security 指定系统安全信息
source-route 根据源路由头的选择处理包
subnet-zero 允许子网0子网
tcp 全局TCP参数
路由器在计算机网络中有着举足轻重的地位,是计算机网络的桥梁。通过它不仅可以连通不同的网络,还能选择数据传送的路径,并能阻隔非法的访问。
路由器的配置对初学者来说,并不是件十分容易的事。现将路由器的一般配置和简单调试介绍给大家,供朋友们在配置路由器时参考,本文以Cisco2501为例。
Cisco2501有一个以太网口(AUI)、一个Console口(RJ45)、一个AUX口(RJ45)和两个同步串口,支持DTE 和DCE设备,支持EIA/TIA-232、EIA/TIA-449、V.35 、X.25和EIA-530接口。
一〃配置
1〃配置以太网端口
# conf t(从终端配置路由器)
# int e0(指定E0口)
# ip addr ABCD XXXX(ABCD 为以太网地址,XXXX为子网掩码)
# ip addr ABCD XXXX secondary(E0口同时支持两个地址类型。如果第一个为A类地址,则第二个为B或C类地址)
# no shutdown(激活E0口)
# exit
完成以上配置后,用ping命令检查E0口是否正常。如果不正常,一般是因为没有激活该端口,初学者往往容易忽视。用no shutdown命令激活E0口即可。
2〃X.25的配置
# conf t
# int S0(指定S0口)
# ip addr ABCD XXXX(ABCD 为以太网S0 的IP地址,XXXX为子网掩码)
# encap X25-ABC(封装X.25协议。ABC指定X.25为DTE或DCE操作,缺省为DTE)
# x25 addr ABCD(ABCD为S0的X.25端口地址,由邮电局提供)
# x25 map ip ABCD XXXX br(映射的X.25地址。ABCD为对方路由器(如:S0)的IP 地址,XXXX为对方路由器(如:S0)的X.25端口地址)
# x25 htc X(配置最高双向通道数。X的取值范围1-4095,要根据邮电局实际提供的数字配置)
# x25 nvc X(配置虚电路数,X不可超过邮电局实际提供的数否则将影响数据的正常传输)
# exit
S0端口配置完成后,用no shutdown命令激活E0口。如果ping S0端口正常,ping 映射的X.25 IP地址即对方路由器端口IP地址不通,则可能是以下几种情况引起的:1)本机X.25地址配置错误,重新与邮局核对(X.25地址长度为13位);2)本机映射IP地址或X.25地址配置错误,重新配置正确;3)对方IP地址或X.25地址配置错误;4)本机或对方路由配置错误。
能够与对方通讯,但有丢包现象。出现这种情况,一般有以下几种可能:1)线路情况不好,或网卡、RJ45插头接触不良;2)x25 htc最高双向通道数X的取值范围和x25nvc 虚电路数X超出邮电局实际提供的数字。最高双向通道数和虚电路数这两个值越大越好,但绝对不能超出邮电局实际提供的数字,否则就会出现丢包现象。
3〃专线的配置
# conf t
# int S2(指定S2口)
# ip addr ABCD XXXX(ABCD 为S2 的IP地址,XXXX为子网掩码)
# exit
专线口配置完成后,用no shutdown命令激活S2口即可。
4〃帧中继的配置
# conf t
# int s0
# ip addr ABCD XXXX (ABCD 为S0 的IP地址,XXXX为子网掩码)
# encap frante_relay (封装frante_relay 协议)
# no nrzi_encoding (NRZI=NO)
# frame_relay lmi_type q933a (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
帧中继S0端口配置完成后,用ping命令检查S0口。如果不正常,通常是因为没有激活该端口,用no shutdown
命令激活S0口即可。如果ping S0端口正常,ping 映射的IP地址不正常,则可能是帧中继交换机或对方配置错误,需要综合排查。
5〃配置同步/异步口(适用于2522)
# conf t
# int s2
# ph asyn (配置S2为异步口)
# ph sync (配置S2为同步口)
6〃动态路由的配置
# conf t
# router eigrp 20 (使用EIGRP路由协议。常用的路由协议有RIP、IGRP、IS-IS等)
# passive-interface serial0 (若S0与X.25相连,则输入本条指令)
# passive-interface serial1 (若S1与X.25相连,则输入本条指令)
# network ABCD (ABCD为本机的以太网地址)
# network XXXX (XXXX为S0的IP地址)
# no auto-summary
# exit
7〃静态路由的配置
# ip router ABCD XXXX YYYY 90 (ABCD为对方路由器的以太网地址,XXXX 为子网掩码,YYYY为对方对应的广域网端口地址)
# dialer-list 1 protocol ip permail
二〃综合调试
当路由器全部配置完毕后,可进行一次综合调试。
1〃首先将路由器的以太网口和所有要使用的串口都激活。方法是进入该口,执行no shutdown。
2〃将和路由器相连的主机加上缺省路由(中心路由器的以太地址)。方法是在Unix系统的超级用户下执行:rout er add default XXXX 1(XXXX为路由器的E0口地址)。每台主机都要加缺省路由,否则,将不能正常通讯。
3〃ping本机的路由器以太网口,若不通,可能以太网口没有激活或不在一个网段上。ping广域网口,若不通,则没有加缺省路由。ping对方广域网口,若不通,路由器配置错误。ping主机以太网口,若不通,对方主机没有加缺省路由。
4〃在专线卡X.25主机上加网关(静态路由)。方法是在Unix系统的超级用户下执行:router add X.X.X.X Y.Y.Y. Y 1(X.X.X.X为对方以太网地址,Y.Y.Y.Y为对方广域网地址)。
5〃使用Tracert对路由进行跟踪,以确定不通网段
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)/* 在串口中配置*/&n! bsp;
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]
show cdp entry routerA !
8〃IP Address 配置
Ip ad dress 网络地址掩码
Ip host 主机名address
Ip name-server 服务器地址1 服务器地址2 。。。
Ip domain-lookup nsap
Show hosts
Ping 主机名/IP地址
Trace 主机名/IP地址
三、IP 路由
1〃静态路由
ip routing
ip route 目标网络号掩码端口号[permanent]
2〃缺省路由
ip default-network 网络号
3〃动态路由
1)RIP配置
Router rip
Network 网络号
Show ip route
Show ip protocol
Debug ip
2)OSPF 配置
Router ospf 进程号
Redistribute 其它路由协议
Network ! 端口网络反掩码area 区域号
Area 区域号range 网络号掩码
Area 区域号default-cost 花销值
Ip ospf priority number
Ip ospf cost 花销值
Show ip ospf database
3)BGP 配置
Router bgp 自治域号
Redistribute 其它路由协议
Network 网络号/* 自治域内*/
Aggregate-address 网络号掩码summary-only 汇总网络
Neighbor 相邻网络号remote-as 自治域号/* 自治域间的网络*/
四、流量控制
1)被动端口
passive interface 端口号
2)缺省路由
ip default 网络号/端口网络
3)静态路由
ip route 目标网? 绾?nbsp;掩码端口号
4)ACL过滤表
( 全局上) access-list 访问号1 {permit|deny} 反掩码号[ established] access-list 访问号2 {permit|deny} IP/TCP协议源网络目的网络
操作符参数
(端口上)access-group 访问号in|out
distribute-list 访问号in|out 端口号
4)Null 0 interface
Ip route address mask null 0
五、广义网配置
1)PPP
Ppp pap sent-usename 封装
Ppp chap hostname
Ppp chap password
2)X.25
encapsulation x25 [dce]
x25 address
x25 map 协议地址/*SVC */
x25 pvc pvc号ip地址x25地址/*PVC */
ip switching
x25 ro! ute x.121地址接口x.121映射地址
2)FrameRelay
Frame-relay local-dlci IP网络号
Frame-relay map 协议地址
Frame-relay lmi-type ansi
路由器命令
router> 用户模式
1:进入特权模式 enable
router > enable
router #
2:进入全局配置模式 configure terminal
router > enable
router #c onfigure terminal
router (conf)#
3:交换机命名hostname routera 以routerA为例
router > enable
router #c onfigure terminal
router(conf)#hostname routerA
routera (conf)#
4:配置使能口令 enable password cisco 以cisco为例
router > enable
router #c onfigure terminal
router(conf)#hostname routerA
routerA (conf)# enable password cisco
5:配置使能密码 enable secret ciscolab 以cicsolab为例
router > enable
router #c onfigure terminal
router(conf)#hostname routerA
routerA (conf)# enable secret ciscolab
enable secret是加密的,enable password是不加密的。
在同时使用enable password和enable secret时,enable secret生效,因为他优先。
另外,二者不能设成一样。
6:进入路由器某一端口interface fastehernet 0/17 以17端口为例
router > enable
router #c onfigure terminal
router(conf)#hostname routerA
routerA (conf)# interface fastehernet 0/17
routerA (conf-if)#
进入路由器的某一子端口interface fastethernet 0/17.1 以17端口的1子端口为例
router > enable
router #c onfigure terminal
router(conf)#hostname routerA
routerA (conf)# interface fastehernet 0/17.1
7:设置端口ip地址信息
router > enable
router #c onfigure terminal
router(conf)#hostname routerA
routerA(conf)# interface fastehernet 0/17 以17端口为例
routerA (conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip和子网掩码
routerA (conf-if)#no shut 是配置处于运行中
routerA (conf-if)#exit
8:查看命令 show
router > enable
router # show version 察看系统中的所有版本信息
show interface vlan 1 查看交换机有关ip 协议的配置信息
show running-configure 查看交换机当前起作用的配置信息
show interface fastethernet 0/1 察看交换机1接口具体配置和统计信息
show mac-address-table 查看mac地址表
show mac-address-table aging-time 查看mac地址表自动老化时间
show controllers serial + 编号查看串口类型
show ip router 查看路由器的路由表
9:cdp相关命令
router > enable
router # show cdp 查看设备的cdp全局配置信息
show cdp interface fastethernet 0/17 查看17端口的cdp配置信息
show cdp traffic 查看有关cdp包的统计信息
show cdp nerghbors 列出与设备相连的cisco设备
10:csico2600的密码恢复
重新启动路由器,在启动过程中按下win+break键,使路由器进入rom monitor
在提示符下输入命令修改配置寄存器的值,然后重新启动路由器
remmon1>confreg 0x2142
remmon2>reset
重新启动路由器后进入setup模式,选择“no”,退回到exec模式,此时路由器原有的配置仍然保存在startup-config中,为使路由器恢复密码后配置不变把startup-config中配置保存到running-config中,然后重新设置enable密码,并把配置寄存器改回0x2102:router>enable
router#copy startup-config running-config
router#c onfigure terminal
router(conf)#enable password cisco
router(conf)#c onfig-register 0x2102
保存当前配置到startup-config , 重新启动路由器。
router #copy running-config startup-config
router #reload
[url]https://www.doczj.com/doc/5a414964.html,/www/techspecial/ciscopassword/[/url]
11:路由器telnet远程登录设置:
router>en
router #c onfigure terminal
router (conf)#hostname routerA
routerA (conf)#enable password cisco 以cisco为特权模式密码
routerA (conf)#interface fastethernet 0/1 以17端口为telnet远程登录端口
routerA (conf-if)#ip address 192.168.1.1 255.255.255.0
routerA (conf-if)#no shut
routerA (conf-if)#exit
routerA (conf)line vty 0 4 设置0-4 个用户可以telnet远程登陆
routerA (conf-line)#login
routerA (conf-line)#password edge 以edge为远程登录的用户密码
主机设置:
ip 192.168.1.2 主机的ip必须和交换机端口的地址在同一网络段
netmask 255.255.255.0
gate-way 192.168.1.1 网关地址是交换机端口地址
运行:
telnet 192.168.1.1
进入telnet远程登录界面
password : edge
routera>en
password: cisco
routera#
12:配置路由器的标识banner $……………$
在全局配置的模式下利用“banner”命令可以配置路由器的提示信息,所有连接到路由器的终端都会收到。
router>en
router #c onfigure terminal
router (conf)#hostname routerA
routerA(conf)#banner motd $This is aptech company’router ! Please don’t change the configuration without per mission!$
13:配置接口标识description ………
接口标识用于区分路由器的各个接口。
router>en
router #c onfigure terminal
router (conf)#hostname routerA
routerA(conf)#interface fastethernet 0/1 以0/1 接口为例
routerA(conf-if)# description this is a fa st Ethernet port used to connecting the company’s intranet!
14:配置超时
超时适用于设置在多长时间没有对console进行配置,自动返回exec会话时间。默认为10分钟。
router>en
router #c onfigure terminal
router (conf)#hostname routerA
routerA(conf)#line console 0
routerA(conf-if)#e xec-timeout 0 0 第一个“0”代表分钟,第二个“0”代表秒
15:配置串口参数
两台路由器通过串口连接需要一个做为DTE,一个做为DCE。DCE设备要向DTE设备提供时钟频率和带宽。DCE配置:
router>en
router #c onfigure terminal
router (conf)#hostname routerA
routerA(conf)#interface serial 0/0
routerA(conf_if)#clock rate 64000 提供时钟频率为64000
routerA(conf_if)#bandwidth 64 提供带宽为64
DTE配置:路由器串口配置ip地址
router>en
router #c onfigure terminal
router (conf)#hostname routerB
routerB(conf)#interface serial 0/0
routerB(conf_if)#ip address 192.168.1.1 255.255.255.0
16:静态路由的配置
配置路由器A的主机名和接口参数
router>enable
router#c onfigure terminal
router(conf)#hostname routerA
routerA(conf)#interface fastethernet 0/1 路由器A的1端口为两路由器的连接端口
routerA(conf-if)#ip address 192.168.2.1 255.255.255.0
routerA(conf-if)#no shutdown
routerA(conf-if)#exit
routerA(conf)# interface fastethernet 0/0 路由器A的0端口为与主机的连接端口
routerA(conf-if)#ip address 192.168.1.2 255.255.255.0
routerA(conf-if)#no shutdown
主机A的ip地址为192.168.1.1
255.255.255.0
192.168.1.2
配置路由器B的主机名和接口参数
router>enable
router#c onfigure terminal
router(conf)#hostname routerB
routerB(conf)#interface fastethernet 0/0 路由器B的0端口为两路由器的连接端口
routerB(conf-if)#ip address 192.168.2.2 255.255.255.0
routerB(conf-if)#no shutdown
routerB (conf-if)#exit
routerB(conf)# interface fastethernet 0/1 路由器B的1端口为与主机的连接端口
routerB(conf-if)#ip address 192.168.3.1 255.255.255.0
主机B的ip地址为192.168.3.2
255.255.255.0
192.168.3.1
配置路由器A的静态路由表
routerA(conf)#ip router 192.168.3.0 255.255.255.0 192.168.2.2 配置路由器B的静态路由表
routerA(conf)#ip router 192.168.1.0 255.255.255.0 192.168.2.1
在routerA和routerB上配置默认路由
routerA(conf)#ip route 0.0.0.0 0.0.0.0 192.168.2.2
routerA(conf)#ip classless
routerB(conf)#ip route 0.0.0.0 0.0.0.0 192.168.2.1
routerB(conf)#ip classless
在routerA和routerB上配置动态路由(RIP)
routerA(conf)#router rip
routerA(conf)#network 192.168.1.0
routerA(conf)#network 192.168.2.0
routerB(conf)# router rip
routerB(conf)#network 192.168.2.0
routerB(conf)#network 192.168.3.0
2. 路由器支持的命令:
路由器显示命令:
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 ;defaultut
例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] [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全局地址。
思科交换机命令大全集团文件发布号:(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
华三华为交换机路由器 配置常用命令汇总 HUA system office room 【HUA16H-TTMS2A-HUAS8Q8-HUAH1688】
H3C交换机配置命令大全1、system-view 进入系统视图模式 2、sysname 为设备命名 3、display current-configuration 当前配置情况 4、 language-mode Chinese|English 中英文切换 5、interface Ethernet 1/0/1 进入以太网端口视图 6、 port link-type Access|Trunk|Hybrid 设置端口访问模式 7、 undo shutdown 打开以太网端口 8、 shutdown 关闭以太网端口
9、 quit 退出当前视图模式 10、 vlan 10 创建VLAN 10并进入VLAN 10的视图模式 11、 port access vlan 10 在端口模式下将当前端口加入到vlan 10中 12、port E1/0/2 to E1/0/5 在VLAN模式下将指定端口加入到当前vlan中 13、port trunk permit vlan all 允许所有的vlan通过 H3C路由器配置命令大全华为交换机常用配置实例 H3C交换机路由器telnet和console口登录配置 2009年11月09日星期一 10:00
级别说明 Level 名称 命令 参观 ping、tracert、telnet 1 监控 display、debugging 2 配置 所有配置命令(管理级的命令除外)
一、 1.router(config)#router rip 启动rip进程 2.router(conifg-router)#network 172.17.0.0指定rip协议的主网络 3.router(config-router)#passive-interface f0/1把f0/1配置成passive端口 4.router(config-router)#neighbor 172.17.12.67 以单波方式通告rip更新给路由器 5.router(config-if)#ip address 192.168.83.244 255.255.255.0 主ip地址 router(config-if)#ip address 10.33.55.1 255.255.255.0 secondary辅助ip地址二、 1.router(config-router)#version 2将rip配置成版本2 2.router(config-ip)#ip rip send version 1只发rip 1数据包 router(config-ip)#ip rip receive version 2只接收rip 2数据包 3.router(config-router)#no auto-summary 关闭汇总功能 4.router(config-if)#no ip split-horizon关闭水平分割 5.router#show ip ospf database router 192.168.30.10显示路由器LSA通告 router#show ip ospf database network 192.168.17.18显示网络LSA通告 router#show ip ospf database summary 172.16.121.0显示网络汇总LSA通告 router#show ip ospf database asbr-summary显示ASBR汇总LSA通告 router#show ip ospf database external 10.83.10.0显示自主系统外部LSA通告router#show ip ospf database nssa-external显示NSSA外部LSA通告 三、 1.router(config)#router ospf 10配置ospf进程id 2.router(config)#interface loopback0
cisco路由器配置及维护手册 作者:pixfire 一、路由器简单配置 1. 用串行电缆将PC机串口与路由器CONSOLE口连接,用WIN95的超级终端或NETTERM 软件进行配置。PC机串口设置为波特率9600 数据位8 停止位1。 2. 新出厂的路由器启动后会进入自动配置状态。可按提示对相应端口进行配置。 3 . 命令行状态。若不采用自动配置,可在自动配置完成后,题问是否采用以上配置时,回答N。此时进入命令行状态。 4 进入CONFIG模式。在router>键入enable , 进入router # ,再键入config t ,进入 router(config)# 。 5 配置广域端口。在正确连接好与E1端口的电缆线后,在router # 下键入sh controller cbus 。检验端口物理特性,及连线是否正确。之后,进入config模式。 进行以下配置。 int serial <端口号> E1端口号。 ip address
clock 管理系统时钟 configure 进入设置模式 connect 打开一个终端 copy 从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上 debug 调试功能 disable 退出优先命令状态 disconnect 断开一个网络连接 enable 进入优先命令状态 erase 擦除快闪内存 exit 退出exce模式 help 交互帮助系统的描述 lat 打开一个本地传输连接 lock 锁定终端 login 以一个用户名登录 logout
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 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]
Access-enable允许路由器在动态访问列表中创建临时访问列表入口 Access-group把访问控制列表(ACL)应用到接口上 Access-list定义一个标准的IP ACL Access-template在连接的路由器上手动替换临时访问列表入口 Appn向APPN子系统发送命令 Atmsig执行ATM信令命令 B 手动引导操作系统 Bandwidth 设置接口的带宽 Banner motd 指定日期信息标语 Bfe 设置突发事件手册模式 Boot system 指定路由器启动时加载的系统映像 Calendar 设置硬件日历 Cd 更改路径 Cdp enable 允许接口运行CDP协议 Clear 复位功能 Clear counters 清除接口计数器 Clear interface 重新启动接口上的件逻辑 Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率Cmt 开启/关闭FDDI连接管理功能 Config-register 修改配置寄存器设置 Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息 Configure memory 从NVRAM加载配置信息 Configure terminal 从终端进行手动配置 Connect 打开一个终端连接
Copy 复制配置或映像数据 Copy flash tftp 备份系统映像文件到TFTP服务器 Copy running-config startup-config 将RAM中的当前配置存储到NVRAM Copy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上 Copy tftp flash 从TFTP服务器上下载新映像到Flash Copy tftp running-config 从TFTP服务器上下载配置文件 Debug 使用调试功能 Debug dialer 显示接口在拨什么号及诸如此类的信息 Debug ip rip 显示RIP路由选择更新数据 Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息 Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息 Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程 Debug ppp 显示在实施PPP中发生的业务和交换信息 Delete 删除文件 Deny 为一个已命名的IP ACL设置条件 Dialer idle-timeout 规定线路断开前的空闲时间的长度 Dialer map 设置一个串行接口来呼叫一个或多个地点 Dialer wait-for-carrier-time 规定花多长时间等待一个载体 Dialer-group 通过对属于一个特定拨号组的接口进行配置来访问控制 Dialer-list protocol 定义一个数字数据接受器(DDR)拨号表以通过协议或ACL与协议的组合来控制控制拨号 Dir 显示给定设备上的文件 Disable 关闭特许模式 Disconnect 断开已建立的连接
Cisco路由器的基本配置命令 Cisco 路由器的基本配置命令 一(实训目的 1(掌握路由器的连接方式和使用基本规则。 2(掌握路由器的基本配置命令。 二(实训器材及环境 1(安装 Windows 2000 Server 系统的计算机一台。 2(安装模拟软件 Boson Netsim 5.31。 3(模拟环境如下: 图 11-1 实验拓扑环境 三(实训理论基础 1(路由器的基本配置语句 (1)配置路由器名字和特权密码: Router1> enable Router1# conf t Router1(config)# hostname R1 R1(config)# enable secret 123456
b5E2RGbCAP
(2)配置路由器的 Ethernet 端口:
R1(config)# interface e0 R1(config-if)# ip address 192.168.1.1 255.255.255.0 p1EanqFDPw R1(config-if)# no shutdown (3)配置路由器的 Serial 端口(DTE 端):DXDiTa9E3d R1(config)# interface s0 R1(config-if)# ip address 10.0.0.1 255.0.0.0 R1(config-if)# no shutdown (4)配置路由器的 Serial 端口(DCE 端):
RTCrpUDGiT
R2(config)# interface s0 R2(config-if)# ip address 10.0.0.2 255.0.0.0 R2(config-if)# clock rate 64000 R2(config-if)# no shutdown 2(路由器可以有多种类型的端口,用于连接 不同的网络,常用的有以太网端口(Ethernet)、快速以太网端口 (FastEthernet)、高速同步串口(Serial)等。有的端口是固定端口,有的端
5PCzVD7HxA
- 1 -
实训目的: (1)学习和掌握科路由器的配置方式和要求。 (2)学习和掌握科路由器的工作模式分类、提示符、进入方式。1、路由器的配置方式 ①超级终端方式。该方式主要用于路由器的初始配置,路由器不需要IP地址。基本方法是:计算机通过COM1/COM2口和路由器的Console口连接,在计算机上启用“超级终端”程序,设置“波特率:9600 ,数据位:8,停止位:1,奇偶校验: 无,校验:无”即可。常用 ②Telnet方式。该方式配置要求路由器必须配置了IP地址。基本方法是:计算机通过网卡和路由器的以太网接口相连,计算机的网卡和路由器的以太网接口的IP地址必须在同一网段。常用 ③其他方式:AUX口接MODEM,通过电话线与远方运行终端仿真软件的微机;通过Ethernet上的TFTP服务器;通过Ethernet上的SNMP网管工作站。 2、路由器的工作模式 在命令行状态下,主要有以下几种工作模式: ①一般用户模式。主要用于查看路由器的基本信息,只能执行少数命令,不能对路由 器进行配置。提示符为:Router>;进入方式为:Telnet或Console ②使能(特权)模式。主要用于查看、测试、检查路由器或网络,不能对接口、路由 协议进行配置。提示符为:Router#;进入方式为:Router>enable。 ③全局配置模式。主要用于配置路由器的全局性参数。提示符为:Router(config)#; 进入方式为:Router#config ter。 ④全局模式下的子模式。包括:接口、路由协议、线路等。其进入方式和提示符如下: Router(config)#ineterface e0 //进入接口模式 Router(config-if)#//接口模式提示符 Router(config)#rip //进入路由协议模式 Router(config-router)# //路由协议模式 Router(config)#line con 0 //进入线路模式
cisco路由器常用命令 1:三大模式 router> 用户模式 router > enable 进入特权模式 router # router > enable 进入全局配置模式 router #configure terminal router (conf)# 2:其它模式 Router(config)#interface f1/0 进入接口配置模式Router(config-if)# Router(config)#interface f1/0.1 进入子接口配置模式Router(config-subif)# Router(config)#line console 0 进入line模式Router(config-line)# Router(config)#router rip 进入路由模式Router(config-router)# 3:路由器命名 hostname routera,以routerA为例 router > enable router #configure terminal router(conf)#hostname routerA routera (conf)# 4:配置各类密码 配置特权模式密码(使能口令) enable password cisco,以cisco为例 router > enable router #configure terminal router(conf)#hostname routerA routerA (conf)# enable password cisco 设置VTY(虚拟终端接口)密码 Router(config)#line vty 0 1
CISCO路由器配置手册----Frame Relay 1. 帧中继技术 帧中继是一种高性能的WAN协议,它运行在OSI参考模型的物理层和数据链路层。它是一种数据包交换技术,是X.25的简化版本。它省略了X.25的一些强健功能,如提供窗口技术和数据重发技术,而是依靠高层协议提供纠错功能,这是因为帧中继工作在更好的WAN设备上,这些设备较之X.25的WAN设备具有更可靠的连接服务和更高的可靠性,它严格地对应于OSI参考模型的最低二层,而X.25还提供第三层的服务,所以,帧中继比X.25具有更高的性能和更有效的传输效率。 帧中继广域网的设备分为数据终端设备(DTE)和数据电路终端设备(DCE),Cisco 路由器作为 DTE设备。 帧中继技术提供面向连接的数据链路层的通信,在每对设备之间都存在一条定义好的通信链路,且该链路有一个链路识别码。这种服务通过帧中继虚电路实现,每个帧中继虚电路都以数据链路识别码(DLCI)标识自己。DLCI的值一般由帧中继服务提供商指定。帧中继即支持PVC也支持SVC。 帧中继本地管理接口(LMI)是对基本的帧中继标准的扩展。它是路由器和帧中继交换机之间信令标准,提供帧中继管理机制。它提供了许多管理复杂互联网络的特性,其中包括全局寻址、虚电路状态消息和多目发送等功能。 2. 有关命令: 端口设置 任务命令 设置Frame Relay封装encapsulation frame-relay[ietf] 1 设置Frame Relay LMI类型frame-relay lmi-type {ansi | cisco | q933a}2 设置子接口interface interface-type interface-number.subinterface -number [multipoint|point-to-point] 映射协议地址与DLCI frame-relay map protocol protocol-address dlci
思科交换机命令大全 (一) 序号/类别基于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
视图模式介绍: 普通视图 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常用配置命令Cisco常用配置命令 一.交换机的基本配置 C2950# config terminal 进入全局配置模式 show interface fastethernet0/1 查看端口0/1的配置结果 show interface fastethernet0/1 status 查看端口0/1的状态 show mac-address-table 查看整个MAC地址表 clear mac-address-table restricted static 清除限定性地址 C2950(config)# hostname 2950A / 设置主机名为2950A interface f0/23 / 进入端口23的配置模式 enable password cisco / 设置enable password为cisco enable secret cisco1 / 设置enable secret为cisco1 ip address 192.168.1.1 255.255.255.0 / 设置交换机IP 地址 ip default-gateway 192.168.1.254 / 设置默认网关 ip domain-name https://www.doczj.com/doc/5a414964.html, / 设置域名 ip name-server 200.0.0.1 / 设置域名服务器 配置查看MAC地址表 mac-address-table ? mac-address-table aging-time 100 / 设置超时是时间为100s mac-address-table permanent https://www.doczj.com/doc/5a414964.html, /f0/3 加入永久地址mac-address-table restricted static 0000.0c02.bbcc / f0/6 f0/7 加入静态地址 end show mac-address-table /查看整个Mac地址表 clear mac-address-table restricted static C2950(config-if)# interface fastethernet0/1 /进入接口F0/1子配置模式 interface Ethernet0 /进入以太网口0子配置模式 no shutdown /激活接口 speed ? /查看speed命令的子命令 speed 100 /设置该端口速率为100Mb/s dulplex full/half/auto /设置该端口为全双工 description TO_PC1 /设置该端口描述为TO_PC1 show interface fastethernet 0/1 /查看端口0/1的配置结果 show interface fastethernet 0/1 status /查看端口0/1的状态 配置VTP和STP 一. 配置VTP 2950A #vlan database /进入VLAN配置子模式 show vtp status /查看VTP设置信息 show vlan /查看VLAN配置信息 copy running-config startup-config /保存配置文件 2950A(vlan)#vtp server/client /设置本交换机为server/client模式
思科路由器查看配置命令 show run// 看运行状况 show ip route// 看路由表 show int// 看断口 * show ip int br// 看端口 ip 地址 show cdp nei// 察看 cdp 邻居 show ip pro// 察看 ip 协议 查看配置信息用 show 命令,该命令可以在用户模式和特权模式下执行,且在特权模式下看 到的信息比用户模式多。 show 命令很多,常用的有: 1、查看运行配置文件: Router#show running-config 运行配置文件 running-config 位于路由器的 RAM 中,存放的是路由器当前使用的配置信息。 2、查看启动配置文件: Router#show startup-config 启动配置文件 startup-config 位于路由器的 NVRAM 中,可以长期保存。它在启动路由器时装入 RAM ,成为 running-config 。 3、查看路由器的版本信息: Router#show version' 4、查看路由器的接口状态: Router#show ip interface brief 如果接口状态标识为“ Down ”,表示此接口未激活,如果标识为“ Up”,表示此接口已经激活。 5、查看路由表:
Router#show ip route 通过路由表可以看出该路由器已经识别的网络。 6、查看 NAT 翻译情况: Router#show ip nat translation 应该先进行内网与外网的通讯(如:用 ping 命令 ),然后再查看,才能看到翻译情况。
思科路由器常用配置命令大全 本文按字母顺序列举了思科路由器常用配置命令,适合思科路由器操作人员随时查看 Access-enable允许路由器在动态访问列表中创建临时访问列表入口 Access-group把访问控制列表(ACL)应用到接口上 Access-list定义一个标准的IP ACL Access-template在连接的路由器上手动替换临时访问列表入口 Appn向APPN子系统发送命令 Atmsig 执行ATM信令命令 B 手动引导操作系统 Bandwidth 设置接口的带宽 Banner motd 指定日期信息标语 Bfe 设置突发事件手册模式 Boot system 指定路由器启动时加载的系统映像 Calendar 设置硬件日历 Cd 更改路径 Cdp enable 允许接口运行CDP协议 Clear 复位功能 Clear counters 清除接口计数器 Clear interface 重新启动接口上的件逻辑 Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率 Cmt 开启/关闭FDDI连接管理功能 Config-register 修改配置寄存器设置 Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息 Configure memory 从NVRAM加载配置信息 Configure terminal 从终端进行手动配置 Connect 打开一个终端连接 Copy 复制配置或映像数据 Copy flash tftp 备份系统映像文件到TFTP服务器 Copy running-config startup-config 将RAM中的当前配置存储到NVRAM Copy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上 Copy tftp flash 从TFTP服务器上下载新映像到Flash Copy tftp running-config 从TFTP服务器上下载配置文件 Debug 使用调试功能 Debug dialer 显示接口在拨什么号及诸如此类的信息 Debug ip rip 显示RIP路由选择更新数据 Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息 Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息 Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程 Debug ppp 显示在实施PPP中发生的业务和交换信息 Delete 删除文件 Deny 为一个已命名的IP ACL设置条件 Dialer idle-timeout 规定线路断开前的空闲时间的长度 Dialer map 设置一个串行接口来呼叫一个或多个地点 Dialer wait-for-carrier-time 规定花多长时间等待一个载体 Dialer-group 通过对属于一个特定拨号组的接口进行配置来访问控制 Dialer-list protocol 定义一个数字数据接受器(DDR)拨号表以通过协议或ACL与协议的组合来控
路由基础配置命令UTP双绞线类型: 直通线: 交叉线: 广域网线缆连接类型: DTE: DCE: 时钟速率: 路由器的接口:(作用) 1. 广域网接口: serial 2. 内网接口: fastethernet 3. 管理接口: console (控制台) AUX(备份) 连接两个设备: 1. 物理连接 2. 逻辑连接 配置网络设备: 1. 管理属性:用户名密码描述警告 2. 协议地址:IP IPX 3. 协议策略:vlan 静态访问控制 交换机直接可以应用 路由器需要初始配置才能应用 设备启动过程: 1. 加电自检 2. 查找加载操作系统 3. 查找加载配置文件 配置网络设备方式: 1. 初始配置:console 2. 初始配置后通过interface(拥有ip地址的接口): 1)telnet 2)TFTP 3)WEB 4)网络管理工具: SNA SDM 配置直接应用到内存
登陆路由器: Router> Router>enable /*进入特权模式 Router# Router#disable /*退出特权模式 Router> Router>logout /*退出路由器 Router>exit /*退出路由器 路由器IOS帮助功能:?的三个用法 1/ 直接问号 2/ Router#cl? clear clock Router#cl 3/ Router#clock % Incomplete command. Router#clock ? set Set the time and date Router#clock 问号的帮助功能:(查找路由器设置时间的命令并设置时间) Router#cl? clear clock Router#clock % Incomplete command. Router#clock ? set Set the time and date Router#clock set % Incomplete command. Router#clock set ? hh:mm:ss Current Time Router#clock set 11:04:50 % Incomplete command. Router#clock set 11:04:50 ? <1-31> Day of the month MONTH Month of the year Router#clock set 11:04:50 15