思科中路由器的基础配置命令
思科路由器命令大全(完整版)

思科路由器命令大全(完整版)思科路由器命令大全(完整版)本文档旨在提供思科路由器命令的详细说明和使用指南,包括路由器配置、网络管理、安全性设置等内容。
每个章节都详细介绍了不同的命令和参数,以帮助用户更好地理解和使用思科路由器。
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:路由信息协议,一种距离向量路由协议。
思科路由器基本配置与常用配置命令

思科路由器基本配置与常用配置命令(simple for CCNA)启动接口,分配IP地址:router>router> enablerouter#router# configure terminalrouter(config)#router(config)# interface Type Portrouter(config-if)# no shutdownrouter(config-if)# ip address IP-Address Subnet-Maskrouter(config-if)# ^z配置RIP路由协议:30秒更新一次router(config)# router riprouter(config-if)# network Network-Numberrouter(config-if)# ^z配置IGRP路由协议:90秒更新一次router(config)# router igrp AS-Numberrouter(config-if)# network Network-Numberrouter(config-if)# ^z配置Novell IPX路由协议:Novell RIP 60秒更新一次router(config)# ipx routing [node address]router(config)# ipx maximum-paths Pathsrouter(config)# interface Type Portrouter(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] router(config-if)# ^z配置DDR:router(config)# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number]router(config)# interface bri 0router(config-if)# dialer-group Group-Numberrouter(config-if)# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number router(config-if)# ^z配置ISDN:router(config)# isdn swith-type Swith-Typerouter(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 ]router(config-if)# ^z配置标准ACL:router(config)# access-list Access-List-Number [ permit | deny ] source [ source-mask ]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 Portrouter(confin-if)# clock rate 64000router(config-if)# ^z配置PPP协议:router(config)# username Name password Set-Password-Hererouter(config)# interface Type Portrouter(config-if)# encapsulation ppprouter(config-if)# ppp outhentication [ chap | chap pap | pap chap | pap ]router(config-if)# ppp pap sent-username Name password Passwordrouter(config-if)# ^zPAP单向认证配置实例:验证方:router-server(config)# username Client password 12345router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication paprouter-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp pap sent-username Client password 12345router-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)# ^zCHAP双向认证配置实例:路由器A:routerA(config)# username routerB password 12345routerA(config)# interface serial 0routerA(config-if)# encapsulation ppprouterA(config-if)# ppp authentication chaprouterA(config-if)# ppp chap hostname routerArouterA(config-if)# ppp chap password 54321 routerA(config-if)# ^z路由器B:routerB(config)# username routerA password 54321routerB(config)# interface serial 1routerB(config-if)# encapsulation ppprouterB(config-if)# ppp authentication chaprouterB(config-if)# ppp chap hostname routerBrouterB(config-if)# ppp chap password 12345routerB(config-if)# ^zTelnet使用:routerA# terminal monitorrouterA# telnet IP-Address [ Router-Name ]routerB# [ exit | logout ]routerB# ++再按routerA# show sessionsrouterA# Connect-NumberrouterA# disconnect IP-Address [ Router-Name ]routerA# show userrouterA# clear line [ 0 | 1 | 2 | 3 | 4 ]禁止任何Telnet到本机:router(config)# line vty 0 4router(config-line)# access-class ACL-Numberrouter(config)# ^z设置主机名:router(config)# hostname Set-Hostnamerouter(config)# ^zrouter(config)# ^z设置用户模式密码:。
Cisco路由器基本配置命令-电脑资料

Cisco路由器基本配置命令-电脑资料一、1.router(config)#router rip 启动rip进程2.router(conifg-router)#network 172.17.0.0指定rip协议的主网络3.router(config-router)#passive-interface f0/1把f0/1配置成passive端口4.router(config-router)#neighbor 172.17.12.67 以单波方式通告rip更新给路由器5.router(config-if)#ip address 192.168.83.244 255.255.255.0 主ip地址router(config-if)#ip address 10.33.55.1 255.255.255.0 secondary辅助ip地址二、1.router(config-router)#version 2将rip配置成版本22.router(config-ip)#ip rip send version 1只发rip 1数据包router(config-ip)#ip rip receive version 2只接收rip 2数据包3.router(config-router)#no auto-summary 关闭汇总功能4.router(config-if)#no ip split-horizon关闭水平分割5.router#show ip ospf database router 192.168.30.10显示路由器LSA通告router#show ip ospf database network 192.168.17.18显示网络LSA通告router#show ip ospf database summary 172.16.121.0显示网络汇总LSA通告router#show ip ospf database asbr-summary显示ASBR汇总LSA通告router#show ip ospf database external 10.83.10.0显示自主系统外部LSA通告router#show ip ospf database nssa-external显示NSSA外部LSA通告三、1.router(config)#router ospf 10配置ospf进程id2.router(config)#interface loopback0router(config-if)#ip address 192.168.10.1 255.255.255.0配置loopback0接口3.router(config-router)#area 1 stub 配置stub区域4.router(config-router)#area 1 stub no-summary配置totally stubby区域5.router(config-router)#area 1 nssa配置nssa区域6.router(config-router)#area 25 range 172.16.0.0 255.240.0.0 配置地址汇总7.router(config-router)#area 100 virtual-link 192.168.100.33 配置虚链路四、1.router(config)#standby 172 ip 172.16.10.254加入备份组172 指定虚拟IP 地址2.router(config-if)#standby 47 priority 150配置HSRP的优先级1503.router(config-if)#standby 47 preempt 配置HSRP的占先权4.router(config-if)#standby 47 ip time 2 9 2表示HELLO时间,9表示保持时间5.router(config)#interface s06.router(config-if)#standby 47 track s0 100配置跟踪端口s0并在端口down时减少1007.router#show standby brief 查看HSRP的状态8.router#no debuge all关闭调试功能五、1.router(config-if)#ip access-group 1 in 访问列表的入router(config-if)#ip access-group 1 out访问列表的出2.router(config)#access-list 1 premit 192.168.10.0 0.0.0.255 允许192.168.10.0的网段通过router(config)#access-list 1 deny 192.168.10.0 2.0.0.255 拒绝192.168.10.2的主机通过3.router(config)#access-list 1 premit any ;any表示0.0.0.0 255.255.255.255router(config)#access-list 1 premit host 172.30.16.29 ;host 表示0.0.0.04.router(config)#access-list 101 deny tcp 172.16.4.0 0.0.0.255 172.16.3.0 0.0.0.255 eq 21拒绝来自172.16.4.0去往172.16.3.0的FTP流量5.router(config)#ip access-list extended cisco创建名为cisco的命名访问控制列表六、静态地址转换1.配置外部端口的IP地址Router(config)#interface s0Router(config-if)#ip address 61.159.62.129 255.255.255.2482.配置内部端口的IP地址Router(config)#interface e0Router(config-if)#ip address 192.168.100.1 255.255.255.03.静态地址转换Router(config)#ip nat inside source static 192.168.100.2 61.159.62.1304.在内部和外部端口上启用NATRouter(config)#interafce s0Router(config-if)#ip nat outsideRouter(config)#interafce e0Router(config-if)#ip nat inside七、动态NAT配置1.配置外部端口的IP地址Router(config)#interface s0Router(config-if)#ip address 61.159.62.129 255.255.255.2482.配置内部端口的IP地址Router(config)#interface e0Router(config-if)#ip address 192.168.100.1 255.255.255.03.定义内部网络允许访问外部网络Router(config)#access-list 1 permit 192.168.100.0 0.0.0.2554.定义合法的IP地址池Router(config)#ip nat pool chen 61.159.62.129 61.159.62.190 netmask 255.255.255.2485.实现网络地址转换Router(config)#ip nat inside source list 1 pool chen6.在内部和外部端口上启用NATRouter(config)#interafce s0Router(config-if)#ip nat outsideRouter(config)#interafce e0Router(config-if)#ip nat inside八、PAT的配置1.配置外部端口的IP地址Router(config)#interface s0Router(config-if)#ip address 61.159.62.129 255.255.255.2482.配置内部端口的IP地址Router(config)#interface e0Router(config-if)#ip address 192.168.100.1 255.255.255.03.定义内部网络允许访问外部网络Router(config)#access-list 1 permit 192.168.100.0 0.0.0.2554.定义合法的IP地址池Router(config)#ip nat pool chen 61.159.62.129 61.159.62.190 netmask 255.255.255.2485.实现复用IP地址转换Router(config)#ip nat inside source list 1 pool chen overload6.在内部和外部端口上启用NATRouter(config)#interafce s0Router(config-if)#ip nat outside。
cisco路由基本配置命令

一、几种配置命令模式switch>这种提示符表示是在用户命令模式,只能使用一些查看命令。
switch#这种提示符表示是在特权命令模式。
switch(config)# 这种提示符表示是全局配置模式switch(config-if)# 端口配置命令模式图一几种命令模式二、检查、查看命令这些命令是查看当前配置状况,通常是以show(sh)为开始的命令。
show version查看IOS的版本、show flash查看flash内存使用状况、show mac-address-table查看MAC地址列表图二图三图四图五Show ? 帮助命令显示当前所有的查看命令图六查看端口状态信息三、密码设置命令Cisco交换机、路由器中有很多密码,设置好这些密码可以有效地提高设备的安全性。
switch(config)#enable password 设置进入特权模式进的密码switch(config-line) 可以设置通过console端口连接设备及telnet 远程登录时所需要的密码图七设置交换机的各种密码默认情况下,这些密码都是以明文的形式存储,所以很容易查看到。
为了避免这种情况,我们可以以密文的形式存储各种密码:servicepassword-encryption图九图十密码以密文的形式存储四、配置IP地址及默认网关图十一五、管理MAC地址表switch#show mac-address-table 显示MAC地址列表switch#clear mac-address-table dynamic 清除动态MAC地址列表图十二图十三设置静态MAC地址六、配置端口安全switch(config-if)switchport port-securityswitch(config-if)switchport port-security maximum 4图十四图十五七、一个配置实例图十六实例拓扑图图十七图十八图十九二、配置vlanVlan(Virtual Local Area Network)即虚拟局域网。
思科路由器命令集

路由器基本操作命令: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。
思科路由器基本配置与常用配置命令

思科路由器基本配置与常用配置命令(simple for CCNA)启动接口,分配IP地址:router>router> enablerouter#router# configure terminalrouter(config)#router(config)# interface Type Portrouter(config-if)# no shutdownrouter(config-if)# ip address IP-Address Subnet-Maskrouter(config-if)# ^z配置RIP路由协议:30秒更新一次router(config)# router riprouter(config-if)# network Network-Numberrouter(config-if)# ^z配置IGRP路由协议:90秒更新一次router(config)# router igrp AS-Numberrouter(config-if)# network Network-Numberrouter(config-if)# ^z配置Novell IPX路由协议:Novell RIP 60秒更新一次router(config)# ipx routing [node address]router(config)# ipx maximum-paths Pathsrouter(config)# interface Type Portrouter(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] router(config-if)# ^z配置DDR:router(config)# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number]router(config)# interface bri 0router(config-if)# dialer-group Group-Numberrouter(config-if)# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number router(config-if)# ^z配置ISDN:router(config)# isdn swith-type Swith-Typerouter(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 ]router(config-if)# ^z配置标准ACL:router(config)# access-list Access-List-Number [ permit | deny ] source [ source-mask ]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 Portrouter(confin-if)# clock rate 64000router(config-if)# ^z配置PPP协议:router(config)# username Name password Set-Password-Hererouter(config)# interface Type Portrouter(config-if)# encapsulation ppprouter(config-if)# ppp outhentication [ chap | chap pap | pap chap | pap ]router(config-if)# ppp pap sent-username Name password Passwordrouter(config-if)# ^zPAP单向认证配置实例:验证方:router-server(config)# username Client password 12345router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication paprouter-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp pap sent-username Client password 12345router-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)# ^zCHAP双向认证配置实例:路由器A:routerA(config)# username routerB password 12345routerA(config)# interface serial 0routerA(config-if)# encapsulation ppprouterA(config-if)# ppp authentication chaprouterA(config-if)# ppp chap hostname routerArouterA(config-if)# ppp chap password 54321 routerA(config-if)# ^z路由器B:routerB(config)# username routerA password 54321routerB(config)# interface serial 1routerB(config-if)# encapsulation ppprouterB(config-if)# ppp authentication chaprouterB(config-if)# ppp chap hostname routerBrouterB(config-if)# ppp chap password 12345routerB(config-if)# ^zTelnet使用:routerA# terminal monitorrouterA# telnet IP-Address [ Router-Name ]routerB# [ exit | logout ]routerB# ++再按routerA# show sessionsrouterA# Connect-NumberrouterA# disconnect IP-Address [ Router-Name ]routerA# show userrouterA# clear line [ 0 | 1 | 2 | 3 | 4 ]禁止任何Telnet到本机:router(config)# line vty 0 4router(config-line)# access-class ACL-Numberrouter(config)# ^z设置主机名:router(config)# hostname Set-Hostnamerouter(config)# ^zrouter(config)# ^z设置用户模式密码:。
思科交换机路由器常规配置命令大全

思科交换机路由器常规配置命令大全你还在为不知道思科交换机路由器常规配置命令大全而烦恼么?接下来是小编为大家收集的思科交换机路由器常规配置命令大全教程,希望能帮到大家。
思科交换机路由器常规配置命令大全一、基本路由器的检验命令show versionshow processesshow protocolsshow memshow ip routeshow startup-configshow running-configshow flash>show interfaces二、基本路由配置命令进入:config terminal/memory/network 配置网络时常采用的命令:copy和load1.标识:hostname 标识名2.启动标识:banner 启动标识3.接口:interface 端口号4.密码:line 0 6loginpasswd 口令enable password/secret 口令5.接口:1)配置端口interface 端口号clock rate 时钟速率(64000)/* 在串口中配置*/ bandwidth 带宽(缺省56) /* 在串口中配置*/ media-type 介质类型/* 在以太网口上*/ early-token release /* 在令牌环网口上*/ ring-speed 16 /* 在令牌环网口上*/no shutdownwrite memory2)检验端口show interfacesshow controllers6. 配置环境1) 引导方式boot system flash IOS-filenameboot system tftp IOS-filename tftp-address boot system rom2) 配置Register值config-register 0x21027. 查看邻居路由show cdp interfaceshow cdp neighbors [detail]show cdp entry routerA8.IP Address 配置Ip address 网络地址掩码Ip host 主机名addressIp name-server 服务器地址1 服务器地址2 。
Cisco路由器配置基本命令

Cisco路由器配置基本命令特权模式:enableRouter1 # show running-configRouter1 # show ip routeRouter # show ip interface briefSwitch # show vlanSwitch # show ip interface配置模式:configure terminal1) console密码SW2(config)#line console 0SW2(config-line)#password ciscoSW2(config-line)#login //启⽤密码认证,默认没有,需要加上去SW2(config-line)#login local //本地开启⽤户认证SW2(config)username xiao password fan //创建本地⽤户SW2(config)username xiao privilege 15 password fan //以该⽤户登⼊设备后直接进⼊特权模式说明---对⽤户的权限定义0-15级,最⾼为15,任何命令都可操作SW2(config)service password-encryption //明⽂密码加密2)特权模式密码(设置全局密码)SW2>enadleSW2(config)#configure terminal1.(config)#enable password en cisco←密码encisco2.(config)#enable secret jmcisco←密码jmcisco #2个同时设,只有secret 有效,因为其优先极⾼(config)#login <--⼀定要加,表⽰启⽤全局密码设置完成exitenable password xiaofan 优先级低enable secret cisco 优先级⾼思科加密⽅式:0 显⽰的是密码本⾝7 密⽂加密,容易破解5 复杂密⽂加密3)虚拟通道密码SW2>enadleSW2(config)#configure terminalSW2(config)#line vty 0 4SW2(config-line)#password telnetciscoSW2(config-line)#login //默认就有SW2(config-line)#login local //开启本地⽤户认证,使⽤本地⽤户数据库SW2(config-line)no login //不需要密码就可登陆路由类(静态路由和动态路由)静态路由:ip route address subnet-mask address默认路由ip route 0.0.0.0 0.0.0.0 address动态路由:rip v2* Router1配置RIP协议Router(config)# router rip !开启RIP协议进程Router(config-router)# network 172.16.1.0 !申明本设备的直连⽹段Router(config-router)# network 172.16.2.0Router(config-router)# version 2Router(config-router)# no auto-summary !关闭路由信息的⾃动汇总功能* 三层交换机配置RIP协议Switch (config)# router rip !开启RIP协议进程Switch (config-router)# network 172.16.1.0 !申明本设备的直连⽹段Switch (config-router)# network 172.16.5.0Switch (config-router)# version 2vlan和trunk*三层交换机基本配置Switch# configure terminalSwitch (config)# vlan 10Switch (config-vlan)# exitSwitch (config)# vlan 50Switch (config-vlan)# exitSwitch (config)# interface f0/1Switch (config-if)# switchport access vlan 10Switch (config-if)# exitSwitch (config)# interface f0/5Switch (config-if)# switchport access vlan 50Switch (config-if)# exitSwitch (config)# interface vlan 10 !创建VLAN虚接⼝,并配置IPSwitch (config-if)# ip address 172.16.1.2255.255.255.0Switch (config-if)# no shutdownSwitch (config-if)# exitSwitch (config)# interface vlan 50 !创建VLAN虚接⼝,并配置IPSwitch (config-if)# no shutdownSwitch (config-if)# exittrunk在sw1、sw2之间使⽤sw1(config)#interface f0/0 进⼊要设置的端⼝(f0/0)sw1(config-if)#switchport mode trunk 将端⼝进⾏trunk设置sw1(config-if)#no shutdown 激活此端⼝访问控制(ACL)标准访问列表配置实例:R1(config)#access-list 10 deny 192.168.2.0 0.0.0.255R1(config)#access-list 10 permit anyR1(config)#int fa0/0.1R1(config-subif)#ip access-group 10 out扩展访问控制列表配置实例:R2(config)#access-list 110 deny tcp any host 192.168.1.12 eq wwwR2(config)#access-list 110 deny tcp any host 192.168.1.12 eq ftpR2(config)#int fa0/0R2(config-if)#ip access-group 110 out上⾯配置的含义是拒绝访问192.168.1.12的www和ftp服务access-list 101 permit tcp any 172.16.4.13 0.0.0.0 eq www //设置ACL101,容许源地址为任意IP,⽬的地址为172.16.4.13主机的80端⼝即WWW服务。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
思科中路由器的基础配置命令。
Cd 更改路径Cdp enable 允许接口运行CDP协议Clear 复位功能Clear counters 清除接口计数器Clear interface 重新启动接口上的件逻辑Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率Cmt 开启/关闭FDDI连接管理功能Config-register 修改配置寄存器设置Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息Configure memory 从NVRAM加载配置信息Configure terminal 从终端进行手动配置Connect 打开一个终端连接Copy 复制配置或映像数据Copy flash tftp 备份系统映像文件到TFTP服务器Copy running-config startup-config 将RAM中的当前配置存储到NVRAMCopy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上Copy tftp flash 从TFTP服务器上下载新映像到FlashCopy tftp running-config 从TFTP服务器上下载配置文件Debug 使用调试功能Debug dialer 显示接口在拨什么号及诸如此类的信息Debug ip rip 显示RIP路由选择更新数据Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程Debug ppp 显示在实施PPP中发生的业务和交换信息Delete 删除文件Deny 为一个已命名的IP ACL设置条件Dialer idle-timeout 规定线路断开前的空闲时间的长度Dialer map 设置一个串行接口来呼叫一个或多个地点Dialer wait-for-carrier-time 规定花多长时间等待一个载体Dialer-group 通过对属于一个特定拨号组的接口进行配置来访问控制Dialer-list protocol 定义一个数字数据接受器(DDR)拨号表以通过协议或ACL与协议的组合来控制控制拨号Dir 显示给定设备上的文件Disable 关闭特许模式Disconnect 断开已建立的连接Enable 打开特许模式Enable password 确定一个密码以防止对路由器非授权的访问Enable password 设置本地口令控制不同特权级别的访问Enable secret 为enable password命令定义额外一层安全性(强制安全,密码非明文显示) Encapsulation frame-relay 启动帧中继封装Encapsulation novell-ether 规定在网络段上使用的Novell独一无二的格式Encapsulation PPP 把PPP设置为由串口或ISDN接口使用的封装方法Encapsulation sap 规定在网络段上使用的以太网802.2格式Cisco的密码是sapEnd 退出配置模式Erase 删除闪存或配置缓存Erase startup-config 删除NVRAM中的内容Exec-timeout 配置EXEC命令解释器在检测到用户输入前所等待的时间Exit 退出所有配置模式或者关闭一个激活的终端会话和终止一个EXECExit 终止任何配置模式或关闭一个活动的对话和结束EXECformat 格式化设备Frame-relay local-dlci 为使用帧中继封装的串行线路启动本地管理接口(LMI)Help 获得交互式帮助系统History 查看历史记录Hostname 使用一个主机名来配置路由器,该主机名以提示符或者缺省文件名的方式使用Interface 设置接口类型并且输入接口配置模式Interface 配置接口类型和进入接口配置模式Interface serial 选择接口并且输入接口配置模式Ip access-group 控制对一个接口的访问Ip address 设定接口的网络逻辑地址Ip address 设置一个接口地址和子网掩码并开始IP处理Ip default-network 建立一条缺省路由Ip domain-lookup 允许路由器缺省使用DNSIp host 定义静态主机名到IP地址映射Ip name-server 指定至多6个进行名字-地址解析的服务器地址Ip route 建立一条静态路由Ip unnumbered 在为给一个接口分配一个明确的IP地址情况下,在串口上启动互联网协议(IP)的处理过程Ipx delay 设置点计数Ipx ipxwan 在串口上启动IPXW AN协议Ipx maximum-paths 当转发数据包时设置Cisco IOS软件使用的等价路径数量Ipx network 在一个特定接口上启动互联网数据包交换(IPX)的路由选择并且选择封装的类型(用帧封装)Ipx router 规定使用的路由选择协议Ipx routing 启动IPX路由选择Ipx sap-interval 在较慢的链路上设置较不频繁的SAP(业务广告协议)更新Ipx type-20-input-checks 限制对IPX20类数据包广播的传播的接受Isdn spid1 在路由器上规定已经由ISDN业务供应商为B1信道分配的业务简介号(SPID)Isdn spid2 在路由器上规定已经由ISDN业务供应商为B2信道分配的业务简介号(SPID)Isdntch-type 规定了在ISDN接口上的中央办公区的交换机的类型Keeplive 为使用帧中继封装的串行线路LMI(本地管理接口)机制Lat 打开LA T连接Line 确定一个特定的线路和开始线路配置Line concole 设置控制台端口线路Line vty 为远程控制台访问规定了一个虚拟终端Lock 锁住终端控制台Login 在终端会话登录过程中启动了密码检查Login 以某用户身份登录,登录时允许口令验证Logout 退出EXEC模式Mbranch 向下跟踪组播地址路由至终端Media-type 定义介质类型Metric holddown 把新的IGRP路由选择信息与正在使用的IGRP路由选择信息隔离一段时间Mrbranch 向上解析组播地址路由至枝端Mrinfo 从组播路由器上获取邻居和版本信息Mstat 对组播地址多次路由跟踪后显示统计数字Mtrace 由源向目标跟踪解析组播地址路径Name-connection 命名已存在的网络连接Ncia 开启/关闭NCIA服务器Network 把一个基于NIC的地址分配给一个与它直接相连的路由器把网络与一个IGRP的路由选择的过程联系起来在IPX路由器配置模式下,在网络上启动加强的IGRPNetwork 指定一个和路由器直接相连的网络地址段Network-number 对一个直接连接的网络进行规定No shutdown 打开一个关闭的接口Pad 开启一个X.29 PAD连接Permit 为一个已命名的IP ACL设置条件Ping 把ICMP响应请求的数据包发送网络上的另一个节点检查主机的可达性和网络的连通性对网络的基本连通性进行诊断Ping 发送回声请求,诊断基本的网络连通性Ppp 开始IETF点到点协议Ppp authentication 启动Challenge握手鉴权协议(CHAP)或者密码验证协议(PAP)或者将两者都启动,并且对在接口上选择的CHAP和PAP验证的顺序进行规定Ppp chap hostname 当用CHAP进行身份验证时,创建一批好像是同一台主机的拨号路由器Ppp chap password 设置一个密码,该密码被发送到对路由器进行身份验证的主机命令对进入路由器的用户名/密码的数量进行了限制Ppp pap sent-username 对一个接口启动远程PAP支持,并且在PAP对同等层请求数据包验证过程中使用sent-username和passwordProtocol 对一个IP路由选择协议进行定义,该协议可以是RIP,内部网关路由选择协议(IGRP),开放最短路径优先(OSPF),还可以是加强的IGRPPwd 显示当前设备名Reload 关闭并执行冷启动;重启操作系统Rlogin 打开一个活动的网络连接Router 由第一项定义的IP路由协议作为路由进程,例如:router rip 选择RIP作为路由协议Router igrp 启动一个IGRP的路由选择过程Router rip 选择RIP作为路由选择协议Rsh 执行一个远程命令Sdlc 发送SDLC测试帧Send 在tty线路上发送消息Service password-encryption 对口令进行加密Setup 运行Setup命令Show 显示运行系统信息Show access-lists 显示当前所有ACL的内容Show buffers 显示缓存器统计信息Show cdp entry 显示CDP表中所列相邻设备的信息Show cdp interface 显示打开的CDP接口信息Show cdp neighbors 显示CDP查找进程的结果Show dialer 显示为DDR(数字数据接受器)设置的串行接口的一般诊断信息Show flash 显示闪存的布局和内容信息Show frame-relay lmi 显示关于本地管理接口(LMI)的统计信息Show frame-relay map 显示关于连接的当前映射入口和信息Show frame-relay pvc 显示关于帧中继接口的永久虚电路(pvc)的统计信息Show hosts 显示主机名和地址的缓存列表Show interfaces 显示设置在路由器和访问服务器上所有接口的统计信息Show interfaces 显示路由器上配置的所有接口的状态Show interfaces serial 显示关于一个串口的信息Show ip interface 列出一个接口的IP信息和状态的小结Show ip interface 列出接口的状态和全局参数Show ip protocols 显示活动路由协议进程的参数和当前状态Show ip route 显示路由选择表的当前状态Show ip router 显示IP路由表信息Show ipx interface 显示Cisco IOS软件设置的IPX接口的状态以及每个接口中的参数Show ipx route 显示IPX路由选择表的内容Show ipx servers 显示IPX服务器列表Show ipx traffic 显示数据包的数量和类型Show isdn active 显示当前呼叫的信息,包括被叫号码、建立连接前所花费的时间、在呼叫期间使用的自动化操作控制(AOC)收费单元以及是否在呼叫期间和呼叫结束时提供AOC 信息Show isdn ststus 显示所有isdn接口的状态、或者一个特定的数字信号链路(DSL)的状态或者一个特定isdn接口的状态Show memory 显示路由器内存的大小,包括空闲内存的大小Show processes 显示路由器的进程Show protocols 显示设置的协议Show protocols 显示配置的协议。