思科路由器命令大全完整版
思科路由器常用命令集

default-network 标志网络作为缺省网关候选
default-gateway 指定缺省网(如果没有路由IP)
domain-list 完成无资格主机的域名
domain-lookup 打开IP域名服务系统主机转换
domain-name 定义缺省域名
Exec-timeout 配置EXEC命令解释器在检测到用户输入前所等待的时间
Exit 退出所有配置模式或者关闭一个激活的终端会话和终止一个EXEC
Exit 终止任何配置模式或关闭一个活动的对话和结束EXEC
forward-protocol 控制前向的、物理的、直接的IP广播
host 为IP主机表增加一个入口
host-routing 打开基于主机的路由(代理ARP和再定向)
hp-host 打开HP代理探测服务
mobile-host 移动主机数据库
multicast-routing 打开前向IP
reload 停机并执行冷启动
resume 恢复一个活动的网络连接
rlogin 打开远程注册连接
rsh 执行一个远端命令
send 发送信息到另外的终端行
setup 运行setup命令
show 显示正在运行系统信息
slip 开始SLIP协议
start-chat 在命令行上执行对话描述
end 从设置模式退出
exit 从设置模式退出
frame-relay 全局帧中继设置命令
help 交互帮助系统的描述
hostname 设置系统网络名
iterface 选择设置的端口
ip 全局地址设置子命令
思科路由器命令大全(完整版)

思科路由器命令大全(完整版)思科路由器命令大全(完整版)本文档旨在提供思科路由器命令的详细说明和使用指南,包括路由器配置、网络管理、安全性设置等内容。
每个章节都详细介绍了不同的命令和参数,以帮助用户更好地理解和使用思科路由器。
1:路由器基本配置1.1 主机名设置1.2 用户名和密码设置1.3 IP 地址和子网掩码配置1.4 默认网关配置2:接口配置2.1 以太网接口配置2.2 串行接口配置2.3 子接口配置2.4 虚拟局域网 (VLAN) 配置3:路由协议配置3.1 静态路由配置3.2 动态路由配置3.2.1 RIP 配置3.2.2 OSPF 配置3.2.3 BGP 配置4:网络管理4.1 SNMP 配置4.2 NetFlow 配置4.3 Syslog 配置4.4 路由器时间设置5:安全性配置5.1 访问控制列表 (ACL) 配置5.2 VPN 配置5.3 防火墙配置5.4 AAA 配置附件:本文档附带的附件包括示例配置文件、命令输出示例等,以帮助读者更好地理解和应用文档中的内容。
法律名词及注释:本文档所涉及的法律名词及其注释如下:1:主机名:指路由器的主机标识名称,用于在网络中识别路由器。
2:用户名和密码:用于登录和管理路由器的凭证信息。
3: IP 地址:网络协议中用于唯一标识设备的数字地址。
4:子网掩码:用于标识 IP 地址中网络部分和主机部分的分界线。
5:默认网关:用于转发网络流量的下一跳路由器。
6:以太网接口:用于连接局域网设备的物理接口。
7:串行接口:用于连接广域网设备的物理接口。
8:子接口:在一个物理接口上创建多个逻辑接口,用于实现VLAN 分隔等功能。
9:虚拟局域网 (VLAN):用于将局域网划分成多个逻辑网络的技术。
10:静态路由:手动配置的路由表项,用于指定数据包传输的路径。
11:动态路由:根据路由协议动态学习和更新的路由表项,用于自动路由选择。
12: RIP:路由信息协议,一种距离向量路由协议。
Cisco路由器命令总结

Cisco路由器命令总结2010-05-06 15:03路由器命令状态:>> 路由器处于rxboot状态,开机60秒内按ctrl+break可进入此状态用于软件升级和手工引导.router>用户命令状态,只能查看一些基本信息router#特权命令状态router(config)#全局设置状态router(config-if)#接口设置状态路由器口令设置:router>enable 进入特权模式router#config terminal 进入全局配置模式router(config)#hostname <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 <f0/1> 进入Serail接口router(config-if)#ip address <ip> <netmask> 设置IP地址router(config-if)#ip address <ip><netmask> 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><netmask> 设置子接口IP router(config-subif.1)#encapsulation dot1q <isl>序号绑定vlan中继协议 (vlan三层路由)注: dot1q 为IEEE802.1Q标准 isl为思科专用router#write 保存配置信息router#copy running-config startup-config 保存当前配置nvramrouter#debug ip rip<events> 监测配置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 <ip-address> <subnet-mask> <下一跳><distance> 命令格式注: 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路由协议。
最新整理cisco路由器常用命令大全

c i s c o路由器常用命令大全思科c i s c o制造的路由器设备、交换机和其他设备承载了全球80%的互联网通信,成为硅谷中新经济的传奇,那么你知道c i s c o常用命令有哪些吗?下面是学习啦小编整理的一些关于c i s c o常用命令的相关资料,供你参考。
c i s c o常用命令1、S w i t c h用户模式2、S w i t c h e n a b l e进入特权模式S w i t c h#3、S w i t c h#c o n f i g t e r m i n a l进入全局模式S w i t c h(c o n f i g)#4、S w i t c h(c o n f i g)#i n t e r f a c e f0/1进入接口模式 S w i t c h(c o n f i g-i f)#5、S w i t c h(c o n f i g)#l i n e c o n s o l e0进入l i n e模式S w i t c h(c o n f i g-l i n e)#e x i t退回上层e n d结束所有操作6、S w i t c h(c o n f i g)#h o s t n a m e a a a配置主机名7、s w i t c h#s h o w r u n n i n g-c o n f i g查看配置情况8、S w i t c h(c o n f i g)#e n a b l e p a s s w o r d111设置使能密码(明文)9、S w i t c h(c o n f i g)#e n a b l e s e c r e t111设置使能密码(密文)S w i t c h(c o n f i g)#l i n e c o n s o l e0设置c o n s o l e密码S w i t c h(c o n f i g-l i n e)#p a s s w o r d333S w i t c h(c o n f i g-l i n e)#l o g i n10、S w i t c h(c o n f i g)#i n t e r f a c e v l a n1S w i t c h(c o n f i g-i f)#i p a d d r e s s192.168.1.1 255.255.255.0设置I P地址S w i t c h(c o n f i g-i f)#n o s h u t d o w n11、S w i t c h(c o n f i g)#i p d e f a u l t-g a t e w a y192.168.1.10设置网关12、S w i t c h#s h o w m a c-a d d r e s s-t a b l e查看M A C地址表13、S w i t c h#s h o w c d p c d p全局配置信息14、S w i t c h#s h o w c d p i n t e r f a c e f0/1c d p接口配置信息15、S w i t c h#s h o w c d p t r a f f i c c d p包的配置信息16、S w i t c h#s h o w c d p n e i g h b o r s c d p邻居基本信息17、S w i t c h#s h o w c d p n e i g h b o r s d e t a i l c d p邻居详细信息S w i t c h#s h o w c d p n e i g h b o r s e n t r y18、S w i t c h#c o p y r u n n i n g-c o n f i g s t a r t u p-c o n f i g S w i t c h#w r i t e保存交换机配置信息19、S w i t c h#e r a s e s t a r t u p-c o n f i g恢复出厂信息 S w i t c h#r e l o a d重新加载20、交换机密码恢复*断开电源*按住M O D E键,加电(等待数秒)*s w i t c h:出现此符号*s w i t c h:f l a s h_i n i t初始化f l a s h*s w i t c h:d i r f l a s h:(查看文件,可省去)*s w i t c h:r e n a m e c o n f i g.t e x t c o n f i g.o l d改名*s w i t c h:b o o t重启*s w i t c h e n a b l e进入特权*s w i t c h#d i r f l a s h:(查看文件,可省去)*s w i t c h#r e n a m e c o n f i g.o l d c o n f i g.t e x t改名*s w i t c h#c o p y f l a s h:c o n f i g.t e x t r u n n i n g-c o n f i g 复制到系统内*s w i t c h#c o n f i t t e r m i n a l进入全局模式*s w i t c h(c o n f i g)#e n a b l e p a s s w o r d222设置新密码21、s w i t c h#s h o w v l a n-s w b r i e f查看v l a n22、s w i t c h#v l a n d a t a b a s e进入v l a n模式s w i t c h(v l a n)#v l a n20n a m e b b b创建v l a n并命名23、s w i t c h(v l a n)#n o v l a n20删除v l a n24、添加端口到v l a n(单个)s w i t c h(c o n f i g)#i n t e r f a c e f0/1进入接口模式s w i t c h(c o n f i g-i f)#s w i t c h p o r t a c c e s s v l a n 10添加至v l a n10s w i t c h(c o n f i g-i f)#e n d退出s w i t c h#s h o w v l a n b r i e f(i d)验证v l a ns w i t c h(c o n f i g)#s h o w r u n n i n g-c o n f i g i n t e r f a c e f0/1(查看某接口)25、添加端口到v l a n(批量)s w i t c h(c o n f i g)#i n t e r f a c e r a n g e f0/1-5s w i t c h(c o n f i g-i f-r a n g e)#s w i t c h p o r t a c c e s sv l a n1026、s w i t c h(c o n f i g)#i n t e r f a c e f0/1进入接口s w i t c h(c o n f i g-i f)#s w i t c h p o r t m o d e t r u n k设置为t r u n k(永久)s w i t c h(c o n f i g-i f)#s w i t c h p o r t m o d e d y n a m i cd e s i r a b l e/a u t o(其它t r u n k)s w i t c h(c o n f i g-i f)#s w i t c h p o r t t r u n k a l l o w e d v l a n r e m o v e10移除v l a n10)s w i t c h(c o n f i g-i f)#s w i t c h p o r t t r u n k a l l o w e d v l a n a d d20添加v l a n2027、s w i t c h#s h o w i n t e r f a c e f0/1s w i t c h p o r t查看接口模式s h o w i p i n t e r f a c e b r i e f看过文章c i s c o常用命令的人还看了:1.C I S C O路由器的配置与调试2.C i s c o路由器常用配置命令3.C i s c o路由器配置命令全攻略4.如何查看C i s c o路由器的配置信息5.思科C i s c o路由器的基础配置知识6.思科路由器怎么进入思科路由器怎么设置。
思科路由器配置命令大全

思科路由器配置命令大全思科路由器配置命令大全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 设置控制台会话超时为0service 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 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息+ # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport 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的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port- channel port-channel-number} 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN 号或旧的来进行修改。
思科路由器命令集

路由器基本操作命令:Router>enable(进入特权模式)Router#configure(进入全局配置模式)Router#show history(查看历史输入命令)Router#show flash(查看闪存信息)Router#show running-config(显示运行配置内容)Router#show startup-config(显示启动配置内容)Router#show interfaces(查看端口配置信息)Router#show protocols(查看配置协议信息)Router#show ip protocols(查看路由协议)Router#show ip route(查看路由表信息)Router#(config)hostname **(修改主机名称,“**”代表新的主机名称)Router(config-if)#description **(进入端口后修改端口标识,“**”代表你要修改的名称)设置console口密码:Router(config)#line console 0Router(config-line)#loginRouter(config-line)#password ****Telnet远程配置虚拟接口密码设置:Router(config)#line vty 0 4Router(config-line)#loginRouter(config-line)#password ****设置Enable密码和Secret密码:Router(config)#enable password ****Router(config)#enable secret ****配置以太网口:Router(config)#interface F0/0(进入端口)Router(config-if)#ip address 192.168.1.10 255.255.255.0(配置IP地址与子网掩码)Router(config-if)#no shutdown(激活端口)配置与子接口:Router(config)#interface F0/0.1Router(config-subif)#encapsulation dot1Q vlan号Router(config-subif)#ip address 192.168.1.100 255.255.255.0(配置IP地址与子网掩码)Router(config-subif)#no shutdown(激活端口)配置DCE串口:Router(config)#interface S0/0/0(进入端口)Router(config-if)#ip address 192.168.2.10 255.255.255.0(配置IP地址与子网掩码)Router(config-if)#clock rate 56000(在时钟端设置时钟频率)Router(config-if)#bandwidth 56(设置带宽端口)Router(config-if)#no shutdown(激活端口)路由器Telnet相关:Router#telnet 192.168.1.100(远程登录到路由器)Router#show user(查看当前用户)Router#clear line vty 0 4(终止Telnet连接)保存当前路由器配置:Router#writeRouter#copy running-config startup-configRouter#reload备份IOS配置到TFTP服务器:Router#show flash(确定内存配置信息的文件名)Router#copy flash tftpRouter#copy run tftpRouter#copy start tftp从TFTP服务器下载IOS配置Router#copy tftp flashRouter#copy tftp runRouter#copy tftp start主机名与域名静态解析:Router(config)#ip host name XXX 192.168.1.100(“XXX”为主机名或域名,后面跟IP,一个主机名可以对应多个IP)指定DNS服务器地址:Router(config)#ip domain-lookup(打开DNS服务)Router(config)#ip name-server 192.168.1.100(最多可添加6个)Router(config)#no ip domain-lookup(关闭DNS服务)静态路由:Router(config)#ip route 路由的网段子网掩码缺省路由:Router(config)#ip route 0.0.0.0 0.0.0.0 下一个路由器地址(可以是自己的端口号)RIP动态路由相关:Router(config)#router ripRouter(config-router)#version 2(启用RIP版本2)Router(config-router)#network 直连网段Router#debug ip rip(查看RIP动态学习信息)OSPF动态路由相关:Router(config)#router ospf 进程IDRouter(config-router)#network 直连网段反掩码 area 区域号(参与路由的区域必须在同一个)Router(config-if)#ip ospf cost 开销数(修改端口的开销)Router#show ip ospf interface(显示OSPF邻接信息)Router#show ip ospf(显示OSPF生效时间)Router#show ip ospf neighbor detail(显示DR/BDR和邻居信息)Router#show ip ospf databaseRouter#debug ip ospf(显示OSPF动态学习过程)EIGRP动态路由相关:Router(config)#router eigrp 进程IDRouter(config-router)#network 直连网段Router#show ip eigrp neighbors(查看EIGRP邻居信息)Router#show ip eigrp topology(查看EIGRP拓扑结构)Router#show ip eigrp traffic(查看EIGRP信息包)Router(config-if)#bandwidth 1000(设定路由信息传输带宽,单位为Kbps)标准访问控制列表:Router(config)#access-list 列表号(1-99) permit/deny(允许或拒绝)来源地址反掩码(创建ACL)Router(config)#interface F0/0Router(config-if)#ip access-group 列表号 in/out(在端口上应用列表规则)扩展访问控制列表:Router(config)#access-list 列表号(1-99) permit/deny(允许或拒绝)协议类型来源地址反掩码目标地址反掩码 eq等于/lt小于/gt大于/neq不等于端口号(创建ACL)Router(config)#interface F0/0Router(config-if)#ip access-group 列表号 in/out(在端口上应用列表规则)在虚拟接口上应用规则:Router(config)#line vty 0 4Router(config-line)#access-class 列表号 in/out查看已配置的ACL内容:Router#show access-lists复用动态NAT:Router(config)#ip nat pool 地址池名称200.200.200.200 200.200.200.200 netmask 子网掩码(建立地址池:由于可用外网地址只有一个,所以起始地址与结束地址都是同一个)Router(config)#access-list 列表号(1-99) permit/deny 源地址反掩码(定义ACL)Router(config)#ip nat inside source list ACL号 pool 地址池名称 overload (地址池与ACL绑定)Router(config-if)#ip nat inside(指定内部端口)Router(config-if)#ip nat outside(指定外部端口)动态NAT:Router(config)#ip nat pool 地址池名称起始地址终止地址netmask 子网掩码(建立地址池)Router(config)#access-list 列表号(1-99) permit/deny 源地址反掩码(定义ACL)Router(config)#ip nat inside source list ACL号 pool 地址池名称 overload (地址池与ACL绑定)Router(config-if)#ip nat inside(指定内部端口)Router(config-if)#ip nat outside(指定外部端口)静态NAT:Router(config)#ip nat pool 地址池名称起始地址终止地址netmask 子网掩码(建立地址池)Router(config)#access-list 列表号(1-99) permit/deny 源地址反掩码(定义ACL)Router(config)#ip nat inside source list ACL号 pool 地址池名称 overload (地址池与ACL绑定)Router(config)#ip nat inside source static 内网地址外网地址(内网地址与外网地址绑定)Router(config-if)#ip nat inside(指定内部端口)Router(config-if)#ip nat outside(指定外部端口)交换机的基本操作:Switch>enable (进入交换机特权模式)Switch#config (进入全局配置模式)→Switch(config)#Switch(config)#interface f0/0 → Switch(config-if)#(进入端口)Switch#show vlan(查看VLAN信息)其他的与路由器大同小异交换机enable密码与secret密码设置:Switch(config)#enable password ****Switch(config)#enable secret ****交换机TELNET虚拟接口配置:Switch(config)#line vty 0 15Switch(config-line)#loginSwitch(config-line)#password ****VLAN的配置相关:Switch#vlan database(进入vlan数据库)Switch(vlan)#vlan 2 vlan名称(创建VLAN)Switch(config)#interface f0/0Switch(config-if)#switch mode accessSwitch(config-if)#switch access vlan 2(将端口加入VLAN)Switch(config-if)#switchport access vlan 2Switch(config)#interface vlan 2Switch(config-if)#ip address 192.168.1.100 255.255.255.0(为VLAN配置IP地址,方便TELNET管理)设置端口工作模式:Switch(config)#interface f0/0Switch(config-if)#speed auto/10/100(设置工作带宽Mbps)Switch(config-if)#duplex auto/full/half(设置半双工、全双工)端口安全配置:Switch(config-if)#switchport mode access(修改端口为访问模式)Switch(config-if)#switchport port-security(开启端口安全)Switch(config-if)#switchport port-security mac-address 被绑定的MAC地址(端口绑定MAC地址)Switch(config-if)#switchport port-security maximum *(端口可学习的MAC地址最大数量)Switch(config-if)#switchport port-security violation shutdown/protect/restrict (激活端口安全规则)交换机二层汇聚配置:Switch(config)#interface f0/0Switch(config-if)#switchport mode trunk交换机添加网关Switch(config)#ip default-gateway 192.168.100.254三层交换作为DHCP服务器Switch(config)#ip dhcp excluded-address 192.168.100.254(设置保留地址)Switch(config)#ip dhcp pool xiaoshoubu(创建地址池)Switch(dhcp-config)#network 192.168.100.0 255.255.255.0(地址池网段)Switch(dhcp-config)#default-router 192.168.100.254(分配网关)批量进入端口s1(config)#interface range fastEthernet 0/1 - fastEthernet 0/2s1(config-if-range)#选择链路聚合协议s1(config-if-range)# channel-protocol lacp配置虚拟组号s1(config-if-range)#channel-group 1 mode active指定三层交换机汇聚链路封装类型Switch(config-if-range)#switchport trunk encapsulation dot1qSwitch(config-if-range)#switchport mode trunk。
思科交换机路由器命令大全

思科交换机路由器命令大全思科交换机和路由器命令大全本文档为思科交换机和路由器命令的最新最全范本,供参考使用。
以下是详细的命令列表,包括每个命令的说明和用法。
一、接口配置命令1、ip address:设置接口的IP地质示例:ip address 192.168.1.1 255.255.255:02、no shutdown:启用接口示例:no shutdown3、duplex:设置接口的双工模式示例:duplex auto4、speed:设置接口的速度示例:speed 1005、exit:退出接口配置模式示例:exit二、VLAN命令1、vlan database:进入VLAN数据库模式示例:vlan database2、vlan id name:创建VLAN并设置名称示例:vlan 10 name VLAN-103、vlan id:删除VLAN示例:no vlan 104、show vlan:显示VLAN信息示例:show vlan5、exit:退出VLAN数据库模式示例:exit三、路由命令1、ip route:设置静态路由示例:ip route 192.168.2:0 255.255.255:0 192.168.1.22、router rip:启用RIP路由协议示例:router rip3、network:将网络添加到RIP路由表中示例:network 10:0:0:04、redistribute:将静态路由或其他路由协议添加到RIP路由表中示例:redistribute static5、exit:退出路由配置模式示例:exit四、ACL命令1、access-list:创建标准或扩展ACL示例:access-list 10 permit 192.168.1:0 0:0:0.2552、ip access-group:应用ACL到接口示例:ip access-group 10 in3、show access-lists:显示ACL信息示例:show access-lists4、exit:退出ACL配置模式示例:exit五、SNMP命令1、snmp-server community:设置SNMP团体字符串示例:snmp-server community public RO2、snmp-server enable traps:启用SNMP陷阱示例:snmp-server enable traps3、snmp-server host:配置SNMP陷阱接收主机示例:snmp-server host 192.168.1.1004、exit:退出SNMP配置模式示例:exit六、SSH命令1、ip ssh version:设置SSH协议版本示例:ip ssh version 22、crypto key generate rsa:RSA密钥对示例:crypto key generate rsa3、username:创建新的本地用户示例:username admin privilege 15 password password1234、exit:退出SSH配置模式示例:exit七、其他命令1、show running-config:显示当前配置示例:show running-config2、copy running-config startup-config:将当前配置保存到启动配置中示例:copy running-config startup-config3、reload:重新启动设备示例:reload4、exit:退出CLI命令行模式示例:exit本文档涉及附件:1、无附件本文所涉及的法律名词及注释:1、ACL(Access Control List):访问控制列表,用于控制网络流量的进出。
思科交换路由常用命令

交换路由常用命令一、基础配置1、修改主机名配置:S(config)#hostname SWITCHA2、enable口令:Switch(config)#enable password1233、TELNET:只需密码的telnet需用户名和密码的telnetS(config)#line vty04S(config)#username S2password123S(config-line)#password123S(config)#line vty04S(config-line)#login//启用登陆时口令检查S(config-line)#login local//启用登陆本地验证只允许pc所在的网段对交换路由进行远程登陆:S(config)#access-list99permit192.168.1.00.0.0.255S(config)#line vty04S(config-line)#access-class99inS(config-line)#password123S(config-line)#login4、console配置:S(config)#line console0S(config-line)#password123S(config-line)#login5、显示当前配置:switch#show run6、保存当前配置:switch#write7、进入全局配置模式:switch#conf t8、进入接口配置模式:S(config)#interface f0/1二、二层接入交换机常见配置1、创建vlan10及命名:S(config)#vlan10S(config-vlan)#name caiwubu2、多个端口划分入vlan:vlan:S(config)#int range fa0/1-5S(config-if)#sw access vlan103、接口trunk模式配置:S(config)#inter f0/0S(config-if)#sw mode trunk4、二层交换机管理ip配置:S2(config)#interface vlan100//进入vlan100接口S2(config-if)#ip address192.168.10.1255.255.255.0//为vlan100接口上设置管理ip S2(config)#ip default-gateway192.168.10.2545、生成树配置:S(config)#spanning-tree mode rapid-pvst//配置快速生成树S(config)#spanning-tree vlan10,20priority0//配置根网桥S(config)#spanning-tree vlan10,20,30priority4096//配置备份根网桥6、端口双工、带宽设置:S(config)#int F0/2S(config-if)#duplex fullS(config-if)#speed100三、三层交换机常见配置1、三层交换机开启路由功能:S(config)#ip routing//开启后可实现vlan间相互通信2、三层交换机接口配置成路由口:S(config-if)#no swtichport//在接口模式下配置,可配置ip地址3、三层交换机创建SVI接口(SVI接口常作为vlan的网关):S(config)#interface vlan104、三层交换机接口改trunk模式:Switch(config-if)#switchport trunk encapsulation dot1q//先封装Switch(config-if)#switchport mode trunk//再设置trunk模式5、trunk允许vlan通过:S(config)#inter fa0/23S(config-if)#switchport trunk allowed vlan2,3//trunk口只让vlan2,3通过S(config-if)#switchport trunk allowed vlan all//trunk口允许所有的vlan通过四、路由器常见配置1、ip地址设置:router(config-if)#ip address192.168.1.1255.255.255.0//接口模式下配置2、静态路由配置:router(config)#ip route192.168.1.0255.255.255.010.1.1.1{f0/0}//下一跳地址可替换为出接口3、默认路由配置:router(config)#ip route0.0.0.00.0.0.010.1.1.14、浮动静态路由作为备份路由:R(config)#ip route172.16.20.0255.255.255.010.10.10.4R(config)#ip route172.16.20.0255.255.255.010.10.10.6100//路由开销值100比默认值1大,作为备份路由5、路由可达,有去有回。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
思科交换机路由器命令大全交换机命令:switch> 用户模式1:进入特权模式 enableswitch> enableswitch#2:进入全局配置模式 configure terminalswitch> enableswitch#configure terminalswitch(conf)#3:交换机命名 hostname aptech2950 以aptech2950为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#4:配置使能口令 enable password cisco 以cisco为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco5:配置使能密码 enable secret ciscolab 以cicsolab为例--设置禁用IP地址解析特性,设置启用消息同步特性switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable secret ciscolabaptech2950(conf)#no ip domain-lookup -----设置禁用IP地址解析特性aptech2950(conf)#logging synchronous -----设置启用消息同步特性aptech2950(conf)#interface range fastethernet0/1-20aptech2950(conf-if-range)#spanning-tree portfast -----设置快速端口aptech2950(conf)#interface range fastethernet 0/23-24aptech2950(conf-if-range)#swichport mode trunk -----设置主干道端口aptech2950(conf)#spanning-tree uplingkfast ---设置阻塞启用迅速(只可以在访问层启用)6:设置虚拟局域网vlan 1 interface vlan 1switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1配置交换机端口ip和子网掩码aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit设置网关地址7:进入交换机某一端口 interface fastehernet 0/17 以17端口为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface fastehernet 0/17aptech2950(conf-if)#8:查看命令 showswitch> enableswitch# 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地址表自动老化时间9:交换机恢复出厂默认恢复命令switch> enableswitch# erase startup-configureswitch# reload10:双工模式设置switch> enableswitch#configure terminalswitch2950(conf)#hostname aptch-2950aptech2950(conf)# interface fastehernet 0/17 以17端口为例aptech2950(conf-if)#duplex full/half/auto 有full , half, auto 三个可选项11:cdp相关命令switch> enableswitch# show cdp 查看设备的cdp全局配置信息show cdp interface fastethernet 0/17 查看17端口的cdp配置信息show cdp traffic 查看有关cdp包的统计信息show cdp nerghbors 列出与设备相连的cisco设备12:csico2950的密码恢复拔下交换机电源线。
用手按着交换机的MODE键,插上电源线在switch:后执行flash_ini命令:switch: flash_ini查看flash中的文件: switch: dir flash:把“”文件改名为“”: switch: rename flash: flash:执行boot: switch: boot交换机进入是否进入配置的对话,执行no :进入特权模式察看flash里的文件: show flash :把“”文件改名为“”: switch: rename flash: flash:把“”拷入系统的“running-configure”: copy flash: system : running-configure 把配置模式重新设置密码存盘,密码恢复成功。
13:交换机telnet远程登录设置:switch>enswitch#configure terminalswitch(conf)#hostname aptech-2950aptech2950(conf)#enable password cisco 以cisco为特权模式密码aptech2950(conf)#interface fastethernet 0/1 以17端口为telnet远程登录端口aptech2950(conf-if)#no shutaptech2950(conf-if)#exitaptech2950(conf)line vty 0 4 设置0-4 个用户可以telnet远程登陆aptech2950(conf-line)#loginaptech2950(conf-line)#password edge 以edge为远程登录的用户密码主机设置:ip 主机的ip必须和交换机端口的地址在同一网络段netmaskgate-way 网关地址是交换机端口地址运行:进入telnet远程登录界面password : edgeaptech2950>enpassword: ciscoaptech#14:交换机配置的重新载入和保存设置完成交换机的配置后:aptech2950(conf)#reload是否保存(y/n) y: 保存设置信息 n:不保存设置信息路由器命令router> 用户模式1:进入特权模式 enablerouter > enablerouter #2:进入全局配置模式 configure terminalrouter > enablerouter #configure terminalrouter (conf)#3:交换机命名 hostname routera 以routerA为例router > enablerouter #configure terminalrouter(conf)#hostname routerAroutera (conf)#4:配置使能口令 enable password cisco 以cisco为例router > enablerouter #configure terminalrouter(conf)#hostname routerArouterA (conf)# enable password cisco5:配置使能密码 enable secret ciscolab 以cicsolab为例router > enablerouter #configure terminalrouter(conf)#hostname routerArouterA (conf)# enable secret ciscolab6:进入路由器某一端口 interface fastehernet 0/17 以17端口为例router > enablerouter #configure terminalrouter(conf)#hostname routerArouterA (conf)# interface fastehernet 0/17routerA (conf-if)#进入路由器的某一子端口 interface fastethernet 0/ 以17端口的1子端口为例router > enablerouter #configure terminalrouter(conf)#hostname routerArouterA (conf)# interface fastehernet 0/7:设置端口ip地址信息router > enablerouter #configure terminalrouter(conf)#hostname routerArouterA(conf)# interface fastehernet 0/17 以17端口为例配置交换机端口ip和子网掩码routerA (conf-if)#no shut 是配置处于运行中routerA (conf-if)#exit8:查看命令 showrouter > enablerouter # 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 > enablerouter # 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 0x2142remmon2>reset重新启动路由器后进入setup模式,选择“no”,退回到exec模式,此时路由器原有的配置仍然保存在startup-config中,为使路由器恢复密码后配置不变把startup-config中配置保存到running-config中,然后重新设置enable密码,并把配置寄存器改回0x2102:router>enablerouter#copy startup-config running-configrouter#configure terminalrouter(conf)#enable password ciscorouter(conf)#c onfig-register 0x2102保存当前配置到startup-config , 重新启动路由器。