思科模拟器配置命令.pdf
- 格式:pdf
- 大小:287.17 KB
- 文档页数:10
思科交换机基本配置实例讲解目录1、基本概念介绍...............................................2、密码、登陆等基本配置.......................................3、CISCO设备端口配置详解......................................4、VLAN的规划及配置...........................................4.1核心交换机的相关配置.....................................4.2接入交换机的相关配置.....................................5、配置交换机的路由功能.......................................6、配置交换机的DHCP功能......................................7、常用排错命令...............................................1、基本概念介绍IOS: 互联网操作系统,也就是交换机和路由器中用的操作系统VLAN: 虚拟lanVTP: VLAN TRUNK PROTOCOLDHCP: 动态主机配置协议ACL:访问控制列表三层交换机:具有三层路由转发能力的交换机本教程中“#”后的蓝色文字为注释内容。
2、密码、登陆等基本配置本节介绍的内容为cisco路由器或者交换机的基本配置,在目前版本的cisco交换机或路由器上的这些命令是通用的。
本教程用的是cisco的模拟器做的介绍,一些具体的端口显示或许与你们实际的设备不符,但这并不影响基本配置命令的执行。
Cisco 3640 (R4700) processor (revision 0xFF) with 124928K/6144K bytes of memory.Processor board ID 00000000R4700 CPU at 100MHz, Implementation 33, Rev 1.22 Ethernet interfaces8 Serial interfacesDRAM configuration is 64 bits wide with parity enabled.125K bytes of NVRAM.8192K bytes of processor board System flash (Read/Write)--- System Configuration Dialog ---Would you like to enter the initial configuration dialog? [yes/no]: n# 此处我们选择no,不进入他的初始化配置向导Press RETURN to get started!# 选择no以后,提示你按回车键开始,此处我们需要按回车键*Mar 1 00:43:56.591: %IP-5-WEBINST_KILL: Terminating DNS process *Mar 1 00:43:58.379: %SYS-5-RESTART: System restarted --Cisco IOS Software, 3600 Software (C3640-JK9O3S-M), Version12.3(14)T7, RELEASE SOFTWARE (fc2)Copyright (c) 1986-2006 by Cisco Systems, Inc.Compiled Wed 22-Mar-06 21:46 by pwade*Mar 1 00:43:58.411: %SNMP-5-COLDSTART: SNMP agent on host Router is undergoing a cold startRouter># 等显示稳定后,出现最初的提示符,注意提示符是“>”,目前所处的状态称为用户模式。
思科路由器常用配置命令一览表:1-99恢复一个会话bfe手工应急模式设置clear复位功能clock管理系统时钟configure进入设置模式connect打开一个终端copy从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上debug调试功能diable退出优先命令状态diconnect断开一个网络连接enable进入优先命令状态erae擦除快闪内存e某it退出e某ce模式help交互帮助系统的描述lat打开一个本地传输连接lock锁定终端login以一个用户名登录logout退出终端mbranch向树形下端分支跟踪多路由广播mrbranch向树形上端分支跟踪反向多路由广播name-connection给一个存在的网络连接命名no关闭调试功能pad打开某.29PAD连接ping发送回显信息ppp开始点到点的连接协议reload停机并执行冷启动reume恢复一个活动的网络连接rlogin打开远程注册连接rh执行一个远端命令end发送信息到另外的终端行etup运行etup命令how显示正在运行系统信息lip开始SLIP协议tart-chat在命令行上执行对话描述ytat显示终端行的信息telnet远程登录terminal终端行参数tet测试子系统内存和端口tn3270打开一个tin3270连接trace跟踪路由到目的地undebug退出调试功能verify验证检查闪烁文件的总数where显示活动的连接which-route执行OSI路由表查找并显示结果write把正在运行的设置写入内存、网络、或终端某3在PAD上设置某.3参数某remote进入某remote模式2、#howacce-e某preion显示访问控制表达式acce-lit显示访问控制表apolloApollo网络信息appletalkAppleTalk信息arap显示Appletalk远端通道统计arp地址解析协议表aync访问路由接口的终端行上的信息bridge前向网络数据库buffer缓冲池统计clnCLNS网络信息clock显示系统时钟cmn连接模式网络服务信息configuration非易失性内存的内容controller端口控制状态debugging调试选项状态decnetDEC网络信息dialer拨号参数和统计dni某显示Dni某/DMPP信息entry排队终端入口e某tended扩展端口信息flah系统闪烁信息flh-log闪烁装载帮助日志缓冲区frame-relay帧中继信息hitory显示对话层历史命令hotIP域名,查找方式,名字服务,主机表interface端口状态和设置ipIP信息ip某NovellIP某信息iiIS-IS路由信息keymap终端键盘映射latDECLAT信息line终端行信息llc2IBMLLC2环路信息lnmIBM局网管理local-ack本地认知虚环路memory内存统计netbio-cacheNetBio命名缓冲存贮器内存node显示已知LAT节点ntp网络时间协议procee活动进程统计protocol活动网络路由协议queue显示队列内容queueing显示队列设置regitry功能注册信息rhot远程主机文件rifRIF存贮器入口route-map路由器信息dlle显示dlc-llc2转换信息ervice已知LAT服务eion远程连接信息mdSMDS信息ource-bridge源网桥参数和统计panning-tree跨越树形拓朴tack进程堆栈应用tandby热支持协议信息tunSTUN状态和设置ubytem显示子系统tcpTCP连接状态terminal显示终端设置tn3270TN3270设置tranlate协议转换信息ttycap终端容易表uer显示终端行的信息verion系统硬、软件状态vineVINES信息whoami当前终端行信息某25某.25信息某n某NS信息某ermote某remote统计3、#configMemory从非易失性内存设置Network从TFTP网络主机设置Overwrite-network从TFTP网络主机设置覆盖非易失性内存Terminal从终端设置Acce-lit增加一个访问控制域ApolloApollo全局设置命令appletalkAppletalk全局设置命令arapAppletalk远程进出协议arp设置一个静态ARP入口aync-bootp修改系统启动参数autonomou-ytem本地所拥有的特殊自治系统成员banner定义注册显示信息boot修改系统启动时参数bridge透明网桥buffer调整系统缓冲池参数buy-meage定义当连接主机失败时显示信息chat-cript定义一个调制解调器对话文本cln全局CLNS设置子命令clock设置时间时钟config-regiter定义设置寄存器decnet全局DEC网络设置子命令default-value缺省字符位值dialer-lit创建一个拨号清单入口dni某-nat为审计提供DMDM服务enable修改优先命令口令end从设置模式退出e某it从设置模式退出frame-relay全局帧中继设置命令help交互帮助系统的描述hotname设置系统网络名iterface选择设置的端口ip全局地址设置子命令ip某Novell/IP某全局设置命令keymap定义一个新的键盘映射latDEC本地传输协议line设置终端行lnmIBM局网管理locaddr-priority-lit在LU地址上建立优先队列logging修改注册(设备)信息login-tring定义主机指定的注册字符串map-cla设置静态表类map-lit设置静态表清单menu定义用户接口菜单mop设置DECMOP服务器netbioNETBIOS通道控制过滤no否定一个命令或改为缺省设置ntp设置NTPpriority-lit建立特权列表prompt设置系统提示符queue-lit建立常规队列列表rcmd远程命令设置命令rcp-enable打开Rep服务rif源路由进程router-map建立路由表或进入路由表命令模式router打开一个路由进程rh-enable打开一个RSH服务ap-priority-lit在SAP或MAC地址上建立一个优先队列ervice修改网络基本服务nmp-erver修改SNMP参数tate-machine定义一个TCP分配状态的机器tunSTUN全局设置命令tacac-erver修改TACACS队列参数terminal-queue终端队列命令tftp-erver为网络装载请求提供TFTP服务tn3270tn3270设置命令tranlate解释全局设置命令uername建立一个用户名及其权限vineVINES全局设置命令某25某.25的第三级某29某.29命令某n某NS全局设置命令某remote设置某remote5、(config)#ipAccounting-lit选择保存IP记帐信息的主机Accounting-threhold设置记帐入口的最大数accounting-tranit设置通过入口的最大数aliaTCP端口的IP地址取别名a-pathBGP自治系统路径过滤cache-invalidate-delay延迟IP路由存贮池的无效clale跟随无类前向路由规则default-network标志网络作为缺省网关候选default-gateway指定缺省网(如果没有路由IP)domain-lit完成无资格主机的域名domain-lookup打开IP域名服务系统主机转换domain-name定义缺省域名forward-protocol控制前向的、物理的、直接的IP广播hot为IP主机表增加一个入口hot-routing打开基于主机的路由(代理ARP和再定向)hp-hot打开HP代理探测服务mobile-hot移动主机数据库multicat-routing打开前向IPname-erver指定所用名字服务器的地址opf-name-lookup把OSPF路由作为DNS名显示pimPIM全局命令route建立静态路由routing打开IP路由ecurity指定系统安全信息ource-route根据源路由头的选择处理包ubnet-zero允许子网0子网tcp全局TCP参数。
interface 接口进入接口配置模式encapsulation frame-relay封装帧中继协议
frame-relay map ip IP地址 DLCI broadcast cisco/ietf 将目的IP地址和本地DLCI匹配
frame-relay lmi-type ansi/cisco/q933a
interface 接口.子接口
frame-relay interface-dlci NUMBER指定本地DLCI值
access-list 1-99permit/deny
address/any/host标准访问控制列表允许单个主机或某一个网段
access-list100-199permit协议
Address/any/host (eq 协议/端口号)
Address/any/host扩展访问控制列表注:1.当协议选择tcp时可选择端口号,针对某一个单独的功能创建访问控制列表;2.访问控制列表没有明确的允许就是禁止。
没有访问控制列表隐含denya any any语句
ip access-list standard/extended 编号 /
名称创建命名访问控制列表3.访问控制列表。
思科模拟器交换机配置
工具/原料
一台电脑
一个思科模拟器软件
方法/步骤
首先呢,下载并打开思科模拟器软件,在思科模拟器上找到Cisco 2960交换机一台,PC 2台,直通线若干条,进行连接配置。
规划设计,设计并配置计算机的IP地址,子网掩码,连接到交换机的端口,使用类
型都是直通线,设计并配置PC0的IP地址,子网掩码,网关分别为
192.168.10.11,255.255.255.0,192.168.10.1,pc1的IP地址,子网掩码,默认网关为192.168.10.12,255.255.255.0,192.168.10.1.
然后配置交换机的名称,方便自己的记忆,我们可以用”hostname *"进行对交换机
的名字配置,前提是要在交换机的全局配置模式下配置。
配置交换机的端口,在交换机的全局模式下输入“int 端口号”,然后启用配置模式
为“access”,配置命令为“switch mode access”
查看交换机端口状态信息,使用“show interface"可以查看交换机端口信息,双工
模式和速率,最重要的一点可以利用查看端口来对交换机进行维护。
除了会配置交换机的端口,也要学会对端口启用安全状态,首先利用”show mac-address-table",然后指定PC哪个端口启用安全。
感谢您的阅读,祝您生活愉快。
思科交换机命令大全1.设置主机名/系统名IOS:switch(config)# hostname "hostname"CLI:switch(enable) set system name name-string2.设置登录口令IOS:switch(config)# enable password level 1 passwordCLI:switch(enable) set passwordswitch(enable) set enalbepass3.设置远程访问IOS:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-addressCLI:switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.启用和浏览CDP信息IOS:switch(config-if)# cdp enableswitch(config-if)# no cdp enableCLI:switch(enable) set cdp {enable|disable} module/port5.查看Cisco邻接设备的CDP通告IOS:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]CLI:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 6.端口描述 IOS:switch(config-if)#description escription-stringCLI:switch(enable)set port name module/number description-string7.设置端口速度IOS:switch(config-if)# speed{10|100|auto}CLI:switch(enable) set port speed moudle/number {10|100|auto}switch(enable) set port speed moudle/number {4|16|auto}8.设置以太网的链路模式IOS:switch(config-if)# duplex {auto|full|half}CLI:switch(enable) set port duplex module/number {full|half}9.配置静态VLANIOS:switch# vlan databaseswitch(vlan)# vlan vlan-num name vlaswitch(vlan)# exitswitch# configure teriminalswitch(config)#interface interface module/numberswitch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-numswitch(config-if)# endCLI:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list10.配置VLAN中继线IOS:switch(config)# interface interface mod/portswitch(config-if)# switchport mode trunkswitch(config-if)#switchport trunk encapsulation {isl|dotlq}switch(config-if)# switchport trunk allowed vlan remove vlan-listswitch(config-if)# switchport trunk allowed vlan add vlan-list CLI:switch(enable)set trunk module/port [on|off|desirable|auto|nonegotiate] Vlan-range [isl|dotlq|dotl0|lane|negotiate]11.配置VTP管理域IOS:switch# vlan databaseswitch(vlan)# vtp domain domain-nameCLI:switch(enable) set vtp [domain domain-name]12.配置VTP 模式IOS:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password passwordCLI:switch(enable) set vtp [domain domain-name][mode{ sever|cilent|transparent }][password password]13.配置VTP版本IOS:switch# vlan databaseswitch(vlan)# vtp v2-modeCLI:switch(enable) set vtp v2 enable14.启动VTP剪裁IOS:switch# vlan databaseswitch(vlan)# vtp pruningCLI:switch(enable) set vtp pruning enable15.配置以太信道IOS:switch(config-if)# port group group-number [distribution {source|destination}] CLI:switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto} 16.调整根路径成本IOS:switch(config-if)#spanning-tree [vlan vlan-list] cost costCLI:switch(enable)set spantree portcost moudle/port costswitch(enable)set spantree portvlancost moudle/port [cost cost][vlan-list] 17.调整端口IDIOS:switch(config-if)#spanning-tree[vlan vlan-list]port-priority port-priority CLI:switch(enable)set spantree portpri {mldule/port}priorityswitch(enable)set spantree portvlanpri {module/port}priority [vlans]18.修改STP时钟IOS:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)#spanning-tree [vlan vlan-list] forward-time secondsswitch(config)#spanning-tree [vlan vlan-list] max-age seconds CLI:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]19.启用或禁用Port Fast 特征IOS:switch(config-if)#spanning-tree portfastCLI:switch(enable)set spantree portfast {module/port}{enable|disable}20.启用或禁用UplinkFast 特征IOS:switch(config)#spanning-tree uplinkfast [max-update-rate pkts-per-second]CLI:switch(enable)set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocolsoff|on] 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name21. 为了从一条中继链路上删除VLAN,可使用下列命令:switch(enable) clear trunk module/port vlan-range22. 用show vtp domain 显示管理域的VTP参数.23. 用show vtp statistics显示管理域的VTP参数.24. 在Catalyst交换机上定义TrBRF的命令如下:switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}] 25. 在Catalyst交换机上定义TrCRF的命令如下:switch (enable) set vlan vlan-num [name name] type trcrf {ring hex-ring-num|decring decimal-ring-num} parent vlan-num26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:switch(enable) set vlan vlan-num mod-num/port-num27. 命令show spantree显示一个交换机端口的STP状态.28. 配置一个ELAN的LES和BUS,可以使用下列命令:ATM (config)# interface atm number.subint multiointATM(config-subif)# lane serber-bus ethernet elan-name29. 配置LECS:ATM(config)# lane database database-nameATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-addressATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-addressATM(lane-config-databade)# name ...30. 创建完数据库后,必须在主接口上启动LECS.命令如下: ATM(config)# interface atm numberATM(config-if)# lane config database database-nameATM(config-if)# lane config auto-config-atm-address31. 将每个LEC配置到一个不同的ATM子接口上.命令如下:ATM(config)# interface atm number.subint multipointATM(config)# lane client ethernet vlan-num elan-num32. 用show lane server 显示LES的状态.33. 用show lane bus显示bus的状态.34. 用show lane database显示LECS数据库可内容.35. 用show lane client显示LEC的状态.36. 用show module显示已安装的模块列表.37. 用物理接口建立与VLAN的连接:router# configure terminalrouter(config)# interface media module/portrouter(config-if)# description description-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown38. 用中继链路来建立与VLAN的连接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulation[isl|dotlq] vlan-numberrouter(config-if)# ip address ip-address subnet-mask39. 用LANE 来建立与VLAN的连接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-maskrouter(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-namerouter(config-if)# lane client ethernet elan-namerouter(config-if)# ...40. 为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行:router(config)# ip routingrouter(config)# router ip-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number41. 配置默认路由: switch(enable) set ip route default gateway42. 为一个路由处理器分配VLANID,可在接口模式下使用下列命令:router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num43. 在路由处理器启用MLSP: router(config)# mls rp ip44. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name45. 查看指定的VTP域的信息: router# show mls rp vtp-domain vtp domain name46. 要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mls rp management-interface47. 要检验MLS-RP的配置情况: router# show mls rp48. 检验特定接口上的MLS配置:router# show mls rp interface interface number49. 为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:set mls flow [destination|destination-source|full]50. 为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-acl51. 当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令:switch(enable) set mls enable52. 若想改变老化时间的值,可在特权模式下输入以下命令:switch(enable) set mls agingtime agingtime53. 设置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold54. 确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include55. 显示MLS高速缓存记录: switch(enable) show mls entry56. 用命令show in arp显示ARP高速缓存区的内容。
思科路由器命令大全思科路由器命令大全1.基本设置命令1.1 主机名配置●hostname [主机名]:设置路由器的主机名。
1.2 用户名和密码配置●enable password [密码]:设置特权模式的密码。
●enable secret [密码]:设置加密的特权模式密码。
●username [用户名] password [密码]:创建一个本地用户并设置密码。
●line console 0:进入控制台命令行配置模式。
●password [密码]:设置控制台访问密码。
●line vty [行号] [结束行号]:进入虚拟终端配置模式。
●password [密码]:设置虚拟终端访问密码。
1.3 IP 地质配置●interface [接口类型] [接口编号]:进入接口配置模式。
●ip address [IP 地质] [子网掩码]:设置接口的IP 地质和子网掩码。
●no shutdown:启用接口。
1.4 默认网关配置●ip default-gateway [默认网关地质]:设置默认网关。
2.路由配置命令2.1 静态路由配置●ip route [目标网络] [目标子网掩码] [下一跳地质]:配置静态路由。
2.2 动态路由配置●router rip:进入 RIP 路由配置模式。
●network [网络地质]:启动 RIP 并指定要进行路由的网络地质。
●router ospf [进程号]:进入 OSPF 路由配置模式。
●network [IP 地质] [反掩码] area [区域号]:配置 OSPF。
3.状态和监控命令3.1 接口状态命令●show ip interface brief:显示路由器接口的 IP 地质和状态。
●show interfaces [接口类型] [接口编号]:显示指定接口的详细信息。
●show interfaces status:显示接口的状态和统计信息。
3.2 路由表命令●show ip route:显示路由表信息。
实验一认识路由器及交换机的配置方式及常用配置命令及使用帮助键一、实验目的:熟悉路由器、交换机与计算机的各种连线方式,熟悉掌握路由器、交换机的基本配置及帮助命令的使用二、实验设备:路由器、交换机、pc各一台三、实验拓扑:四、实验步骤1、按图示连线,然后在pc点上开始程序附件通讯超级终端在名称栏输入任意字符(该字符标识一个终端会话)点击确定在连接时使用选中com1(该串口是你连接路由器控制台端口的DB60接口)在端口设置中,点“还原为默认值”然后确定。
2、开启路由器电源,可以看到在超级终端屏幕中显示路由器启动信息(如果没有输出显示,请按enter键,如果还没有检查连线及接口)3、一台新路由器启动后会弹出would you like to enter the initial configuration dialog ?[yes / no]在此选择no进入命令行模式,如选择yes进入交互对话配置,可按ctrl+c键退出,进入命令行模式。
4、输出停止后按回车键进入Router > *用户模式,只能执行简单的查看命令* Router > ?*显示当前模式下的所有命令及解释*Router >enable *进入特权模式*Router #?*显示特权模式下所有命令*Router #con?*显示以con为首的命令*Router #conf(按tab键)*tab键补全以conf为首的命令*Router #conf ter *进入全局配置模式,路由器、交换机配置支持命令简写* Router (config)#hostname r1 *设置路由器名称*Router (config)#enable password密码字符串,*设置明文显示的进入特权模式的密码* Router (config)#enable secret 密码字符串*设置mds加密的进入特权模式的密码,如果同时设置明文及加密密码,则加密密码生效* Router (config)#line console 0 *进入控制台端口线路模式*Router (config-line)#password 密码字符串*设置通过控制台端口登录进入用户模式的密码* Router (config-line)#login *通过console登录时需要密码,如果不输入login,则上一步所设密码不会生效* Router (config-line)#exit *退到前一级模式end命令或ctrl+z键直接退回到特权模式* Router (config)#line vty 0 4 *进入0-4五个虚拟控制台线终端模式*Router (config-line)#password 密码字符串*设置通过telnet登录用户模式的密码*Router (config-line)#loginRouter (config-if)#ip address 192.168.1.254 255.255.255.0 *为接口配置ip地址*Router (config-if)#no shutdow *接口必须激活才能作用*Router (config)#interface serlal 0 *进入串口配置模式*Router (config-if)#ip address10.1.1.10255.255.255.0Router (config-if)#clock rate 64000 * 此命令为DCE接口指定时钟,频率为64000,一般从在实验环境的路由器见背靠背连接中,在路由器DCE端口为另一台路由器DCE接口一端提供时钟同步信号*Router (config)#line console 0Router (config-line)#logging synchronous (光标跟随)Router (config-line)#exec – timeout 0 0 (永不退出)Router(config)#no ip domain-lookup (关闭域名解析)在pc上设置ip地址192.168.1.1默认网关192.168.1.254在pc上ping 192.168.1.254 测试路由器与pc的连通性在路由器特权模式下Router#show running-config *查看路由器当前配置*Router#show startup-config *查看路由器初始配置文件*Router#copy running-config startup-config*拷贝Ram中的运行配置文件到nvRam中的startup-config Router#show startup-config实验二访问远程设备及cdp协议一、实验目的:练习路由器、交换机基本配置,会使用查看中断本地及远程发起的telnet会话,熟悉cdp协议的查看及cdp输出二、实验设备:2501或其他cisco路由器两台,2950交换机各两台三、实验拓扑:console、vty特权密码均为cisco子网掩码均采用255.255.255 0四、实验配置(一)、R1全局hostname R1ip host R2 10.1.1.2 *设置远程路由器的主机名和ip地址映射*enable secret cisco *设置用户模式进入特权模式密码*线路模式login *登录时需要密码*password cisco *设置通过console口进入用户模式密码*line vty 0 4 *0-4代表5条虚拟控制台线路*loginpassword cisco *设置通过telnet进入用户模式密码*interface serial 0 *进入串口0的接口模式*ip address 10.1.1.1 255.255.255.0 *设置串口0的ip地址*clock rate 64000 *为r2提供时钟同步信号*no shutdown *激活接口*interface ethernet 0 *进入以太口的接口模式下*ip address 192.168.1.254.255.255.255.0 *为以太口配置ip地址*(二)、R2与R1相同2950配置hostname 2950enable password cisco *设置进入特权模式的密码*line console 0login *设置通过console口进入用户模式密码*password cisoline vty 0 15loginpassword cisco *设置telnet密码*(四)、实验步骤1、在R1特权模式下输入show cdp neighbors detail 获得邻居的主机名、ip地址、本地连接接口,邻居设备连接接口、保持时间、邻居平台性能、邻居设备型号2、分别telnet 2924 和R2然后用ctrl+shift+6三键同时按住松手后按x键暂时挂起回话退回R1控制台3、在R2上用show line ,show user 查看远端,登录到本地的telnet会话4、在R2上用clear line 清除远端发起的telnet会话5、在R1上用show session 查看本地发起的telnet会话,发现还有1条telnet 1924的会话6、在R1上用show sessions命令查看telnet会话7、在R1上输入2回车,或resume 2 回车再次telnet R28、在R1上用disconnect 1 断开自己发起的telnet会话,然后用show session 验证实验三备份及恢复操作系统一、实验目的:熟悉掌握网络工程师的基本任务――操作系统备份及恢复二、实验设备:25系列或26系列路由器1台,安装tftp服务器软件的pc一台三、实验拓扑四、实验步骤1、在pc上安装tftp服务器程序并打开2、在R1上配置e0口ip地址192.168.1.2543、在R1特权模式下ping 192.168.1.1测试路由器与tfpt服务器的连通性4、在R1上特权模式下输入show flash 查看ios文件大小及文件名5、在R1上输入copy flash tftp 回车在source file name 后输入ios文件名在renote host name 后输入tftp服务器ip地址在destination filename 后按回车确认用默认文件名6、当出现!!!!……后证明操作系统备份成功7、(1)在特权模式下输入reload重启路由器,重启后如果进入router(boot)>界面,则代表系统从ROM中加载的ios子集(一般在25系列和75新的路由器上出现)看到以上界面则进入路由器接口模式下配置以太口地址192.168.1.254然后在特权模式下输入copy tftp flash 接着按提示输入tftp主机名或主机ip 地址ios文件名本地文件名(一般采取默认)看到!!!!……则代表操作系统恢复成功(2)如果重启后看见界面为Romon>则按以下步骤输入(该界面多在26,36,45等系列路由器上出现)Romon>tftpdnldRomon>ip_ADDRESS=192.168.1.254 *为路由器以太口配置地址*Romon>SUBNET_MASK=255.255.255.0 *为路由器以太口配置子网掩码*Romon>DEFAU_GATEW AY=192.168.1.254 *一般为路由器以太口地址*Romon>TFTP_SERVER=192.168.1.1 *tftp服务器地址*Romon>TFTP_FILE=ios文件名Romon>tftpdnld 出现提示时选择yes,当看到!!!!……时代表恢复成功,完成后在Romon>输入reset重启实验四、密码恢复一、实验目的:熟练掌握密码恢复的步骤及原理并加深对register值的认识,熟练掌握拷贝运行配置文件的步骤,并加深对NVRAM,RAM,ROM和flsh四大存储器的作用及存储内容二、实验设备:25系列和26系列路由器各一台,2950交换机一台。
思科常用配置命令及参数思科cisco公司制造的路由器、交换机和其他设备承载了全球80%的互联网通信,成为了网络应用的成功实践者之一,那么你知道思科常用配置命令及参数有哪些吗?下面是店铺整理的一些关于思科常用配置命令及参数的相关资料,供你参考。
思科常用配置命令及参数:启动接口,分配IP地址:router(config-if)# encapsulation frame-relay [cisco | ietf ]router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ] router(config-if)# bandwidth kilobitsrouter(config-if)# frame-relay invers-arp [ Protocol ] [dlci ]<--配置静态Invers ARP表:router(config)# frame-relay Protocol Protocol-Address DLCI [ Broadcast ] [ ietf | cisco ] [ payload-compress | packet-by-packet ] --><--设置Keepalive间隔:router(config-if)# keepalive Number--><--为本地接口指定DLCI:router(config-if)# frame-lelay local-dlci Number--><--子接口配置:router(config-if)# interface Type Port.Subininterface-Number [ multipoint | point-to-point ]router(config-subif)# ip unnumbered Interfacerouter(config-subif)# frame-lelay local-dlci Number-->router(config-if)# ^z配置标准ACL:router(config)# access-list Access-List-Number [ permit | deny ] source [ source-mask ] <-- Access-List-Number 范围:1~99标准ACL;100~199扩展ACL;800~899标准IPX ACL;900~999扩展IPX ACL;1000~1099 IPX SAP ACL;600~699Apple Talk ACL--> router(config)# interface Type Portrouter(config-if)# ip access-group Access-List-Number [ in | out ]router(config-if)# ^z配置扩展ACL:router(config)# access-list Access-List-Number [ permit | deny ] [ Protocol | Protocol-Number ] source source-wildcard [ Source-Port ] destination destination-wildcard [ Destination-Port ] [ established ]router(config)# interface Type Portrouter(config-if)# ip access-group Access-List-Number [ in | out ]router(config-if)# ^z配置命名ACL:router(config)# ip access-list [ standard | extended ] ACL-Namerouter(config [ std- | ext- ] nacl)# [ permit | deny ] [ IP-Access-List-Test-Conditions ]router(config [ std- | ext- ] nacl)# no [ permit | deny ] [ IP-Access-List-Test-Conditions ]router(config [ std- | ext- ] nacl)# ^zrouter(config)# interface Type Portrouter(config-if)# ip access-group [ACL-Name | 1~199 ] [ in | out ]router(config-if)# ^z配置DCE时钟:router# show controllers Type Port <--确定DCE接口-->router(confin-if)# clock rate 64000 <--进入DCE接口设置时钟速率-->router(config-if)# ^z配置PPP协议:router(config)# username Name password Set-Password-Here <--验证方建立数据库-->router(config)# interface Type Portrouter(config-if)# encapsulation ppp <--启动PPP协议-->router(config-if)# ppp outhentication [ chap | chap pap | pap chap | pap ] <--选择PPP认证-->router(config-if)# ppp pap sent-username Name password Password <--发送验证信息-->router(config-if)# ^zPAP单向认证配置实例:验证方:router-server(config)# username Client password 12345 <--验证方建立数据库-->router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication pap <--选择使用PAP实现PPP认证-->router-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp pap sent-username Client password 12345 <--发送验证信息-->router-client(config-if)# ^zPAP双向认证配置实例:路由器 A:routerA(config)# username B password 12345routerA(config)# interface serial 0routerA(config-if)# encapsulation ppprouterA(config-if)# ppp authentication paprouterA(config-if)# ppp pap sent-username A password 54321routerA(config-if)# ^z路由器 B:routerB(config)# username A password 54321routerB(config)# interface serial 1routerB(config-if)# encapsulation ppprouterB(config-if)# ppp authentication paprouterB(config-if)# ppp pap sent-username B password 12345routerB(config-if)# ^zCHAP单向认证配置实例:验证方:router-server(config)# username router-client password 12345router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication chaprouter-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp authentication chaprouter-client(config-if)# ppp chap hostname router-clientrouter-client(config-if)# ppp chap password 12345router-client(config-if)# ^z。
本文针对实际操作问题,详细的给大家罗列出思科路由器基本的配置和常用的配置命令,相信看过此文会对你有所帮助。
启动接口,分配IP地址:router> router> enable router# router# configure terminalrouter(config# router(config# interface Type Port router(config-if# no shutdown router(config-if# ip address IP-Address Subnet-Mask router(config-if# ^z 配置RIP路由协议:30秒更新一次router(config# router riprouter(config-if# network Network-Number <--通告标准A,B,C类网-->router(config-if# ^z 配置IGRP路由协议:90秒更新一次router(config# router igrp AS-Number <-- AS-Number范围1~65535--> router(config-if# network Network-Number <--通告标准A,B,C类网--> router(config-if# ^z配置Novell IPX路由协议:Novell RIP 60秒更新一次router(config# ipx routing [node address] router(config# ipx maximum-paths Paths <--设置负载平衡,范围1~512--> router(config# interface Type Port router(config-if# ipx network Network-Number [encapsulation encapsulation-type] [secondary] <--通告标准A,B,C类网--> router(config-if# ^z配置DDR:router(config# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number] router(config# interface bri 0 router(config-if# dialer-group Group-Number router(config-if# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number router(config-if# ^z配置ISDN:router(config# isdn swith-type Swith-Type <--配置ISDN交换机类型,中国使用basic-net3--> router(config-if# ^z 配置Frame Relay:router(config-if# encapsulation frame-relay [cisco ietf ] router(config-if# frame-relay lmi-type [ansi cisco q933a ] router(config-if# bandwidth kilobitsrouter(config-if# frame-relay invers-arp [ Protocol ] [dlci ] <--配置静态Invers ARP 表:router(config# frame-relay Protocol Protocol-Address DLCI [ Broadcast ] [ ietf cisco ] [ payload-compress packet-by-packet ] --> <--设置Keepalive间隔:router(config-if# keepalive Number --> <--为本地接口指定DLCI:router(config-if# frame-lelay local-dlci Number --> <--子接口配置:router(config-if# interface Type Port.Subininterface-Number [ multipoint point-to-point ] router(config-subif# ip unnumbered Interface router(config-subif# frame-lelay local-dlci Number --> router(config-if# ^z配置标准ACL:router(config# access-list Access-List-Number [ permitdeny ] source [ source-mask ] <-- Access-List-Number 范围:1~99标准ACL;100~199扩展ACL;800~899标准IPX ACL;900~999扩展IPX ACL;1000~1099 IPX SAP ACL;600~699Apple Talk ACL--> router(config# interface Type Port router(config-if# ip access-group Access-List-Number [ in out ] router(config-if# ^z配置扩展ACL:router(config# access-list Access-List-Number [ permit deny ] [ Protocol Protocol-Number ] source source-wildcard [ Source-Port ] destination destination-wildcard [ Destination-Port ] [ established ] router(config# interface Type Port router(config-if# ip access-group Access-List-Number [ in out ] router(config-if# ^z配置命名ACL:router(config# ip access-list [ standard extended ] ACL-Name router(config [ std- ext- ] nacl# [ permit deny ] [ IP-Access-List-Test-Conditions ] router(config [ std- ext- ] nacl# no [ permit deny ] [ IP-Access-List-Test-Conditions ] router(config [ std- ext- ] nacl# ^z router(config# interface Type Port router(config-if# ip access-group [ACL-Name 1~199 ] [ in out ] router(config-if# ^z配置DCE时钟:router# show controllers Type Port <--确定DCE接口--> router(confin-if# clock rate 64000 <--进入DCE接口设置时钟速率--> router(config-if# ^z配置PPP协议:router(config# username Name password Set-Password-Here <--验证方建立数据库--> router(config# interface Type Port router(config-if# encapsulation ppp <--启动PPP协议--> router(config-if# ppp outhentication [ chap chap pap pap chap pap ] <--选择PPP认证--> router(config-if# ppp pap sent-username Name password Password <--发送验证信息--> router(config-if# ^zPAP单向认证配置实例:验证方:router-server(config# username Client password 12345 <--验证方建立数据库--> router-server(config# interface serial 0 router-server(config-if# encapsulation ppp router-server(config-if# ppp authentication pap <--选择使用PAP实现PPP认证--> router-server(config-if# ^z 被验证方:router-client(config-if# encapsulation ppp router-client(config-if# ppp pap sent-username Client password 12345 <--发送验证信息--> router-client(config-if# ^zPAP双向认证配置实例。
在思科模拟器上怎么进行交换机的基本配置在思科模拟器上怎么进行交换机的基本配置在思科模拟器上怎么进行交换机的基本配置 11、首先,打开思科模拟器软件,连接三台交换机的连接线,将所有交换机互相连接起来,一台当服务器,一台当客户机,另外一台当透明模式。
2、把三台交换机的配置清除干净,重启交换机,配置命令为:复制内容到剪贴板S1#flash:vlan.dat S1#erasestartup-config S1#reload配置S1 为VTP server,配置命令为:复制内容到剪贴板 S1(config)#vtpmodeserver3、配置S3 为VTP transparent,配置命令是:复制内容到剪贴板S3#vlandatabase S3(vlan)#vtptransparent S3(vlan)#vtppasswordcisco(配置交换机的密码)SettingdeviceVLANdatabasepasswordtocisco4、配置S2 为VTP client,配置命令是:复制内容到剪贴板S2(config)#vtpmodeclient SettingdevicetoVTPCLIENTmode. S2(config)#vtpdomainVTP-TEST DomainnamealreadysettoVTP-TEST. S2(config)#vtppasswordcisco5、在S1 上创建VLAN,检查S2、S3 上的VLAN 信息,配置命令是:复制内容到剪贴板 S1(config)#vlan2 S1(config)#vlan3查看s1,s2,s3的VLAN配置信息。
命令是:复制内容到剪贴板 S1#showvlan S2#showvlan S3#showvlan6、查看VTP 信息,查看交换机的vtp详细信息和版本等信息:复制内容到剪贴板 S1#showvtpstatus注意事项:1、要成功配置vtp服务器,应确认配置的所有交换机都已设置为默认设置。
思科模拟器三层交换机VLAN配置一、实验拓扑图:交换机switch 1的端口fei_0/1和交换机switch 2的端口fei_0/1属于VLAN 10;交换机switch 1的端口fei_0/2和交换机switch 2的端口fei_0/2属于VLAN 20,均为Access端口。
两台交换机通过端口fei_0/16以Trunk方式连接,两端口为Trunk端口。
二、操作步骤:1、在switch 1上配置VLAN10和VLAN20,VLAN10的成员包括fei_0/1和上行端口fei_0/16,VLAN20的成员包括fei_0/2上行端口fei_0/16。
2、在switch 2上配置VLAN10和VLAN20,VLAN10的成员包括fei_0/1和上行端口fei_0/16,VLAN20的成员包括fei_0/2和上行端口fei_0/16。
switch 1配置命令如下:ZXR10>enableZXR10#vlan database------在特权模式下配置VLAN数据库ZXR10(vlan)#vlan 10-------创建VLAN 10ZXR10(vlan)#vlan 20------创建VLAN 20ZXR10(vlan)#exitZXR10#configure terminalZXR10(config)#1、进入端口fei_0/1,把端口fei_0/1加入vlan 10,fei_0/1模式为access;ZXR10(config)#interface fastethernet 0/1ZXR10(config-if)#switchport mode accessZXR10(config-if)#switchport access vlan 10ZXR10(config-if)#exit2、进入端口fei_0/2,把端口fei_0/2加入vlan 20,fei_0/2模式为access;ZXR10(config)#interface fastethernet 0/2ZXR10(config-if)#switchport mode accessZXR10(config-if)#switchport access vlan 20ZXR10(config-if)#exit3、进入fei_0/16端口,将该端口设置成trunk模式,并且把端口fei_0/16以trunk模式加入vlan10,vlan 20ZXR10(config)#interface fastethernet 0/16ZXR10(config-if)#switchport mode trunkZXR10(config-if)#switchport trunk allowed vlan 10,20ZXR10(config-if)#endZXR10#write---------保存文件(备注:switch 2配置命令同switch 1一样)三、验证方法:1. PC-1和PC-2不能互通,PC-3和PC-4不能互通2. PC-1和PC-3互通,PC-2和PC-4互通。
操作说明 命令要在一行内打完,窗体可以自动拉大。
Aux 口这个版本暂不支持 支持三级 Switch 网络 , 需要路由时支持两级 Switch 。
设置的主机名中不要含有空格。
F2、F3键 清屏 (为了方便而加 ) Ctrl+P 历史命令,建议使用方向键。
Ctrl+z 回根, 建议使用 end 命令Ctrl+Break 路由器进入 ROM 监控状态。
交换机清除特权密码。
双击设备进入终端操作 单击设备的接口可以实现画线 单击画有线的接口可以删除连线 在指定的设备按下鼠标右键可以删除设备。
在指定的设备按下鼠标左键可以实现移动。
按 Tab 键,可以得到命令全称。
键入 "?" 可以得到当前状态下的命令帮助。
接收的作业名固定为当前目录下的 sim.txt 。
系统的配置文件是: sim.ini 。
计算测验得分中, ping PCA->PCB;5 表示 ping 通得 5 分,SWAf6=2;5 表示交换机 SwitchA 的 f0/6 在 vlan 2 时得 5 分。
交换机基本状态: switch:PCA login: root password: linux # shutdown -h now # logout # login # ifconfig # ifconfigeth0 <ip address> netmask <netmask> # ifconfig eht0 <ip address> netmask <netmask> down # route add 0.0.0.0 gw <ip> # route del 0.0.0.0 gw <ip> # route add default gw <ip> # route del default gw <ip> # route# ping <ip> # telnet <ip>;使用 root 用户;口令是 linux;显示 IP 地址 ;设置 IP 地址 ; 删除 IP 地;设置网关 ;删除网关 ;显示网;交换机的 ROM 状态;路由器的 ROM 状态 ;用户模式 ;特权模式 ;全局配置模式;接口状态交换机口令设置: switch>enableswitch#config terminalswitch(config)#hostname <hostname> switch(config)#enable secret xxx switch(config)#enable password xxa switch(config)#line console 0 switch(config-line)#line vty 0 4 switch(config-line)#loginswitch(config-line)#password xx switch#exit交换机 VLAN 设置: switch#vlandatabase switch(vlan)#vlan 2switch(vlan)#no vlan 2switch(config)#int f0/1switch(config-if)#switchport access vlan 2 switch(config-if)#switchport mode trunk switch(config-if)#switchport trunk allowed vlan 1,2switch(config-if)#switchport trunkencap dot1q switch(config)#vtp domain <name> switch(config)#vtp password<word> switch(config)#vtp mode server switch(config)#vtp mode client交换机设置 IP 地址:switch(config)#interface vlan 1switch(config-if)#ip address <IP><mask> switch(config)#ip default-gateway <IP> switch#dir flash: 交换机显示命令: switch#writeswitch#show vtp switch#show runswitch#show vlan switch#show interface switch#show int f0/0rommon> hostname> hostname#hostname(config)# hostname(config-if)#;进入特权模式 ;进入全局配置模式 ;设置交换机的主机名;设置特权加密口令;设置特权非密口令 ;进入控制台口 ;进入虚拟终端 ;允许登录 ;设置登录口令xx;进入 VLAN 设置 ;建 VLAN 2 ;删 vlan 2 ;进入端口 1 ;当前端口加入 vlan 2 ;设置为干线 ;设置允许的 vlan ;设置 vlan 中继;设置发 vtp 域名;设置发 vtp 密码 ;设置发 vtp 模式;进入 vlan 1 ;设置 IP 地址 ;设置默认网关 ;查看闪存 ;保存配置信息 ;查看 vtp 配置信息 ;查看当前配置信息;查看 vlan 配置信息 ;查看端口信息路由器显示命令: router#show runrouter#show interface router#show ip route router#show cdp nei router#reload路由器口令设置: router>enablerouter#config terminalrouter(config)#hostname <hostname> router(config)#enable secret xxx router(config)#enable password xxbrouter(config)#line console 0 router(config-line)#line vty 0 4 router(config-line)#login router(config-line)#password xxrouter(config)#(Ctrl+z) router#exit路由器配置: router(config)#int s0/0router(config-if)#no shutdown router(config-if)#clock rate 64000 router(config-if)#ip address <ip> <netmask> router(config-if)#ip address <ip> <netmask> second router(config-if)#int f0/0.1 router(config-subif.1)#ip address <ip> <netmask> router(config-subif.1)#encapsulation dot1q <n>router(config)#config-register 0x2142 router(config)#config-register 0x2102 router#reload路由器文件操作: router#copy running-configstartup-config router#copy running-config tftp router#copy startup-config tftp router#copy tftp flash: router#copy tftp startup-config;进入 ROM 监控状态;显示配置信息 ;显示接口信息 ;显示路由信息 ;显示邻居信息 ;重新起动;进入特权模式 ;进入全局配置模式 ;设置交换机的主机名;设置特权加密口令;设置特权非密口令 ;进入控制台口 ;进入虚拟终端 ;要求口令验证 ;设置登录口令 xx ; 返回特权模式 ;进入 Serail 接口 ;激活当前接口 ;设置同步时钟 ;设置 IP 地址 ;设置第二个 IP ;进入子接口 ;设置子接口 IP ;绑定 vlan 中继协议 ;跳过配置文件 ;正常使用配置文件 ;重新引导 ;保存配置;保存配置到 tftp ;开机配置存到 tftp ;下传文件到flash;下载配置文件 ROM 状态: Ctrl+Brearommon>confreg 0x2142 rommon>confreg 0x2102 rommon>reset rommon>copyx modem:<sname>fl ash:<dname>rommon>IP_ADDRESS=10.65.1.2rommon>IP_SUBNET_MASK=255.255.0.0rommon>TFTP_SERVER=10.65.1.1rommon>TFTP_FILE=c2600.bin rommon>tftpdnld rommon>dir flash: rommon>boot静态路由:ip route <ip-address> <subnet-mask> <gateway> router(config)#ip route 2.0.0.0 255.0.0.01.1.1.2 router(config)#ip route 0.0.0.00.0.0.0 1.1.1.2动态路由:router(config)#ip routingrouter(config)#router rip router(config-router)#network <netid> router(config-router)#negihbor <ip>帧中继命令: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 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-changesrouter(config)#int s0/0.1 point-to-pointrouter#show frame pvc router#show frame map基本访问控制列表:router(config)#access-list<number> permit|deny router(config)#interface <interface>router(config-if)#ip access-group <number>in|out;跳过配置文件;恢复配置文件;重新引导;从console 传输文件;设置路由器IP ;设置路由器掩码;指定TFTP服务器IP;指定下载的文件;从tftp 下载;查看闪存内容;引导IOS;命令格式;静态路由举例;默认路由举例;启动路由转发;启动RIP 路由协议。
思科基本配置命令详解思科交换机基本配置实例讲解目录1、基本概念介绍 (2)2、密码、登陆等基本配置 (2)3、CISCO设备端口配置详解 (8)4、VLAN的规划及配置 (13)4.1核心交换机的相关配置 (13)4.2接入交换机的相关配置 (25)5、配置交换机的路由功能 (30)6、配置交换机的DHCP功能 (31)7、常用排错命令 (32)1、基本概念介绍IOS: 互联网操作系统,也就是交换机和路由器中用的操作系统VLAN: 虚拟lanVTP: VLAN TRUNK PROTOCOLDHCP: 动态主机配置协议ACL:访问控制列表三层交换机:具有三层路由转发能力的交换机本教程中“#”后的蓝色文字为注释内容。
2、密码、登陆等基本配置本节介绍的内容为cisco路由器或者交换机的基本配置,在目前版本的cisco交换机或路由器上的这些命令是通用的。
本教程用的是cisco的模拟器做的介绍,一些具体的端口显示或许与你们实际的设备不符,但这并不影响基本配置命令的执行。
Cisco 3640 (R4700) processor (revision 0xFF) with 124928K/6144K bytes of memory. Processor board ID 00000000 R4700 CPU at 100MHz, Implementation 33, Rev 1.22 Ethernet interfaces8 Serial interfacesDRAM configuration is 64 bits wide with parity enabled.125K bytes of NVRAM.8192K bytes of processor board System flash (Read/Write) --- System Configuration Dialog ---Would you like to enter the initial configuration dialog? [yes/no]: n# 此处我们选择no,不进入他的初始化配置向导Press RETURN to get started!# 选择no以后,提示你按回车键开始,此处我们需要按回车键*Mar 1 00:43:56.591: %IP-5-WEBINST_KILL: Terminating DNS process*Mar 1 00:43:58.379: %SYS-5-RESTART: System restarted -- Cisco IOS Software, 3600 Software (C3640-JK9O3S-M), Version 12.3(14)T7, RELEASE SOFTWARE (fc2)Technical Support: /doc/2e0ca09e0b4e767f5acfcecf.html/techsupportCopyright (c) 1986-2006 by Cisco Systems, Inc.Compiled Wed 22-Mar-06 21:46 by pwade*Mar 1 00:43:58.411: %SNMP-5-COLDSTART: SNMP agent on host Router is undergoing a cold startRouter># 等显示稳定后,出现最初的提示符,注意提示符是“>”,目前所处的状态称为用户模式。
相同VLAN间的通信:Switch0与Switch1配置命令相同:Switch#conf tSwitch(config)#vlan 10Switch(config-vlan)#exSwitch(config)#int rang f0/1-5Switch(config-if-range)#sw acc vlan 10Switch(config-if-range)#exSwitch(config)#int f0/24Switch(config-if)#sw mode trunk配置聚合口:(聚合口的成员口类型要一致)Switch0与Switch1配置命令相同:Switch(config)#int rang f0/23-24Switch(config-if-range)#channel-group 1 mode on Switch(config-if-range)#exSwitch(config)#int port-channel 1Switch(config-if)#sw mode trunk远程登陆交换机:Switch(config)#int vlan 1Switch(config-if)#ip add 1.1.1.1 255.255.255.0(IP地址要和远程登陆的客户机在同一个网段) Switch(config-if)#no shSwitch(config-if)#exSwitch(config)#line vty 0Switch(config-line)#password zlrSwitch(config-line)#exitSwitch(config)#enable secret 123Switch(config)#ex三层交换机不同VLAN间的通信:三层交换机配置:Switch(config)#vlan 10Switch(config-vlan)#vlan 20Switch(config-vlan)#exSwitch(config)#int rang f0/23-24Switch(config-if-range)#sw trunk encapsulation dot1qSwitch(config-if-range)#sw mode trunkSwitch(config-if-range)#exSwitch(config)#int vlan 10Switch(config-if)#ip add 192.168.10.254 255.255.255.0Switch(config-if)#no shSwitch(config-if)#exSwitch(config)#int vlan 20Switch(config-if)#ip add 192.168.20.254 255.255.255.0Switch(config-if)#no shSwitch(config-if)#exSwitch(config)#ip routingSwitch0与Switch1配置命令相同:Switch(config)#vlan 20Switch(config-vlan)#exSwitch(config)#int rang f0/6-10Switch(config-if-range)#sw acc vlan 20Switch(config-if-range)#exSwitch(config)#int f0/21Switch(config-if)#sw mode trunk端口安全:Switch1配置命令:Switch(config)#int f0/2Switch(config-if)#sw mode acc(端口安全配置要在端口是静态的前提下) Switch(config-if)#sw port-securitySwitch(config-if)#sw port-security violation protectSwitch(config-if)#sw port-security maximum 1Switch(config-if)#sw port-security mac-address 0000.0c8a.9206 Switch(config-if)#no sw port-security mac-address 0000.0c8a.9206 Switch(config-if)#sw port-security mac-address 0000.0c8a.92d6生成树协议的配置:在选定为根交换机的交换机下配置:Switch(config)#spanning-tree mode pvstSwitch(config)#spanning-tree vlan 1 priority 4096三层交换机与理由器的静态路由通信:ROUTER0:Router#conf tRouter(config)#int f1/0Router(config-if)#ip add 192.168.1.2 255.255.255.0Router(config-if)#no shRouter(config-if)#exRouter(config)#int f0/0Router(config-if)#ip add 192.168.2.254 255.255.255.0Router(config-if)#no shRouter(config-if)#exRouter(config)#ip route 192.168.10.0 255.255.255.0 192.168.1.1Router(config)#ip route 192.168.20.0 255.255.255.0 192.168.1.1三层交换机配置:(F0/1作为路由口的配置;若作为SVI配置,则只需把F0/1划分到VLAN10,VLAN20其中之一并把理由器的F1/0的IP地址设置到与SVI端口相同的网段)Switch(config)#int f0/1Switch(config-if)#no swSwitch(config-if)#ip add 192.168.1.1 255.255.255.0Switch(config-if)#no shSwitch(config-if)#exSwitch(config)#ip route 192.168.2.0 255.255.255.0 f0/1单臂路由配置:ROUTER1:Router(config)#int f0/0Router(config-if)#no shRouter(config-if)#exRouter(config)#int f0/0.1Router(config-subif)#encapsulation dot1q 30Router(config-subif)#ip add 192.168.30.254 255.255.255.0Router(config-subif)#no shRouter(config)#int f0/0.2Router(config-subif)#encapsulation dot1q 40Router(config-subif)#ip add 192.168.40.254 255.255.255.0Router(config-subif)#exSwitch2:Switch(config)#vlan 30Switch(config-vlan)#vlan 40Switch(config-vlan)#exSwitch(config)#int rang f0/1-5Switch(config-if-range)#sw acc vlan 30Switch(config-if-range)#exSwitch(config)#int rang f0/6-10Switch(config-if-range)#sw acc vlan 40Switch(config-if-range)#exSwitch(config)#int f0/24Switch(config-if)#sw mode trunkRIP协议:(连接好每个路由器的端口并配置好各个IP地址,再宣告各个路由器直连的网段)ROUTER1:Router(config)#route ripRouter(config-router)#version 2Router(config-router)#network 192.168.3.0Router(config-router)#network 192.168.30.0Router(config-router)#network 192.168.40.0Router(config-router)#exOSPF协议配置:(连接好每个路由器的端口并配置好各个IP地址,再宣告各个路由器直连的网段)ROUTER2:(作为ABR)Router(config)#route ospf 1Router(config-router)#network 192.168.100.0 0.0.0.255 area 1 Router(config-router)#network 192.168.4.0 0.0.0.255 area 0 Router(config-router)#network 192.168.5.0 0.0.0.255 area 0 路由重分布:ROUTER1(作为ASBR):Router(config)#route ripRouter(config-router)#version 2Router(config-router)#network 192.168.3.0Router(config-router)#network 192.168.30.0Router(config-router)#network 192.168.40.0Router(config-router)#exRouter(config)#route ospf 1Router(config-router)#network 192.168.100.0 0.0.0.255 area 1 Router(config-router)#exRouter(config)#route ripRouter(config-router)#redistribute ospf 1 metric 1Router(config-router)#exRouter(config)#route ospf 1Router(config-router)#redistribute rip metric 1 subnetsNAT配置:ROUTER4:Router>enRouter#conf tRouter(config)#int f0/0Router(config-if)#ip add 192.168.200.254 255.255.255.0Router(config-if)#no shRouter(config-if)#eRouter(config)#int f1/0Router(config-if)#ip add 192.168.150.254 255.255.255.0Router(config-if)#no shRouter(config-if)#exRouter(config)#ip nat inside source static 192.168.200.1 192.168.7.3Router(config)#int f0/0Router(config-if)#ip nat insideRouter(config-if)#exRouter(config)#int se3/0Router(config-if)#ip nat outsideRouter(config-if)#exRouter(config)#ip nat pool zlr 192.168.7.4 192.168.7.10 netRouter(config)#ip nat pool zlr 192.168.7.4 192.168.7.10 netmask 192.168.7.0 Router(config)#access-list 1 permit 192.168.200.0 0.0.0.255Router(config)#ip nat inside source list 1 pool zlrRouter(config)#int f0/0Router(config-if)#ip nat insideRouter(config-if)#exRouter(config)#int se3/0Router(config-if)#ip nat outsideRouter(config-if)#exRouter(config)#ip nat inside source static tcp 192.168.150.1 80 192.168.7.2 80 Router(config)#int f1/0Router(config-if)#ip nat insideRouter(config-if)#exRouter(config)#int se 3/0Router(config-if)#ip nat outsideRouter(config-if)#exRouter(config)#ip nat pool xl 192.168.7.20 192.168.7.20 netmask 192.168.7.0 Router(config)#access-list 2 permit 192.168.150.0 0.0.0.255Router(config)#ip nat inside source list 2 pool xl overloadRouter(config)#int f1/0Router(config-if)#ip nat insideRouter(config-if)#exRouter(config)#int se3/0Router(config-if)#ip nat outsideRouter(config-if)#ACL配置:ROUTER4:Router(config)#access-list 10 deny 192.168.4.0 0.0.0.255Router(config)#access-list 10 permit anyRouter(config)#int f1/0Router(config-if)#ip access-group 10 outRouter(config-if)#exRouter(config)#ip access-list standRouter(config)#ip access-list standard xzRouter(config-std-nacl)#10 deny 192.168.6.0 0.0.0.255Router(config-std-nacl)#20 permit anyRouter(config-std-nacl)#exRouter(config)#int f0/0Router(config-if)#ip access-group xz outROUTER2:Router(config)#access-list 100 deny tcp host 192.168.4.1 host 192.168.7.3 eq www Router(config)#access-list 100 permit ip any anyRouter(config)#int f0/0Router(config-if)#ip access-group 100 inROUTER3:Router(config)#ip access-list extended lrRouter(config-ext-nacl)#10 deny tcp host 192.168.6.1 host 192.168.7.2 eq www Router(config-ext-nacl)#20 permit ip any anyRouter(config)#int f0/0Router(config-if)#ip accRouter(config-if)#ip access-group lr in。