A. 思科路由器设置方法和常见配置命令
思科路由器设置方法和常见配置命令
思科路由器怎么设置,是我们经常遇到的问题,下面我准备了关于思科路由器设置方法和常见配置命令,欢迎大家参考学习!
一、基本设置方式
一般来说,可以用5种方式来设置Cisco思科路由器:
1.Console口接终端或运行终端仿真软件的微机;
2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连;
3.通过Ethernet上的TFTP服务器;
4.通过Ethernet上的TELNET程序;
5.通过Ethernet上的SNMP网管工作站。
但Cisco思科路由器的第一次设置必须通过第一种方式进行,一般用超级终端通过com口进行控制。此时终端的硬件设置如下:
波特率 :9600
数据位 :8
停止位 :1
奇偶校验: 无
二、命令操作
Cisco思科路由器所用的操作系统是IOS.共有以下几种状态:
1、router>
在router>提示符下,Cisco思科路由器处于用户命令状态,这时用户可以看Cisco思科路由器的连接状态,访问其它网络和主机,但不能看到和更改Cisco思科路由器的设置内容。此时输入?并回车,可以查看到在此状态下可以用的命令。(IOS允许你在任何时候用这种方式查看在某种状态下可以用的命令)。在敲入enable并回车后,按照系统提示输入密码,(在新的Cisco思科路由器第一次进行调试的时候不需要输入密码,直接回车即可)进入#提示符,就可以对Cisco思科路由器进行各种操作了。
2、router#
Cisco思科路由器进入特权命令状态router#后,不但可以执行所有的用户命令,还可以看到和更改Cisco思科路由器的设置内容。此时就可以对Cisco思科路由器的名字、密码等进行设置。
3、router(config)#
在router#提示符下键入configure terminal,出现提示符router(config)#,此时Cisco思科路由器处于全局设置状态,这时可以设置Cisco思科路由器的全局参数。
4、router(config-if)#;
router(config-line)#;
router(config-router)#;…
Cisco思科路由器处于局部设置状态,这时可以设置Cisco思科路由器某个局部的参数。
5、Cisco思科路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时Cisco思科路由器不能完成正常的功能,只能进行软件升级和手工引导。在此状态下,可以进行口令恢复。
三、常用命令
1.帮助
在IOS操作中,无论任何状态和位置,都可以键入“?”得到系统的帮助。系统会显示此时可以使用的命令。
2.改变命令状态
任务命令
进入特权命令状态enable
退出特权命令状态disable
进入设置对话状态Setup
进入全局设置状态config terminal
退出全局设置状态End
进入端口设置状态interface type slot/number
进入子端口设置状态interface type number.subinterface [point-to-point | multipoint]
进入线路设置状态line type slot/number
进入路由设置状态router protocol
退出局部设置状态Exit
3.显示命令
任务命令
查看版本及引导信息show version
查看运行设置show running-config
查看开机设置show startup-config
显示端口信息show interface type slot/number
显示路由信息show ip router
4.拷贝命令
用于IOS及CONFIG的备份和升级
5.网络命令
任务命令
登录远程主机telnet hostname|IP address
网络侦测ping hostname|IP address
路由跟踪Trace hostname|IP address
6.基本设置命令
任务命令
全局设置config terminal
设置访问用户及密码username username password password
设置特权密码enable secret password
设置Cisco思科路由器名hostname name
设置静态路由ip route destination subnet-mask next-hop
启动IP路由ip routing
启动IPX路由Ipx routing
端口设置interface type slot/number
设置IP地址ip address address subnet-mask
设置IPX网络Ipx network network
激活端口no shutdown
物理线路设置line type number
启动登录进程login [local|tacacs server]
设置登录密码password password
本文描述了如何进行思科路由器的基本设置,基本的命令操作以及常用命令进行操作和总体的.设置,并讲述了一些基本的服务设置。
四、总体设置
在router#特权命令状态下,可以用setup对Cisco思科路由器进行总体设计,利用这个设计过程可以省略手工设置的烦琐。但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。
进入设置对话过程后,Cisco思科路由器首先会显示一些提示信息:
--- System Configuration Dialog ---
At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[]'.
这是告诉你在设置对话过程中的任何地方都可以键入“?”得到系统的帮助,按ctrl-c可以退出设置过程,缺省设置将显示在‘[]’中。然后Cisco思科路由器会问是否进入设置对话:
Would you like to enter the initial configuration dialog? [yes]:
如果按y或回车,Cisco思科路由器就会进入设置对话过程。首先你可以看到各端口当前的状况:
First, would you like to see the current interface summary? [yes]:
Any interface listed with OK? value "NO" does not have a valid configuration
InterfaceIP-AddressOK?MethodStatusProtocol
Serial0unassignedNOunsetupup
……………………………
然后,Cisco思科路由器就开始全局参数的设置:
Configuring global parameters:
1.设置Cisco思科路由器名:
Enter host name [Router]:
2.设置进入特权状态的密文(secret),此密文在设置以后不会以明文方式显示:
The enable secret is a one-way cryptographic secret used
instead of the enable password when it exists.
Enter enable secret: cisco
3.设置进入特权状态的密码(password),此密码只在没有密文时起作用,并且在设置以后会以明文方式显示:
The enable password is used when there is no enable secret
and when using older software and some boot images.
Enter enable password: pass
4.设置虚拟终端访问时的密码:
Enter virtual terminal password: cisco
5.询问是否要设置Cisco思科路由器支持的各种网络协议:
Configure SNMP Network Management? [yes]:
Configure DECnet? [no]:
Configure AppleTalk? [no]:
Configure IPX? [no]:
Configure IP? [yes]:
Configure IGRP routing? [yes]:
Configure RIP routing? [no]:
………
6.如果配置的是拨号访问服务器,系统还会设置异步口的参数:
Configure Async lines? [yes]:]
1)设置线路的最高速度:
Async line speed [9600]:
2)是否使用硬件流控:
Configure for HW flow control? [yes]:
3)是否设置modem:
Configure for modems? [yes/no]: yes
4)是否使用默认的modem命令:
Configure for default chat script? [yes]:
5)是否设置异步口的PPP参数:
Configure for Dial-in IP SLIP/PPP access? [no]: yes
6)是否使用动态IP地址:
Configure for Dynamic IP addresses? [yes]:
7)是否使用缺省IP地址:
Configure Default IP addresses? [no]: yes
是否使用TCP头压缩:
Configure for TCP Header Compression? [yes]:
9)是否在异步口上使用路由表更新:
Configure for routing updates on async links? [no]: y
10)是否设置异步口上的其它协议。接下来,系统会对每个接口进行参数的设置。
1.Configuring interface Ethernet0:
1)是否使用此接口:
Is this interface in use? [yes]:
2)是否设置此接口的IP参数:
Configure IP on this interface? [yes]:
3)设置接口的IP地址:
IP address for this interface: 192.168.162.2
4)设置接口的IP子网掩码:
Number of bits in subnet field [0]:
Class C network is 192.168.162.0, 0 subnet bits; mask is /24
在设置完所有接口的参数后,系统会把整个设置对话过程的结果显示出来:
The following configuration command script was created:
hostname Router
enable secret 5 $W5Oh$p6J7tIgRMBOIKVXVG53Uh1
enable password pass
…………
请注意在enable secret后面显示的是乱码,而enable password后面显示的是设置的内容。就是说,secret密码的优先级比较高,在两个密码都设了的情况下,secret密码起作用。
显示结束后,系统会问是否使用这个设置:
Use this configuration? [yes/no]: yes
如果回答yes,系统就会把设置的结果存入Cisco思科路由器的NVRAM中,然后结束设置对话过程,使Cisco思科路由器开始正常的工作。
五、广域网协议设置
PPP
PPP(Point-to-Point Protocol)是SLIP(Serial Line IP protocol)的继承者,它提供了跨过同步和异步电路实现Cisco思科路由器到Cisco思科路由器(router-to-router)和主机到网络(host-to-network)的连接。
CHAP(Challenge Handshake Authentication Protocol)和PAP(Password Authentication Protocol) (PAP)通常被用于在PPP封装的串行线路上提供安全性认证。使用CHAP和PAP认证,每个Cisco思科路由器通过名字来识别,可以防止未经授权的访问。
任务命令
设置PPP封装encapsulation ppp1
设置认证方法ppp authentication {chap | chap pap | pap chap | pap} [if-needed] [list-name | default] [callin]
指定口令username name password secret
设置DCE端线路速度clockrate speed
;B. 静态路由的配置命令
静态路由的配置:带下一跳路由器的静态路由和带送出接口的静态路由。
在接口模式下配置该接口的IP地址(配置该接口的IP地址为192.168.1.1/24):Router(config-if)#ip add 192.168.1.1 255.255.255.0
在路由器的全局配置模式下配置静态路由(配置非直连网段192.168.10.0/24,下一跳IP为192.168.1.2):Router(config)#ip route 192.168.10.0 255.255.255.0 192.168.2
优点
使用静态路由的另一个好处是网络安全保密性高。动态路由因为需要路由器之间频繁地交换各自的路由表,而对路由表的分析可以揭示网络的拓扑结构和网络地址等信息。因此,网络出于安全方面的考虑也可以采用静态路由。不占用网络带宽,因为静态路由不会产生更新流量。静态路由适用于中小型网络。
以上内容参考:网络-静态路由
C. 静态路由配置命令
配置静态路由有两种方式:带有下一跳路由器的静态路由和带有送出接口的静态路由。
这些命令如下所示:
1.以下一跳路由器为例
A(config)# IP route 192 . 168 . 3 . 0 255 . 255 . 255 . 0 f 0/1(目标网段的IP地址,目的子网掩码送出接口(路由器A))。
2、带发送接口
a(config)# ip route 192 . 168 . 3 . 0 255 . 255 . 0 192 . 168 . 2 . 2(目标子网掩码下的下一个路由器接口的目标网段IP地址)。
扩展信息:
静态路由命令的优势:
使用静态路由的优点是网络的高安全性和保密性。对路由表的分析可以揭示网络拓扑和网络地址。因此,出于安全考虑,网络也可以采用静态路由。不占用网络带宽,因为静态路由不会产生更新流量。
静态路由命令的缺点:
大型复杂的网络环境通常不适合静态路由。一方面,网络管理员很难完全了解整个网络的拓扑结构。另一方面,当网络的拓扑结构和链路状态发生变化时,路由器中的静态路由信息需要进行大范围的调整,这是非常困难和复杂的。
来源:网络:静态路由
密切注意
在路由器的全局配置模式下进入F0/0接口配置模式:Router(config)#int f0/0
在接口模式下配置该接口的IP地址(该接口的IP地址为192.168.1.1/24):路由器(config-if)# IP add 192 . 168 . 1 . 1 255 . 255 . 0
在路由器全局配置模式下配置静态路由(配置非直接网段192.168.10.0/24,下一跳IP为192.168.1.2):路由器(config)# IP route 192 . 168 . 10 . 0 255 . 255 . 255 . 0 192.0。
扩展信息:
Ip-address和mask是目标Ip地址和掩码,采用点分十进制格式。由于掩码的32位中的“1”必须是连续的,所以点分十进制格式掩码可以由掩码长度mask-length代替,mask-length是掩码中连续“1”位的数量。
Interface-name指定该路由的发送接口名称,gateway-address是该路由的下一跳IP地址(点分十进制格式)。Preference-value是该路由的优先级,范围从0到255。拒绝表示为不可到达的路由。黑洞表示黑洞路线。
默认情况下,系统可以获得连接到路由器的子网的子网路由。如果在配置静态路由时没有指定优先级,默认值为60。如果未指明拒绝或黑洞,则默认为可达路由。
配置静态路由的注意事项:
当目的IP地址和掩码都为0.0.0.0时,配置默认路由,即路由表查找失败时,按照默认路由转发数据包。
对于优先级的不同配置,可以灵活应用路由管理策略,比如配置多条路由到同一个目的地,如果指定相同的优先级,可以实现负载分担;如果指定不同的优先级,可以实现路由备份。
配置静态路由时,您可以指定发送接口或下一跳地址。具体采用哪种方式要看实际情况:对于支持网络地址到链路层地址解析的接口或者点对点接口,只需指定发送接口即可;对于NBMA接口,如封装X.25或帧中继的接口、拨号端口等。支持点对多点。此时,除了配置ip路由外,还需要在链路层建立一条二级路由,即ip地址到链路层地址的映射(如拨号器映射ip、x.25映射IP或帧中继映射IP等。).什么情况?静态路由配置无法指定发送接口,但应配置下一跳IP地址。
https://iknow-pic . cdn . BCE Bos . com/78310 a 55 b 319 ebc 418 be 03d 78 f 26 cffc 1 f 1716 BD?x-BCE-process = image % 2f resize % 2Cm _ lfit % 2Cw _ 600% 2Ch _ 800% 2c limit _ 1% 2f quality % 2Cq _ 85% 2f format % 2Cf _ auto
D. 思科路由器基础配置命令
基础配置命令如下
一、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配置成版本2
2.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进程id
2.router(config)#interface loopback0
router(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的优先级150
3.router(config-if)#standby 47 preempt 配置HSRP的占先权
4.router(config-if)#standby 47 ip time 2 9 2表示HELLO时间,9表示保持时间
5.router(config)#interface s0
6.router(config-if)#standby 47 track s0 100配置跟踪端口s0并在端口down时减少100
7.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.255
router(config)#access-list 1 premit host 172.30.16.29 ;host表示0.0.0.0
4.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 s0
Router(config-if)#ip address 61.159.62.129 255.255.255.248
2.配置内部端口的IP地址
Router(config)#interface e0
Router(config-if)#ip address 192.168.100.1 255.255.255.0
3.静态地址转换
Router(config)#ip nat inside source static 192.168.100.2 61.159.62.130
4.在内部和外部端口上启用NAT
Router(config)#interafce s0
Router(config-if)#ip nat outside
Router(config)#interafce e0
Router(config-if)#ip nat inside
七、动态NAT配置1.配置外部端口的IP地址
Router(config)#interface s0
Router(config-if)#ip address 61.159.62.129 255.255.255.248
2.配置内部端口的IP地址
Router(config)#interface e0
Router(config-if)#ip address 192.168.100.1 255.255.255.0
3.定义内部网络允许访问外部网络
Router(config)#access-list 1 permit 192.168.100.0 0.0.0.255
4.定义合法的IP地址池
Router(config)#ip nat pool chen 61.159.62.129 61.159.62.190 netmask 255.255.255.248
5.实现网络地址转换
Router(config)#ip nat inside source list 1 pool chen
6.在内部和外部端口上启用NAT
Router(config)#interafce s0
Router(config-if)#ip nat outside
Router(config)#interafce e0
Router(config-if)#ip nat inside
八、PAT的配置1.配置外部端口的IP地址
Router(config)#interface s0
Router(config-if)#ip address 61.159.62.129 255.255.255.248
2.配置内部端口的IP地址
Router(config)#interface e0
Router(config-if)#ip address 192.168.100.1 255.255.255.0
3.定义内部网络允许访问外部网络
Router(config)#access-list 1 permit 192.168.100.0 0.0.0.255
4.定义合法的IP地址池
Router(config)#ip nat pool chen 61.159.62.129 61.159.62.190 netmask 255.255.255.248
5.实现复用IP地址转换
Router(config)#ip nat inside source list 1 pool chen overload
6.在内部和外部端口上启用NAT
Router(config)#interafce s0
Router(config-if)#ip nat outside
Router(config)#interafce e0
Router(config-if)#ip nat inside
E. 华为路由器IP性能配置命令
华为路由器IP性能配置命令
H3C CAS云计算管理平台融合了华三通信在网络安全领域的积累,通过对IEEE 802.1Qbg(EVB)标准的支持,为虚拟机在安全、可视、可监管的环境下运行奠定了基础。下面是我整理的华为路由器IP性能配置命令,希望大家认真阅读!
clear ip counters
清除IP统计信息。
clear ip counters
【命令模式】
特权用户模式
【使用指南】
在某些特殊情况下,需要清除IP统计信息,重新进行统计。
【举例】
清除IP统计信息。
Quidway#clear ip counters
【相关命令】
show ip interface,show ip traffic
4.5.2 ifquelen ip
配置IP接收队列长度。
ifquelen ip queue-length
【参数说明】
queue-length为接口队列长度。
【命令模式】
全局配置模式
【使用指南】
配置IP接收队列长度,会影响系统运行效率,最好在技术支持人员的指导下进行。
【举例】
配置IP的接收队列为70。
Quidway(config)#ifquelen ip 70
【相关命令】
show ip interface
4.5.3 ifquelen arp
配置ARP接收队列长度。
ifquelen arp queue-length
【参数说明】
queue-length为接口队列长度。
【命令模式】
全局配置模式
【使用指南】
配置ARP接收队列长度,可能会影响到以太网口运行效率,最好在技术支持人员的指导下配置。
【举例】
配置ARP的接收队列长度为70。
Quidway(config)#ifquelen arp 70
【相关命令】
show ip interface
4.5.4 ip tcp header-compression
允许或禁止接口上TC 文头压缩。
[ no ] ip tcp header-compression
【缺省情况】
接口上缺省为禁止TCP报文头压缩。
【命令模式】
接口配置模式
【使用指南】
在低速广域网线路上运行PPP协议时,由于TCP报文头占全部传输数据的很大比例,这时可以对TCP报文头压缩以提高数据传输效率。
【举例】
在PPP接口Serial0上允许TCP报文头压缩。
Quidway(config-if-Serial0)#ip tcp header-compression
【相关命令】
encapsulation ppp
4.5.5 show ip cache
显示IP路由缓冲。
show ip cache
【命令模式】
特权用户模式
【使用指南】
显示IP最近使用过的'路由,帮助用户进行故障诊断。
【举例】
Quidway#show ip cache
Route to destination 129.102.100.141:
Destination NetMask Type Interface GateWay
129.102.100.141 255.255.255.255 direct Ethernet0
上面显示信息表示最近刚使用过的路由是到达129.102.100.141的路由。该路由是一条直接路由,输出接口为Ethernet0。
【相关命令】
ip route
4.5.6 show ip interface
显示IP接口信息。
show ip interface [ interface-type interface-number ]
【参数说明】
interface-type为接口类型。
interface-number为接口编号。
【缺省情况】
如果不指定接口,则缺省显示全部IP接口信息。
【命令模式】
特权用户模式
【使用指南】
该命令输出接口上全部与IP有关的信息,有助于故障诊断。
【举例】
Quidway#show ip interface serial 0
Interface is Serial0, Index is 2
ifFlags=8004 $#@60;NBMA,MULTICAST$#@62;
protocol is x25 dte ietf, MTU is 1500, speed is 64000 bps
input queue is 0/75/0 (current/max/drops)
output queue is 0/75/0 (current/max/drops)
0 packets input, 0 bytes, 0 multicasts
0 input packets dropped, 0 no protocols, 0 input errors
0 packets output, 0 bytes, 0 multicasts, 0 output errors
上面显示信息表示接口Serial0 编号为2;处于NBMA模式,支持组播;该接口封装的链路层协议是X.25协议,最大传输单元是1500字节,传输速率为64000bps。再以下的信息主要反映了该接口报文的收发情况,比如说接收和发送队列的最大长度、当前队列中报文数和由于队列满而丢弃报文数,接收和发送的报文数,接收和发送的组播报文数,不能识别的报文数等等。
【相关命令】
show interface
4.5.7 show ip traffic
显示IP流量统计信息。
show ip traffic
【命令模式】
特权用户模式
【使用指南】
该命令显示IP收发和拆包、组包的统计信息,有助于故障诊断。
【举例】
Quidway#show ip traffic
IP statistics:
Rcvd: 1370 total, 1349 local destination
0 format errors, 0 checksum errors
0 unknown protocol, 0 bad options
Frags: 0 fragment rcvd, 0 fragment dropped
0 reassembled, 0 timeouts
0 fragmented, 0 couldnt fragment, 0 fragment sent
Sent: 359 generated, 0 forwarded, 0 raw ip packets
0 dropped, 0 no route, 0 Compress fails
ICMP statistics:
Rcvd: 0 format errors, 0 checksum errors
0 redirects, 0 unreachable, 14 echo, 0 echo reply
0 mask requests, 0 mask replies, 0 quench
0 parameter, 0 timestamp, 0 info request
Sent: 0 redirects, 0 unreachable, 0 echo, 14 echo reply
0 mask requests, 0 mask replies, 0 quench
0 parameter problem, 0 timestamp, 0 info reply
以上显示信息包括:
IP 统计信息:
接收:接收到1664 个报文,其中1638 个报文送给上层协议,没有报文格式错,没有报文校验错,没有未知协议报文,没有报文选项错。
分片:没有收到分片,没有丢弃分片,重装成功的分片数为0,超时分片为数为0;分组成功的报文数为0,不能被分组的报文数为0,被创建发送分片数为0。
发送:产生报文470 个,被转发报文数为0,产生原始IP报文数为0,被丢弃报文数为0,无法路由的报文的报文数为0,压缩失败的报文数为0。
ICMP统计信息:
接收:接收到格式错报文数为0,校验字错报文数为0,重定向报文数为0,不可达报文数为0,echo请求报文16个, echo应答报文数为0,掩码请求报文数为0,掩码应答报文数为0,源站抑制报文数为0,参数错报文数为0,时间戳请求报文数为0,信息请求报文数为0。
发送:发送重定向报文数为0,目的站不可达报文数为0,echo请求报文数为0,echo应答报文16 个,掩码请求报文数为0,掩码应答报文数为0,源站抑制报文数为0,参数错报文数为0,时间戳请求报文数为0,信息应答报文数为0。
【相关命令】
show interface,show ip interface,clear ip counters
4.5.8 show tcp brief
显示TCP连接状态。
show tcp brief
【命令模式】
特权用户模式
【使用指南】
该命令显示全部TCP连接状态,使用户随时监控TCP连接。
【举例】
Quidway#show tcp brief
LocalAddress LocalPort ForeignAddress ForeignPort State
129.102.100.142 23 129.102.001.092 1038 ESTABLISHED
000.000.000.000 23 000.000.000.000 0 LISTEN
以上显示信息表示:一个TCP连接已经建立,该TCP连接的本地IP地址为129.102.100.142,本地端口号为23,远地IP地址为129.102.1.92,远地端口号为1038,另外本地有一个对23号端口监听的服务器。
【相关命令】
show client
4.5.9 tcp finwait-time
配置TCP finwait定时器。
tcp finwait-time time-value
【参数说明】
time-value为TCP finwait定时器值,单位秒,范围76~3600。
【缺省情况】
TCP finwait定时器缺省为675秒。
【命令模式】
全局配置模式
【使用指南】
当TCP的连接状态由FIN_WATI_1变为FIN_WAIT_2时启动finwait定时器。若finwait定时器超时前仍未收到FIN报文,则TCP连接被终止。
对该参数的配置最好在技术支持人员的指导下进行。
【举例】
配置TCP finwait定时器的值为675秒。
Quidway(config)#tcp finwait-time 675
【相关命令】
tcp synwait-time,tcp window-size
4.5.10 tcp synwait-time
配置TCP synwait定时器。
tcp synwait-time time-value
【参数说明】
time-value为TCP synwait 定时器值,单位秒,范围2~600。
【缺省情况】
TCP synwait定时器缺省值为75秒。
【命令模式】
全局配置模式
【使用指南】
当发送syn报文时,TCP启动synwait定时器,若synwait超时前未收到回应报文,则TCP连接将被终止。
对该参数的配置最好在技术支持人员的指导下进行。
【举例】
配置TCP synwait定时器为75秒。
Quidway(config)#tcp synwait-time 75
【相关命令】
tcp finwait-time,tcp window-size
4.5.11 tcp window-size
配置面向连接Socket的收发缓冲区大小。
tcp window-size window-size
【参数说明】
window-size为面向连接Socket的收发缓冲区大小,单位K字节,范围1~32。
【缺省情况】
面向连接Socket的收发缓冲区大小缺省为4K字节。
【命令模式】
全局配置模式
【使用指南】
对该参数的配置最好在技术支持人员的指导下进行。
【举例】
配置面向连接Socket的收发缓冲区大小为4K字节。
Quidway(config)#tcp window-size 4
【相关命令】
tcp finwait-time,tcp synwait-time
;
F. 华为路由器配置命令
学习华为交换机,就要记得配置基本命令,下面yjbys为大家分享的是华为路由器基本配置命令,希望对大家学习华为有所帮助!
一、计算机命令
PCAlogin:root;使用root用户
password:linux;口令是linux
#shutdown-hnow;关机
#init0;关机
#logout;用户注销
#login;用户登录
#ifconfig;显示IP地址
#ifconfigeth0netmask;设置IP地址
#ifconfigeht0netmaskdown;禁用IP地址
#routeadd0.0.0.0gw;设置网关
#routedel0.0.0.0gw;删除网关
#routeadddefaultgw;设置网关
#routedeldefaultgw;删除网关
#route;显示网关
#ping;发ECHO包
#telnet;远程登录
二、华为路由器交换机配置命令:交换机命令
[Quidway]discur;显示当前配置
[Quidway]displaycurrent-configuration;显示当前配置
[Quidway]displayinterfaces;显示接口信息
[Quidway]displayvlanall;显示路由信息
[Quidway]displayversion;显示版本信息
[Quidway]superpassword;修改特权用户密码
[Quidway]sysname;交换机命名
[Quidway]interfaceethernet0/1;进入接口视图
[Quidway]interfacevlanx;进入接口视图
[Quidway-Vlan-interfacex]ipaddress10.65.1.1255.255.0.0;配置VLAN的IP地址
[Quidway]iproute-static0.0.0.00.0.0.010.65.1.2;静态路由=网关
[Quidway]rip;三层交换支持
[Quidway]local-userftp
[Quidway]user-interfacevty04;进入虚拟终端
[S3026-ui-vty0-4]authentication-modepassword;设置口令模式
[S3026-ui-vty0-4]setauthentication-modepasswordsimple222;设置口令
[S3026-ui-vty0-4]userprivilegelevel3;用户级别
[Quidway]interfaceethernet0/1;进入端口模式
[Quidway]inte0/1;进入端口模式
[Quidway-Ethernet0/1]plex{half|full|auto};配置端口工作状态
[Quidway-Ethernet0/1]speed{10|100|auto};配置端口工作速率
[Quidway-Ethernet0/1]flow-control;配置端口流控
[Quidway-Ethernet0/1]mdi{across|auto|normal};配置端口平接扭接
[Quidway-Ethernet0/1]portlink-type{trunk|access|hybrid};设置端口工作模式
[Quidway-Ethernet0/1]portaccessvlan3;当前端口加入到VLAN
[Quidway-Ethernet0/2]porttrunkpermitvlan{ID|All};设trunk允许的VLAN
[Quidway-Ethernet0/3]porttrunkpvidvlan3;设置trunk端口的PVID
[Quidway-Ethernet0/1]undoshutdown;激活端口
[Quidway-Ethernet0/1]shutdown;关闭端口
[Quidway-Ethernet0/1]quit;返回
[Quidway]vlan3;创建VLAN
[Quidway-vlan3]portethernet0/1;在VLAN中增加端口
[Quidway-vlan3]porte0/1;简写方式
[Quidway-vlan3]portethernet0/1toethernet0/4;在VLAN中增加端口
[Quidway-vlan3]porte0/1toe0/4;简写方式
[Quidway]monitor-port;指定镜像端口
[Quidway]portmirror;指定被镜像端口
[Quidway]portmirrorint_listobserving-portint_typeint_num;指定镜像和被镜像
[Quidway]descriptionstring;指定VLAN描述字符
[Quidway]description;删除VLAN描述字符
[Quidway]displayvlan[vlan_id];查看VLAN设置
[Quidway]stp{enable|disable};设置生成树,默认关闭
[Quidway]stppriority4096;设置交换机的优先级
[Quidway]stproot{primary|secondary};设置为根或根的备份
[Quidway-Ethernet0/1]stpcost200;设置交换机端口的花费
[Quidway]link-aggregatione0/1toe0/4ingress|both;端口的聚合
[Quidway]undolink-aggregatione0/1|all;始端口为通道号
[SwitchA-vlanx]isolate-user-vlanenable;设置主vlan
[SwitchA]isolate-user-vlansecondary;设置主vlan包括的子vlan
[Quidway-Ethernet0/2]porthybridpvidvlan;设置vlan的pvid
[Quidway-Ethernet0/2]porthybridpvid;删除vlan的pvid
[Quidway-Ethernet0/2]porthybridvlanvlan_id_listuntagged;设置无标识的vlan
如果包的vlanid与PVId一致,则去掉vlan信息.默认PVID=1。
所以设置PVID为所属vlanid,设置可以互通的'vlan为untagged.
三、华为路由器交换机配置命令:路由器命令
[Quidway]displayversion;显示版本信息
[Quidway]displaycurrent-configuration;显示当前配置
[Quidway]displayinterfaces;显示接口信息
[Quidway]displayiproute;显示路由信息
[Quidway]sysnameaabbcc;更改主机名
[Quidway]superpasswrod123456;设置口令
[Quidway]interfaceserial0;进入接口
[Quidway-serial0]ipaddress;配置端口IP地址
[Quidway-serial0]undoshutdown;激活端口
[Quidway]link-protocolhdlc;绑定hdlc协议
[Quidway]user-interfacevty04
[Quidway-ui-vty0-4]authentication-modepassword
[Quidway-ui-vty0-4]setauthentication-modepasswordsimple222
[Quidway-ui-vty0-4]userprivilegelevel3
G. 路由配置命令
只有CISCO路由器的命令
路由器显示命令:
router#show run ;显示配置信息
router#show interface ;显示接口信息
router#show ip route ;显示路由信息
router#show cdp nei ;显示邻居信息
router#reload ;重新起动
路由器口令设置:
router>enable ;进入特权模式
router#config terminal ;进入全局配置模式
router(config)#hostname ;设置交换机的主机名
router(config)#enable secret xxx ;设置特权加密口令
router(config)#enable password xxb ;设置特权非密口令
router(config)#line console 0 ;进入控制台口
router(config-line)#line vty 0 4 ;进入虚拟终端
router(config-line)#login ;要求口令验证
router(config-line)#password xx ;设置登录口令xx
router(config)#(Ctrl+z) ; 返回特权模式
router#exit ;返回命令
路由器配置:
router(config)#int s0/0 ;进入Serail接口
router(config-if)#no shutdown ;激活当前接口
router(config-if)#clock rate 64000 ;设置同步时钟
router(config-if)#ip address ;设置IP地址
router(config-if)#ip address second ;设置第二个IP
router(config-if)#int f0/0.1 ;进入子接口
router(config-subif.1)#ip address ;设置子接口IP
router(config-subif.1)#encapsulation dot1q ;绑定vlan中继协议
router(config)#config-register 0x2142 ;跳过配置文件
router(config)#config-register 0x2102 ;正常使用配置文件
router#reload ;重新引导
路由器文件操作:
router# running-config startup-config ;保存配置
router# running-config tftp ;保存配置到tftp
router# startup-config tftp ;开机配置存到tftp
router# tftp flash: ;下传文件到flash
router# tftp startup-config;下载配置文件
ROM状态:
Ctrl+Break ;进入ROM监控状态
rommon>confreg 0x2142 ;跳过配置文件
rommon>confreg 0x2102 ;恢复配置文件
rommon>reset ;重新引导
rommon> xmodem: flash: ;从console传输文件
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 ;从tftp下载
rommon>dir flash: ;查看闪存内容
rommon>boot ;引导IOS
静态路由:
ip route ;命令格式
router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例
动态路由:
router(config)#ip routing ;启动路由转发
router(config)#router rip ;启动RIP路由协议。
router(config-router)#network ;设置发布路由
router(config-router)#negihbor ;点对点帧中继用。
帧中继命令:
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 ;设置为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-changes ;记录邻接变化
router(config)#int s0/0.1 point-to-point ;设置子接口点对点
router#show frame. pvc ;显示永久虚电路
router#show frame. map ;显示映射
基本访问控制列表:
router(config)#access-list permit|deny
router(config)#interface ;default:deny any
router(config-if)#ip access-group in|out ;default:out
例1:
router(config)#access-list 4 permit 10.8.1.1
router(config)#access-list 4 deny 10.8.1.0 0.0.0.255
router(config)#access-list 4 permit 10.8.0.0 0.0.255.255
router(config)#access-list 4 deny 10.0.0.0 0.255.255.255
router(config)#access-list 4 permit any
router(config)#int f0/0
router(config-if)#ip access-group 4 in
扩展访问控制列表:
access-list permit|deny icmp <DESTINATIONIP
wild>[type]
access-list permit|deny tcp <DESTINATIONIP
wild>[port]
例3:
router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
router(config)#access-list 101 permit ip any any
router(config)#int s0/0
router(config-if)#ip access-group 101 in
例3:
router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
router(config)#access-list 102 permit ip any any
router(config)#interface s0/1
router(config-if)#ip access-group 102 out
删除访问控制例表:
router(config)#no access-list 102
router(config-if)#no ip access-group 101 in
路由器的nat配置
Router(config-if)#ip nat inside ;当前接口指定为内部接口
Router(config-if)#ip nat outside ;当前接口指定为外部接口
Router(config)#ip nat inside source static [p] <私有IP><公网IP> [port]
Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1
Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80
Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0
Router(config)#ip nat inside source list 1 pool p1
Router(config)#ip nat inside destination list 2 pool p2
Router(config)#ip nat inside source list 2 interface s0/0 overload
Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary
Router#show ip nat translation
rotary 参数是轮流的意思,地址池中的IP轮流与NAT分配的地址匹配。
overload参数用于PAT 将内部IP映射到一个公网IP不同的端口上。
外部网关协议配置:
routerA(config)#router bgp 100
routerA(config-router)#network 19.0.0.0
routerA(config-router)#neighbor 8.1.1.2 remote-as 200
配置PPP验证:
RouterA(config)#username password
RouterA(config)#int s0
RouterA(config-if)#ppp authentication {chap|pap}
3.PIX防火墙命令
Pix525(config)#nameif ethernet0 outside security0 ;命名接口和级别
Pix525(config)#interface ethernet0 auto ;设置接口方式
Pix525(config)#interface ethernet1 100full ;设置接口方式
Pix525(config)#interface ethernet1 100full shutdown
Pix525(config)#ip address inside 192.168.0.1 255.255.255.0
Pix525(config)#ip address outside 133.0.0.1 255.255.255.252
Pix525(config)#global (if_name) natid ip-ip ;定义公网IP区间
Pix525(config)#global (outside) 1 7.0.0.1-7.0.0.15 ;例句
Pix525(config)#global (outside) 1 133.0.0.1 ;例句
Pix525(config)#no global (outside) 1 133.0.0.1 ;去掉设置
Pix525(config)#nat (if_name) nat_id local_ip [netmark]
Pix525(config)#nat (inside) 1 0 0
内网所有主机(0代表0.0.0.0)可以访问global 1指定的外网。
Pix525(config)#nat (inside) 1 172.16.5.0 255.255.0.0
内网172.16.5.0/16网段的主机可以访问global 1指定的外网。
Pix525(config)#route if_name 0 0 gateway_ip [metric] ;命令格式
Pix525(config)#route outside 0 0 133.0.0.1 1 ;例句
Pix525(config)#route inside 10.1.0.0 255.255.0.0 10.8.0.1 1 ;例句
Pix525(config)#static (inside, outside) 133.0.0.1 192.168.0.8
表示内部ip地址192.168.0.8,访问外部时被翻译成133.0.0.1全局地址。
Pix525(config)#static (dmz, outside) 133.0.0.1 172.16.0.8
中间区域ip地址172.16.0.8,访问外部时被翻译成133.0.0.1全局地址
H. Cisco路由器配置命令
Cisco路由器配置命令大全
为方便考生复习思科路由器的配置,以下是我为大家整理的Cisco路由器配置命令,欢迎阅读与收藏。
1. switch配置命令
(1)模式转换命令
用户模式----特权模式, 使用命令"enable"
特权模式----全局配置模式, 使用命令"config t"
全局配置模式----接口模式, 使用命令"interface+接口类型+接口号"
全局配置模式----线控模式, 使用命令"line+接口类型+接口号"
注:
用户模式:查看初始化的信息.
特权模式:查看所有信息、调试、保存配置信息
全局模式:配置所有信息、针对整个路由器或交换机的所有接口
接口模式:针对某一个接口的配置
线控模式:对路由器进行控制的接口配置
(2)配置命令
show running config 显示所有的配置
show versin 显示版本号和寄存器值
shut down 关闭接口
no shutdown 打开接口
ip add +ip地址 配置IP地址
secondary+IP地址 为接口配置第二个IP地址
show interface+接口类型+接口号 查看接口管理性
show controllers interface 查看接口是否有DCE电缆
show history 查看历史记录
show terminal 查看终端记录大小
hostname+主机名 配置路由器或交换机的标识
config memory 修改保存在NVRAM中的启动配置
exec timeout 0 0 设置控制台会话超时为0
service 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中的配置信息
run-config atartup config 保存信息到NVRAM
write 保存信息到NVRAM
erase startup-config 清除NVRAM中的配置信息
show ip interface brief 查看接口的谪要信息
banner motd # +信息 + # 配置路由器或交换机的描素信息
description+信息 配置接口听描素信息
vlan database 进入VLAN数据库模式
vlan +vlan号+ 名称 创建VLAN
switchport 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号 删除VLAN
show spamming-tree vlan +vlan号 查看VLA怕生成树议
2. 路由器配置命令
ip route+非直连网段+子网掩码+下一跳地址 配置静态/默认路由
show ip route 查看路由表
show protocols 显示出所有的被动路由协议和接口上哪些协议被设置
show ip protocols 显示了被配置在路由器上的路由选择协议, 同时给出了在路由选择协议中使用的定时器等信息
router rip 激活RIP协议
路由器的几个基本命令:
Router>enable 进入特权模式
Router#disable 从特权模式返回到用户模式
Router#configure terminal 进入到全局配置模式
Router(config)#interface ethernet 1 进入到路由器编号为1的以太网口
exit 返回上层模式
end 直接返回到特权模式
========================================================
注意:
1、CISCO CATALYST(交换机),如果在初始化时没有发现“用户配置”文件,就会自动载入Default Settings(默认配置)文件,进行交换机初始化,以确保交换机正常工作。
2、CISCO Router(路由器)在初始化时,如果没有发现“用户配置”文件,系统会自动进入到“初始化配置模式”(系统配置对话模式,SETUP模式, STEP BY STEP CONFIG模式),不能正常工作!
========================================================
1、CONSOLE PORT(管理控制台接口):距离上限制,独占的方式。刚开始配置的时候一般使用这个。
2、AUX port(辅助管理接口):可以挂接MODEM实现远程管理,独占的方式。
3、Telnet:多人远程管理(决定于性能,VTY线路数量)不安全。后期维护,远程管理登陆。
========================================================
注意:
交换机、路由器配置命令都是回车后立即执行,立即生效的。在运行中的机器上修改命令的时候要特别注意。
========================================================
Router(config)#hostname ?
WORD This system's network name
在配置模式下修改当前主机的本地标识,例:
------------------
Router(config)#hostname r11
r11(config)#
------------------
r11(config-if)#ip address ?
A.B.C.D IP address
为当前端口设置IP地址,使用前先进入需要配置的端口,例:
------------------
r11(config)#interface ethernet 1
r11(config-if)#ip address 172.16.1.1 255.255.255.0
------------------
r11>show version
r11#show version 观察IOS版本,设备工作时间,相关接口列表
r11#show running-config 查看当前生效的配置,此配置文件存储在RAM
r11#show interfaces ethernet 1 查看以太网接口的状态,工作状态等等等...
========================================================
r11#reload 重新加载Router(重启)
r11#setup 手工进入setup配置模式
r11#show history 查看历史命令(最近刚用过的命令)
r11#terminal history size<0-256>设置命令缓冲区大小,0 : 代表不缓存
r11# running-config startup-config 保存当前配置
注意概念:
nvram:非易失性内存,断电信息不会丢失 <-- 用户配置 <-- 保存着startup-config
ram:随机存储器,断电信息全部丢失 <-- 当前生效配置 <-- 保存着running-config
startup-config:在每次路由器或是交换机启动时候,会主动加载(默认情况)
========================================================
设置说明和密码的几个命令:
r11(config)#banner motd [char c] 同时要以[char c]另起一行结束,描述机器登陆时的说明
r11(config-if)#description 描述接口注释,需要在端口配置模式下
配置console口密码:
------------------
r11(config)#line console 0 进入到consolo 0
r11(config-line)#password eliuzd 设置一个密码为“eliuzd”
r11(config-line)#login 设置login(登陆)时使用密码
------------------
配置enable密码:
------------------
r11(config)#enable password cisco 设置明文的enable密码
r11(config)#enable secret eliuzd 设置暗文的enable密码(优先于明文被使用)
r11(config)#service password-encryption 加密系统所有明文密码(功能较弱)
------------------
配置Telnet密码:
------------------
r11(config)#line vty 0
r11(config-line)#password cisco
r11(config-line)#login
------------------
========================================================
配置虚拟回环接口:(回环接口默认为UP状态)
(config)# 下,虚拟一个端口
------------------
r11(config)#interface loopback 0 创建一个回环接口loopback 0
r11(config-if)#ip address 192.168.1.1 255.255.255.0 配置它的IP地址
no * 做配置的反向操作(删除配置)
------------------
=========================================================
路由器 DCE/DTE 仅存在广域网中
r11#show controllers serial 0 用于查看DCE与DTE的属性,serial 0路由器广域网端口
DCE的Router需要配置时钟频率
r11(config-if)#clock rate ? 配置DCE接口的时钟频率(系统指定频率)
一般实际情况下,这个不需要自己配置,因为DCE设备都在运营商那。
=========================================================
r11#show interfaces serial 1
查看端口状态,第一行提示说明
Serial1 is administratively down, Line protocol is down
没有使用no shutdown命令激活端口
Serial1 is down, Line protocol is down
1、对方没有no shutdown激活端口
2、线路损坏,接口没有任何连接线缆
Serial1 is up, line protocol is down
1、对方没有配置相同的二层协议,Serial接口default encapsulation: HDLC
2、可能没有配置时钟频率
3、可能没有正确的配置三层地址(可能)
Serial1 is up,line protocol is up
接口工作正常
========================================================
查看CDP信息的几个命令:
r11#show cdp neighbors 查看CDP的邻居(不含IP)
r11#show cdp neighbors detail 查看CDP的邻居(包含三层的IP地址)
r11#show cdp entry * 查看CDP的邻居(包含三层的IP地址)老命令
r1(config)#no cdp run 在全局配置模式关闭CDP协议(影响所有的接口)
r1(config-if)#no cdp enable 在接口下关闭CDP协议(仅仅影响指定的接口)
r11#clear cdp table 清除CDP邻居表
r11#show cdp interface serial 1 查看接口的CDP信息
注意两个提示:
Sending CDP packets every 60 seconds(每60秒发送cdp数据包)
HoldTime 180 seconds(每个cdp数据包保持180秒)
========================================================
r11(config)#ip host 设置静态的主机名映射
r11#show sessions 查看设置过的映射主机名
========================================================
Telnet *.*.*.* 被telnet的设备,需要设置line vty的密码,如果需要进入特权模式需要配置enable密码
I. H3C路由器常用配置命令
1、system-view 进入系统视图模式
2、sysname R1 为设备命名为R1
3、display ip routing-table 显示当前路由表
4、 language-mode Chinese|English 中英文切换
5、interface Ethernet 0/0 进入以太网端口视图
6、 ip address 192.168.1.1 255.255.255.0 配置IP地址和子网掩码
7、 undo shutdown 打开以太网端口
8、 shutdown 关闭以太网端口
9、 quit 退出当前视图模式
10、 ip route-static 192.168.2.0 255.255.255.0 192.168.12.2 description To.R2 配置静态路由
11、 ip route-static 0.0.0.0 0.0.0.0 192.168.12.2 description To.R2 配置默认的路由
H3C S3100 Switch
H3C S3600 Switch
H3C MSR 20-20 Router
##########################################################################################
1、调整超级终端的显示字号;
2、捕获超级终端操作命令行,以备日后查对;
3、 language-mode Chinese|English 中英文切换;
4、复制命令到超级终端命令行,粘贴到主机;
5、交换机清除配置 : reset save ; reboot ;
6、路由器、交换机配置时不能掉电,连通测试前一定要
检查网络的连通性,不要犯最低级的错误。
7、192.168.1.1/24 等同 192.168.1.1 255.255.255.0;在配置交换机和路由器时, 192.168.1.1 255.255.255.0 可以写成:
192.168.1.1 24
8、设备命名规则:地名-设备名-系列号例:PingGu-R-S3600
H3C交换机的一些简单配置
2009-11-25 18:49
这里使用的H3C交换机是H126A,仅仅只做了最基本的'配置以满足使用。
配置中可以通过display current-configura命令来显示当前使用的配置内容。
# 配置VLAN 1
system-view
System View: return to User View with Ctrl+Z.
[Sysname]vlan 1
[Sysname-vlan1] quit
[Sysname]management-vlan 1
[Sysname]interface Vlan-interface 1
[Sysname-Vlan-interface1] ip address 10.0.1.201 255.255.255.0
# 显示VLAN 接口1 的相关信息。
display ip interface Vlan-interface 1
# 创建VLAN(H3C不支持cisco的VTP,所以只能添加静态VLAN)
system-view
System View: return to User View with Ctrl+Z.
[H3C_TEST]vlan 99
[H3C_TEST-vlan99]name seicoffice
[H3C_TEST-vlan99]quit
# 把交换机的端端口划分到相应的Vlan中
[H3C_TEST]interface ethernet1/0/2//进入端口模式
[H3C_TEST-Ethernet1/0/2]port link-type access //设置端口的类型为access
[H3C_TEST-Ethernet1/0/2]port access vlan 99//把当前端口划到vlan 99
[H3C_TEST]vlan 99
[H3C_TEST-vlan99]port ethernet1/0/1 to ethernet1/0/24//把以及网端口1/0/1到1/0/24划到vlan99
[H3C_TEST-vlan99]quit
[H3C_TEST-GigabitEthernet1/2/1]port trunk permit vlan 1 99 // {ID|All} 设置trunk端口允许通过的VLAN
-------------------------------------------------------------------------------------------------------
# 配置本地用户
system-view
System View: return to User View with Ctrl+Z.
[Sysname]local-user h3c
New local user added.
[Sysname-luser-h3c]service-type telnet level 3
[Sysname-luser-h3c]password simple h3c
# 配置欢迎信息
[H3C_TEST]header login %Welcome to login h3c!%
# 配置用户认证方式telnet(vty 0-4)
[H3C_TEST]user-interface vty 0 4
[H3C_TEST-ui-vty0-4]authentication-mode scheme
[H3C_TEST-ui-vty0-4]protocol inbound telnet
[H3C_TEST-ui-vty0-4]super authentication-mode super-password
[H3C_TEST-ui-vty0-4]quit
[H3C_TEST]super password level 3 simple h3c //用户登陆后提升权限的密码
# 配置Radius策略
[H3C_TEST]radius scheme radius1
New Radius scheme
[H3C_TEST-radius-radius1]primary authentication 10.0.1.253 1645
[H3C_TEST-radius-radius1]primary accounting 10.0.1.253 1646
[H3C_TEST-radius-radius1]secondary authentication 127.0.0.1 1645
[H3C_TEST-radius-radius1]secondary accounting 127.0.0.1 1646
[H3C_TEST-radius-radius1]timer 5
[H3C_TEST-radius-radius1]key authentication h3c
[H3C_TEST-radius-radius1]key accounting h3c
[H3C_TEST-radius-radius1]server-type extended
[H3C_TEST-radius-radius1]user-name-format without-domain
# 配置域
[H3C_TEST]domain h3c
[H3C_TEST-isp-h3c]authentication radius-scheme radius1 local
[H3C_TEST-isp-h3c]scheme radius-scheme radius1 local
[H3C_TEST]domain default enable h3c
# 配置在远程认证失败时,本地认证的key
[H3C_TEST]local-server nas-ip 127.0.0.1 key h3c
J. 华为路由器配置命令大全
华为路由器是世界一流的品牌,很多人都不太明白里面的一些命令,下文是我为大家提供的华为路由器配置命令大全,欢迎大家阅读。
华为路由器配置命令大全
基本命令en 进入特权模式conf 进入全局配置模式in s0 进入 serial 0 端口配置ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 添加ip 地址和掩码,电信分配enca hdlc/ppp 捆绑链路协议 hdlc 或者 pppip unn e0 exit 回到全局配置模式in e0 进入
基本命令
en 进入特权模式
conf 进入全局配置模式
in s0 进入 serial 0 端口配置
ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 添加ip 地址和掩码,电信分配
enca hdlc/ppp 捆绑链路协议 hdlc 或者 ppp
ip unn e0
exit 回到全局配置模式
in e0 进入以太接口配置
ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx 添加ip 地址和掩码,电信分配
exit 回到全局配置模式
ip route 0.0.0.0 0.0.0.0 s 0 添加路由表
ena password 口令
write
exit
以上根据中国电信 ddn 专线多数情况应用
普通用户模式
enable 转入特权用户模式
exit 退出配置
help 系统帮助简述
language 语言模式切换
ping 检查网络主机连接及主机是否可达
show 显示系统运行信息
telnet 远程登录功能
tracert 跟踪到目的地经过了哪些路由器
特权用户模式
#
clear 清除各项统计信息
clock 管理系统时钟
configure 进入全局配置模式
debug 开启调试开关
disable 返回普通用户模式
download 下载新版本软件和配置文件
erase 擦除FLASH中的配置
exec-timeout 打开EXEC超时退出开关
exit 退出配置
first-config 设置或清除初次配置标志
help 系统帮助简述
language 语言模式切换
monitor 打开用户屏幕调试信息输出开关
no 关闭调试开关
ping 检查网络主机连接及主机是否可达
reboot 路由器重启
setup 配置路由器参数
show 显示系统运行信息
telnet 远程登录功能
tracert 跟踪到目的地经过了哪些路由器
unmonitor 关闭用户屏幕调试信息输出开关
write 将当前配置参数保存至FLASH MEM中
全局配置模式
aaa-enable 使能配置AAA(认证,授权和计费)
access-list 配置标准访问表
arp 设置静态ARP人口
华为路由器的相关 文章 :
1. 华为路由器怎么隐藏你的WIFI信号
2. 如何解决华为路由器设置好了不能用
3. 华为路由器设置wifi的详细方法
4. 华为路由器详细介绍
5. 华为无线路由器的设置方法