收藏 分销(赏)

常用网络设备配置命令及配置实例.docx

上传人:a199****6536 文档编号:6973755 上传时间:2024-12-24 格式:DOCX 页数:7 大小:117.92KB 下载积分:6 金币
下载 相关 举报
常用网络设备配置命令及配置实例.docx_第1页
第1页 / 共7页
常用网络设备配置命令及配置实例.docx_第2页
第2页 / 共7页


点击查看更多>>
资源描述
常用网络设备配置命令及配置实例 计算机命令: PCAlogin:root;使用root用户 password:linux;口令是linux #shutdown-hnow;关机 #init0;关机 #logout #login #ifconfig;显示IP地址 #ifconfigeth0<ipaddress>netmask<netmask>;设置IP地址 #ifconfigeht0<ipaddress>netmask<netmask>down;删除IP地址 #routeadd0.0.0.0gw<ip> #routedel0.0.0.0gw<ip> #routeadddefaultgw<ip>;设置网关 #routedeldefaultgw<ip>;删除网关 #route;显示网关 #ping<ip> #telnet<ip>;建立telnet之前先ping一下 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^路由器^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 显示命令: router#showrun;显示接口 router#showinterface;显示接口 router#showiproute;显示路由 router#showcdpnei;瞧邻居 router#reload  ;重新起动 设置口令: router>enable;进进特权模式 router#configterminal;进进全局配置模式 router(config)#hostname<hostname>;设置交换机的主机名 router(config)#enablesecretxxx;设置特权加密口令为xxx router(config)#enablepasswordxxx;设置特权非密口令为xxx router(config)#lineconsole0;进操纵台口(Rs232)初始化 router(config-line)#linevty04;进进虚拟终端virtualtty router(config-line)#login;准许登录 router(config-line)#passwordxx;设置登录口令xx router(config)#(Ctrl+z);返回特权模式 router#exit;返回命令 配置IP地址: router(config)#ints0/0;进行串Serail接口 router(config-if)#noshutdown;起动接口 router(config-if)#clockrate64000;设置时钟 router(config-if)#ipaddress10.1.1.1255.255.0.0;设置IP地址和子网掩码 router(config-if)#ipadd10.1.1.2255.255.0.0second; router(config-if)#intf0/0.1;进进子接口 router(config-subif.1)#ipaddress<ip><netmask>; router(config-subif.1)#encapsulationdot1q<n>; router(config)#config-register0x2142;跃过配置文件 router(config)#config-register0x2102;正常使用配置文件 router#reload;重新引导 复制操作: router#copyrunning-configstartup-config;存配置 router#copyrunning-configtftp;上载 router#copystartup-configtftp router#copytftpflash:;特权模式下升级IOS router#copytftpstartup-config        ;下载配置文件到nvram ROM状态: Ctrl+Break;进进ROM监控状态 rommon>confreg0x2142;跃过配置,263645xx rommon>confreg0x2102;使用配置,恢复工作状态 rommon>reset     ;重新引导,等效于重开机 rommon>copyxmodem:<sname>flash:<dname>;从console升级IOS 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;ROM监控状态下升级IOS rommon>dirflash:;查瞧闪存中的内容 rommon>boot;引导IOS 静态路由: iproute<ip-address><subnet-mask><gateway>例: router(config)#iproute0.0.0.00.0.0.01.1.1.2 动态路由: router(config)#iprouting;启动路由 router(config)#routerrip;启动RIP路由协议。 router(config-router)#network<netid>;配置范围,有的支持all。 router(config-router)#negihbor<ip-address>;点对点 帧中继用。 帧中继命令: router(config)#frame-relayswitching;使能帧中继交换 router(config-s0)#encapsulationframe-relay;使能帧中继 router(config-s0)#frame-relayintf-typeDCE;DCE端(需要配虚电路) router(config-s0)#frame-relaylocal-dlci20;配置虚电路号 全然访咨询操纵列表: router(config)#access-list<number>permit|deny<sourceip><wild|any> router(config)#interface<interface> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^交换机^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 显示命令: switch#write;写进保持 switch#showvtp switch#showrun;查瞧当前配置信息 switch#showvlan;瞧VLAN switch#showinterface;显示所有端口信息 switch#showintf0/0;显示端口0的信息 交换机全然状态: switch:;ROM状态,路由器是 rommon> hostname>;用户模式 hostname#;特权模式 hostname(config)#;全局配置模式 hostname(config-if)#;接口状态 交换机口令设置: switch>enable;进进特权模式 switch#configterminal;进进全局配置模式 switch(config)#hostname<hostname>;设置交换机的主机名 switch(config)#enablesecretxxx;设置特权加密口令为xxx switch(config)#enablepasswordxxx;设置特权非密口令为xxx switch(config)#lineconsole0;进操纵台口(Rs232)初始化 switch(config-line)#linevty04;进进虚拟终端virtualtty switch(config-line)#login;准许登录 switch(config-line)#passwordxx;设置登录口令xx switch#exit;返回命令 交换机VLAN设置: switch#vlandatabase;进进VLAN设置 switch(vlan)#vlan2;建VLAN2 switch(vlan)#novlan2;删vlan2 switch(config)#intf0/1;进进端口1 switch(config-if)#switchportaccessvlan2;当前端口1参加VLAN2 switch(config-if)#switchportmodetrunk;设置为干线 switch(config-if)#switchporttrunkallowedvlan1,2;设置准许的vlan switch(config-if)#switchporttrunkencapdot1q;设置vlan中继 switch(config)#vtpdomain<name>;设置发vtp域名 switch(config)#vtppassword<word> switch(config)#vtpmodeserver switch(config)#vtpmodeclient 交换机设置IP地址: switch(config)#interfacevlan1;进进vlan1 switch(config-if)#ipaddress<IP><mask>;添加远程登录IP switch(config)#ipdefault-gateway<IP>;添加默认网关 switch#dirflash:;查瞧内存 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^实例^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 瞧瞧路由器启动流程,确认路由器IOS版本号和硬件信息 瞧瞧在UserEXEC模式下能够执行的命令 在PrivilegedEXEC模式下执行以下命令,瞧瞧并解释执行结果 1.showversion 2.showprocessescpu 3.showprotocols 4.showinterfaces 5.showflash 6.showstartup-config 7.showrunning-config 8.showiproute 9.showmem 命令行编辑 1.<Ctrl><A>移动到命令行开头 2.<Ctrl><E>移动到命令行结束 3.<ESC><B>移动到上一个词开始 4.<Ctrl><F>移动到前一个字符 5.<Ctrl><B>移动到下一个字符 6.<ESC><F>移动到下一个词 配置路由器识不信息 1.hostname 2.bannermotd 3.description 密码设定 主控台密码 linecon0 passwordabc 虚拟终端密码 linevty04 passwordabc 特权模式密码 enablesecretabc 确认一个界面状态 1.interfaceethernet0 2.showinterfaceethernet0 3.shutdown 4.noshutdown 保持配置 1.writememory 2.copyrunning-configstartup-config 3.copyrunning-configtftp 从tftp效劳器载进配置 1.copytftprunning-config 2.copytftpstartup-config 密码恢复 1.在路由器启动过程中Break 2.更改正程 〈Cisco2600系列〉 a)rommon>confreg b)Doyouwishtochangetheconfiguration?y/n[n]:y c)Enable“ignoresystemconfiginfo〞?[y/n]n:y d)Changethebootcharacteristics?[y/n][n]:y e)Entertoboot:2 f)Doyouwishtochangetheconfiguration?y/n[n]:n g)rommon>reset h)Wouldyouliketoentertheinitialdialog?[yes]:no i)enable j)configurememory k)改密码 l)config-register0x2102 CDP协议 1.cdprun 2.cdptimer 3.cdpholdtime 4.showcdpneighbors 简单一点的实例 Route>你进来是那个模样 Route>en打个en回车进进特权模式 Route#特权模式确实是根基那个模样 Router#conft打个conft回车进进全局配置模式 Enterconfigurationcommands,oneperline.EndwithCNTL/Z.那个是自动显示出来的,不打 Router(config)#全局配置模式确实是根基那个模样 Router(config)#hostnameR1第一项配置:把2600路由器改个名如R1 R1(config)#现在名字喊r1了 R1(config)#exit打那个就退出全局配置模式了 %SYS-5-CONFIG_I:Configuredfromconsolebyconsole R1#showrun打那个就瞧配置了 Buildingconfiguration... Currentconfiguration:510bytes ! noservicepassword-encryption ! hostnameR1 !! ipsshversion1 !! interfaceFastEthernet0/0 noipaddress duplexauto speedauto shutdown 下面一大堆就不显示了, 第二项配置:端口配ip R1#conft应该熟悉了,进进到全局配置模式 Enterconfigurationcommands,oneperline.EndwithCNTL/Z. R1(config)#interfaceFastEthernet0/0进进端口f0/0预备进行IP配置,那个端口你能够在2600面板上寻到标有fastethernet0/0的端口,现在确实是根基要给它分配个IP地址。 R1(config-if)#ipadd192.168.1.1255.255.255.0那个确实是根基给它配ip了。〔add是address的简称〕。 R1(config-if)#nosh那个是up端口 %LINK-5-CHANGED:InterfaceFastEthernet0/0,changedstatetoup 那个时候你拿台电脑,连上配好的口 路由器上的灯该闪了,路由器界面上会显示类似 %LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/0,changedstatetoup 的信息。 配到这,你在电脑上ping192.168.1.1是通的。 路由器各端口编号讲明 以如下面图是Cisco2610路由器端口编号的示意图,具体讲明请参考路由器讲明书。 端 用于超级终 接计算机 S0/2 Serial0/2 S1/1 Serial1/1 S1/0 Serial1/0 F0/1 FastEthernet0/1 F0/0 FastEthernet0/0 S0/0 Serial0/0 S0/3 Serial0/3 S0/1 Serial0/1 二、例子 〔参照“中国网通新建工程网管和路由器IP分配表〞〕 例如:南宁路由器的设置如下 Router#configuret Router〔config〕#interfacef0/0------------------------------------配端口IP地址 Router〔config-if〕#shut Router〔config-if〕#noshut Router〔config-if〕#exit Router〔config〕#interfaces0/0 Router〔config-if〕#shut Router〔config-if〕#noshut Router〔config-if〕#exit Router〔config〕#interfaces0/1 Router〔config-if〕#shut Router〔config-if〕#noshut Router〔config-if〕#exit Router〔config〕#routerospf100------------------------------------配路由协议 Router〔config-router〕#router-id132.37.77.1--------IP地址是以太网口的IP Router〔config-router〕#nocapabilityopaque Router〔config-router〕#exit Router〔config〕#exit Router#wri-------------------------------------保持配置 结束设置。
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服