思科路由器命令大全(完整版)

合集下载

思科交换机和路由器配置命令简写与完整对照(Excel文章多个页签_下载可见)

思科交换机和路由器配置命令简写与完整对照(Excel文章多个页签_下载可见)
Interface FastEthernet0/2 set to default configuration
完整命令
将端口加入到VLAN switch(config)#interface f0/2 switch(config-if)#switchport access vlan 30 验证VLAN配置信息 switch#show vlan brief switch#show vlan-switch 删除VLAN中的端口 1:switch(config-if)#no switchport access vlan 3 switch(config-if)#end 2:switch(config-if)#default interface f0/2 Building configuration...
宣告启用RIP的
switch(config)#end 同时将多个端口加入VLAN并验证 switch(config)#interface range f0/3 - 10 switch(config-if-range)#switchport access vlan 3 switch(config)#end switch#show vlan-switch 配置VLAN TRUHK switch(config)#interface f0/15 switch(config-if)#switchport mode trunk 从TRUNK中添加某个VLAN switch(config)#interface f0/15
switch(config-if)#no shutdown 删除交换机接口IP地址 switch(config-if)#no ip address 配置交换机默认网关 switch(config)#ip default-gateway 192.168.0.1 查看交换机的MAC地址表 switch#show mac-address-table 查看思科交换机相邻设备的详细信息 switch#show cdp neighbors detail 保存交换机配置 1:switch#copy running-config startup-config 2:switch#write 恢复交换机出厂配置 switch#erase startup-config switch#reload 创建VLAN switch#vlan database switch(vlan)#vlan 30 switch(vlan)#exit VLAN重命名 switch(vlan)#vlan 20 name benet VLAN 20 modified: Name: benet 删除VLAN switch(vlan)#no vlan 20 Deleting VLAN 2... switch(vlan)#exit

Cisco路由器命令总结

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交换机、路由器设置命令(附详解)

思科Cisco交换机、路由器设置命令(附详解)

交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname <hostname> ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令为xxx switch(config)#enable password xxx ;设置特权非密口令为xxx switch(config)#line console 0 ;进控制台口(Rs232)初始化switch(config-line)#line vty 0 4 ;进入虚拟终端virtual tty switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口1加入VLAN 2 switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain <name> ; 设置发vtp域名switch(config)#vtp password <word>switch(config)#vtp mode serverswitch(config)#vtp mode client交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address <IP> <mask> ;添加远程登录IPswitch(config)#ip default-gateway <IP> ;添加默认网关switch#dir flash: ;查看内存交换机显示命令:switch#write ;写入保存switch#show vtpswitch#show run ;查看当前配置信息switch#show 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.设置主机名/系统名IOS:witch(config)#hotname"hotname"CLI:witch(enable)etytemnamename-tring2.设置登录口令IOS:witch(config)#enablepawordlevel1pawordCLI:witch(enable)etpawordwitch(enable)etenalbepa3.设置远程访问IOS:witch(config)#interfacevlan1witch(config-if)#ipaddreip-addrenetmakwitch(config-if)#ipdefault-gatewayip-addreCLI:witch(enable)etinterfacec0ip-addrenetmakbroadcat-addre witch(enable)etinterfacec0vlanwitch(enable)etiproutedefaultgateway4.启用和浏览CDP信息IOS:witch(config-if)#cdpenablewitch(config-if)#nocdpenableCLI:witch(enable)etcdp{enable|diable}module/port5.查看Cico邻接设备的CDP通告IOS:witch#howcdpinterface[typemodle/port]witch#howcdpneighbor[typemodule/port][detail]CLI:witch(enable)howcdpneighbor[module/port][vlan|duple某|capabilitie|detail]6.端口描述IOS:witch(config-if)#decriptionecription-tring CLI:witch(enable)etportnamemodule/numberdecription-tring 7.设置端口速度IOS:witch(config-if)#peed{10|100|auto}CLI:witch(enable)etportpeedmoudle/number{10|100|auto}witch(enable)etportpeedmoudle/number{4|16|auto}8.设置以太网的链路模式IOS:witch(config-if)#duple某{auto|full|half}CLI:witch(enable)etportduple某module/number{full|half}9.配置静态VLANIOS:witch#vlandatabaewitch(vlan)#vlanvlan-numnamevlawitch(vlan)#e某itwitch#configureteriminalwitch(config)#interfaceinterfacemodule/numberwitch(config-if)#witchportmodeaccewitch(config-if)#witchportaccevlanvlan-numwitch(config-if)#endCLI:witch(enable)etvlanvlan-num[namename]witch(enable)etvlanvlan-nummod-num/port-lit10.配置VLAN中继线IOS:witch(config)#interfaceinterfacemod/portwitch(config-if)#witchportmodetrunkwitch(config-if)#witchporttrunkencapulation{il|dotlq}witch(config-if)#witchporttrunkallowedvlanremovevlan-litwitch(config-if)#witchporttrunkallowedvlanaddvlan-litCLI:witch(enable)ettrunkmodule/port[on|off|deirable|auto|nonegotiate] Vlan-range[il|dotlq|dotl0|lane|negotiate]11.配置VTP管理域IOS:witch#vlandatabaewitch(vlan)#vtpdomaindomain-nameCLI:witch(enable)etvtp[domaindomain-name]12.配置VTP模式IOS:witch#vlandatabaewitch(vlan)#vtpdomaindomain-namewitch(vlan)#vtp{ever|cilent|tranparent}witch(vlan)#vtppawordpawordCLI:witch(enable)etvtp[domaindomain-name][mode{ever|cilent|tranparent}][pawordpaword] 13.配置VTP版本IOS:witch#vlandatabaewitch(vlan)#vtpv2-modeCLI:witch(enable)etvtpv2enable14.启动VTP剪裁IOS:witch#vlandatabaewitch(vlan)#vtppruningCLI:witch(enable)etvtppruningenable15.配置以太信道IOS:witch(config-if)#portgroupgroup-number[ditribution{ource|detination}]CLI:witch(enable)etportchannelmoudle/port-rangemode{on|off|deirable|auto}16.调整根路径成本IOS:witch(config-if)#panning-tree[vlanvlan-lit]cotcotCLI:witch(enable)etpantreeportcotmoudle/portcotwitch(enable)etpantreeportvlancotmoudle/port[cotcot][vlan-lit]17.调整端口IDIOS:witch(config-if)#panning-tree[vlanvlan-lit]port-priorityport-priorityCLI:witch(enable)etpantreeportpri{mldule/port}prioritywitch(enable)etpantreeportvlanpri{module/port}priority[vlan] 18.修改STP时钟witch(config)#panning-tree[vlanvlan-lit]ma某-ageecondCLI:witch(enable)etpantreehellointerval[vlan]witch(enable)etpantreefwddelaydelay[vlan]witch(enable)etpantreema某ageagingtiame[vlan]19.启用或禁用PortFat特征IOS:witch(config-if)#panning-treeportfatCLI:witch(enable)etpantreeportfat{module/port}{enable|diable}20.启用或禁用UplinkFat特征IOS:witch(config)#panning-treeuplinkfat[ma某-update-ratepkt-per-econd]CLI:witch(enable)etpantreeuplinkfat{enable|diable}[rateupdate-rate][all-protocoloff|on]为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令:witch(config)#cluterenablecluter-name21.为了从一条中继链路上删除VLAN,可使用下列命令:witch(enable)cleartrunkmodule/portvlan-range22.用howvtpdomain显示管理域的VTP参数.23.用howvtptatitic显示管理域的VTP参数.24.在Catalyt交换机上定义TrBRF的命令如下:witch(enable)etvlanvlan-name[namename]typetrbrfbridgebridge-num[tp{ieee|ibm}]25.在Catalyt交换机上定义TrCRF的命令如下:witch(enable)etvlanvlan-num[namename]typetrcrf{ringhe某-ring-num|decringdecimal-ring-num}parentvlan-num26.在创建好TrBRFVLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:witch(enable)etvlanvlan-nummod-num/port-num27.命令howpantree显示一个交换机端口的STP状态.28.配置一个ELAN的LES和BUS,可以使用下列命令:ATM(config)#interfaceatmnumber.ubintmultiointATM(config-ubif)#laneerber-buethernetelan-name29.配置LECS:ATM(config)#lanedatabaedatabae-nameATM(lane-config-databade)#nameelan1-nameerver-atm-addrele1-nap-addreATM(lane-config-databade)#nameelan2-nameerver-atm-addrele2-nap-addreATM(lane-config-databade)#name...30.创建完数据库后,必须在主接口上启动LECS.命令如下:ATM(config)#interfaceatmnumberATM(config-if)#laneconfigdatabaedatabae-nameATM(config-if)#laneconfigauto-config-atm-addre31.将每个LEC配置到一个不同的ATM子接口上.命令如下:ATM(config)#interfaceatmnumber.ubintmultipointATM(config)#laneclientethernetvlan-numelan-num32.用howlaneerver显示LES的状态.33.用howlanebu显示bu的状态.34.用howlanedatabae显示LECS数据库可内容.35.用howlaneclient显示LEC的状态.36.用howmodule显示已安装的模块列表.37.用物理接口建立与VLAN的连接:router#configureterminalrouter(config)#interfacemediamodule/portrouter(config-if)#decriptiondecription-tringrouter(config-if)#ipaddreip-addrubnet-makrouter(config-if)#nohutdown38.用中继链路来建立与VLAN的连接:router(config)#interfacemodule/port.ubinterface router(config-ig)#encapulation[il|dotlq]vlan-number router(config-if)#ipaddreip-addreubnet-mak39.用LANE来建立与VLAN的连接:router(config)#interfaceatmmodule/portrouter(config-if)#noipaddrerouter(config-if)#atmpvc105qaalrouter(config-if)#atmpvc2016ilnirouter(config-if)#interfaceatmmodule/port.ubinterfacemultipointrouter(config-if)#ipaddreip-addreubnet-makrouter(config-if)#laneclientethernetelan-numrouter(config-if)#interfaceatmmodule/port.ubinterfacemultipointrouter(config-if)#ipaddreip-addreubnet-namerouter(config-if)#laneclientethernetelan-namerouter(config-if)#...40.为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行:router(config)#iproutingrouter(config)#routerip-routing-protocolrouter(config-router)#networkip-network-numberrouter(config-router)#networkip-network-number41.配置默认路由:witch(enable)etiproutedefaultgateway42.为一个路由处理器分配VLANID,可在接口模式下使用下列命令:router(config)#interfaceinterfacenumberrouter(config-if)#mlrpvlan-idvlan-id-num43.在路由处理器启用MLSP:router(config)#mlrpip44.为了把一个外置的路由处理器接口和交换机安置在同一个VTP域中:router(config)#interfaceinterfacenumberrouter(config-if)#mlrpvtp-domaindomain-name45.查看指定的VTP域的信息:router#howmlrpvtp-domainvtpdomainname46.要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mlrpmanagement-interface47.要检验MLS-RP的配置情况:router#howmlrp48.检验特定接口上的MLS配置:router#howmlrpinterfaceinterfacenumber49.为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:etmlflow[detination|detination-ource|full]50.为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)#mlrpipinput-acl51.当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令:witch(enable)etmlenable52.若想改变老化时间的值,可在特权模式下输入以下命令:54.确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:witch(enable)howmlinclude55.显示MLS高速缓存记录:witch(enable)howmlentry56.用命令howinarp显示ARP高速缓存区的内容。

cisco路由器常用命令

cisco路由器常用命令

cisco路由器常用命令1、Switch> 用户模式2、Switch>enable 进入特权模式Switch#3、Switch#config terminal 进入全局模式Switch(config)#4、Switch(config)#interface f0/1 进入接口模式Switch(config-if)#5、Switch(config)#line console 0 进入line模式Switch(config-line)#exit 退回上层end 结束所有操作6、Switch(config)#hostname aaa 配置主机名7、switch#show running-config 查看配置情况8、Switch(config)#enable password 111 设置使能密码(明文)9、Switch(config)#enable secret 111 设置使能密码(密文)Switch(config)#line console 0 设置console密码Switch(config-line)#password 333Switch(config-line)#login10、Switch(config)#interface vlan1Switch(config-if)#ip address 192.168.1.1 255.255.255.0 设置IP地址Switch(config-if)#no shutdown11、Switch(config)#ip default-gateway 192.168.1.10 设置网关12、Switch#show mac-address-table 查看MAC地址表13、Switch#show cdp cdp全局配置信息14、Switch#show cdp interface f0/1 cdp接口配置信息15、Switch#show cdp traffic cdp包的配置信息16、Switch#show cdp neighbors cdp邻居基本信息17、Switch#show cdp neighbors detail cdp邻居详细信息Switch#show cdp neighbors entry18、Switch#copy running-config startup-config19、Switch#erase startup-config 恢复出厂信息Switch#reload 重新加载20、交换机密码恢复*断开电源*按住MODE键,加电(等待数秒)*switch:出现此符号*switch:flash_init 初始化flash*switch:dir flash: (查看文件,可省去)*switch:rename config.text config.old 改名*switch:boot 重启*switch>enable 进入特权*switch#dir flash: (查看文件,可省去)*switch#rename config.old config.text改名*switch#copy flash:config.text running-config 复制到系统内*switch#confit terminal 进入全局模式*switch(config)#enable password 222 设置新密码21、switch#show vlan-sw brief 查看vlan22、switch#vlan database 进入vlan模式switch(vlan)#vlan 20 name bbb 创建vlan并命名23、switch(vlan)#no vlan 20 删除vlan24、添加端口到vlan(单个)switch(config)#interface f0/1 进入接口模式switch(config-if)#switchport access vlan 10 添加至vlan10switch(config-if)#end 退出switch#show vlan brief (id) 验证vlanswitch(config)#show running-config interface f0/1(查看某接口)25、添加端口到vlan(批量)switch(config)#interface range f0/1 - 5switch(config-if-range)#switchport access vlan 1026、switch(config)#interface f0/1 进入接口switch(config-if)#switchport mode trunk 设置为trunk(永久)switch(config-if)#switchport mode dynamic desirable/auto(其它trunk)switch(config-if)#switchport trunk allowed vlan remove 10 移除vlan10)switch(config-if)#switchport trunk allowed vlan add 20 添加vlan2027、switch#show interface f0/1 switchport 查看接口模式show ip interface briefSwitch#write 保存交换机配置信息。

Cisco(思科)语法命令大全

Cisco(思科)语法命令大全

Cisco(恩科)命令大全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配置VLAN(虚拟局域网)configure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。

cisco路由器命令

cisco路由器命令

cisco路由器命令总体说明:此文档提供了关于常用的Cisco路由器命令的详细说明。

每个章节介绍了不同的命令类别并提供了相关命令的具体用法和示例。

本文档旨在帮助用户熟悉和理解Cisco路由器命令,以便在配置和管理网络设备时能够高效地使用它们。

1:基础命令1.1 登录和退出路由器1.1.1 登录路由器命令:telnet [IP地址]用法示例:telnet 192.168.1.1说明:此命令用于通过Telnet协议登录到路由器。

1.1.2 退出路由器命令:exit用法示例:exit说明:此命令用于从路由器会话中退出。

1.2 查看和配置接口1.2.1 查看接口信息命令:show interfaces用法示例:show interfaces gigabitethernet 0/1说明:此命令用于查看指定接口的详细信息,包括状态、带宽、错误统计等。

1.2.2 配置接口命令:interface [接口名称]用法示例:interface gigabitethernet 0/1说明:此命令用于进入指定接口的配置模式,以便进行相关配置。

1.3 路由配置1.3.1 配置静态路由命令:ip route [目标网络] [子网掩码] [下一跳地址]用法示例:ip route 10:0:0:0 255.255.255:0192.168.1.2说明:此命令用于配置静态路由,将目标网络流量发送到指定的下一跳地址。

1.3.2 查看路由表命令:show ip route用法示例:show ip route说明:此命令用于查看当前路由表的内容。

2:高级命令2.1 ACL(访问控制列表)2.1.1 创建ACL命令:access-list [ACL号] [规则类型] [源地址] [目标地址]用法示例:access-list 1 permit 192.168.1:0/24 any说明:此命令用于创建一个访问控制列表,并定义其规则。

2.1.2 应用ACL命令:interface [接口名称]ip access-group [ACL号] [进/出]用法示例:interface gigabitethernet 0/1ip access-group 1 in说明:此命令用于将ACL应用到指定接口的进或出方向。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

思科路由器命令大全(完整版)
思科路由器命令大全(完整版)
本文档旨在提供思科路由器命令的详细说明和使用指南,包括路由器配置、网络管理、安全性设置等内容。

每个章节都详细介绍了不同的命令和参数,以帮助用户更好地理解和使用思科路由器。

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:路由信息协议,一种距离向量路由协议。

13: OSPF:开放最短路径优先协议,一种链路状态路由协议。

14: BGP:边界网关协议,用于在互联网中交换路由信息的协议。

15: SNMP:简单网络管理协议,用于网络设备监控和管理的标
准协议。

16: NetFlow:一种网络流量分析和性能监测技术。

17: Syslog:用于收集和存储系统日志的标准协议。

18:访问控制列表 (ACL):用于实现网络访问控制的策略列表。

19: VPN:虚拟专用网络,用加密技术在公共网络上建立安全
连接。

20:防火墙:用于保护网络安全的设备或软件。

21: AAA:认证、授权和账户,用于鉴定和管理网络用户的一
种技术。

相关文档
最新文档