h3c路由器命令(h3c路由器命令密码修改)满满干货
2)第二步:设置终端参数a、命名此终端 H3C或者自己想命的名b、选择串口 一般选用COM口,常选用COM1c、设置终端具体参数d、打开路由器的
H3C路由器、交换机基本调试1.1如何登陆进路由器或交换机1.1.1搭建配置环境第一次使用H3C系列路由器时,只能通过配置口(Console)进行配置1)将配置电缆的RJ-45一端连到路由器的配置口(Console)上。
2)将配置电缆的DB-9(或DB-25)孔式插头接到要对路由器进行配置的微机或终端的串口上。
备注:登陆交换机的方法与路由器的一致,现仅用路由器举1.1.2设置微机或终端的参数(进入路由器或交换机)1)打开微机(笔记本电脑)或终端如果使用微机进行配置,需要在微机上运行终端仿真程序,如Windows的超级终端。
2)第二步:设置终端参数a、命名此终端 H3C或者自己想命的名
b、选择串口 一般选用COM口,常选用COM1
c、设置终端具体参数(此处点击“默认值”即可)
d、打开路由器的电源,路由器进行启动
e、当路由器启动完毕后,回车几下,当出现时即可配置路由器。
1.2路由器基本调试命令1.2.1使用本地用户进行telnet登录的认证system-view 进入系统视图[H3C]telnetserver enable 打开路由器的telnet功能[H3C]configure-usercount 5 设置允许同时配置路由器的用户数
[H3C]local-usertelnet 添加本地用户(此处为telnet用户登陆时使用的用户名)[H3C-luser-telnet]passwordsimple h3c 设置telnet用户登陆时所使用的密码
[H3C-luser-telnet]service-typetelnet 设置本地用户的服务类型(此处为telnet)[H3C-luser-telnet]level3 设置本地用户的服务级别[H3C-luser-telnet]quit 退出本地用户视图
[H3C][H3C]user-interfacevty 0 4 进入用户视图[H3C-ui-vty0-4]authentication-modescheme 选择“scheme”认证方式备注:红色部分可以由客户自行设置,此处仅做举例时使用!
1.2.2路由器接口的配置为接口配置ip地址system-view 进入系统视图[H3C]interface serial 3/0 进入某个端口[H3C-Serial3/0]ip address 200.1.1.1 255.255.255.0 为该端口设置ip地址
[H3C-Serial3/0]undo shutdown 对该端口进行复位[H3C-Serial3/0]quit 退回到系统视图[H3C]备注:红色部分可以由客户自行设置,此处仅做举例时使用!1.2.3静态路由或默认路由的配置
system-view 进入系统视图[H3C]iproute-static 192.168.1.0 255.255.255.0 192.168.0.1 添加一条静态路由[H3C]iproute-static 0.0.0.0 0.0.0.0 192.168.0.1 添加一条默认路由
备注:红色部分可以由客户自行设置,此处仅做举例时使用!1.2.3配置文件的管理displaycurrent-configuration 显示当前的配置文件save 保存配置文件displayinterface GigabitEthernet 0/0 查看某端口的状态
备注:display命令可以在任何视图下进行红色部分可以由客户自行设置,此处仅做举例时使用!交换机的配置文件管理与路由器相同,故交换机的配置幻灯片中不再做举例1.3 交换机的基本调试命令1.3.1 创建VLAN并将端口加入到vlan中。
system-view 进入系统视图[H3C]vlan10 创建vlan 10[H3C-vlan100]port ethernet 0/1 将某个端口加入到vlan中[H3C-vlan100]quit 退出到系统
[H3C]备注:红色部分可以由客户自行设置,此处仅做举例时使用!1.3.2创建vlan虚接口并为接口配置ip地址system-view 进入系统视图[H3C]interfacevlan-interface 1 创建vlan虚接口
[H3C-Vlan-interface100]ip address 192.168.1.1 255.255.255.0 配置ip地址备注:红色部分可以由客户自行设置,此处仅做举例时使用!1.3.3 配置默认路由
[H3C]interface vlan-interface 1[H3C-Vlan-interface10]ip address 192.168.1.1 255.255.255.0[H3C-Vlan-interface10]quit
[H3C]ip route-static 0.0.0.0 0.0.0.0 192.168.1.2 配置缺省路由备注:红色部分可以由客户自行设置,此处仅做举例时使用!1.3.4设置端口类型system-view 进入系统视图
[H3C]interfaceethernet 0/1[H3C]portlink-type trunk 将端口类型设置为trunk[H3C]porttrunk permit vlan all trunk端口允许所有vlan通过
[H3C]saveTrunk可以收发多个vlan的报文,用于交换机与交换机之间的互连1.3.5交换机设置telnet登录的认证配置命令system-view 进入系统视图[H3C]local-usertelnet 添加本地用户(此处为telnet用户登陆时使用的用户名)
[H3C-luser-telnet]passwordsimple h3c 设置telnet用户登陆时所使用的密码[H3C-luser-telnet]service-typetelnet 设置本地用户的服务类型(此处为telnet)
[H3C-luser-telnet]level3 设置本地用户的服务级别[H3C-luser-telnet]quit 退出本地用户视图[H3C][H3C]user-interfacevty 0 4 进入用户视图
[H3C-ui-vty0-4]authentication-modescheme 选择“scheme”认证方式典型案例:案例1:如下图,LAB (router)通过配置路由器适当的两台终端电脑能够相互通信,请写出相关配置语句。
案例2:LAB (switch)
2 H3C交换机基本配置命令(入门级:配置语句拷贝注解)2.1 IP地址配置命令:system-view----进入系统配置模式[Quidway] 系统配置编辑模式[Quidway] interface Vlan-interface 1---交换机出厂默认VLAN-1
[Quidway-Vlan-interface1]ip add 192.168.X.254 255.255.255.0–配置IP地址[Quidway-Vlan-interface1]quit[Quidway] ip route-static 0.0.0.0 0.0.0.0 192.168.0.33-配置静态路由(网关)
2.2 远程登录配置命令:system-view----进入系统配置模式[Quidway] 系统配置编辑模式[Quidway] user-interface vty 0 4[Quidway-ui-vty0-4] user privilege level 3—管理权限配置
[Quidway-ui-vty0-4] set authentication password cipher 123456 (cipher为密文密码)2.3 配置端口速率及端口双工命令:system-view----进入系统配置模式
[Quidway] 系统配置编辑模式[Quidway]interface Ethernet 1/0/1---进入的端口[Quidway-Ethernet1/0/1] duplex full—配置端口为“全双工状态”
[Quidway-Ethernet1/0/1] speed 100---配置端口为“100M”如果是千兆端口可以配置成1000M2.4 划分VLAN配置命令:system-view----进入系统配置模式。
[Quidway] 系统配置编辑模式[Quidway]VLAN 100---创建VLAN---ID为:100[Quidway]VLAN 101---创建VLAN---ID为:101[Quidway-vlan100] port Ethernet 1/0/1 to Ethernet 1/0/10----从第1口到第10口添加到VLAN 100
[Quidway-vlan101] port Ethernet 1/0/11 to Ethernet 1/0/24----从第11口到第24口添加到VLAN 1012.5 配置TRUNK命令:比如一栋宿舍楼需要两个网段,划分了两个VLAN为100和101,VLAN 100作为管理VLAN配置命令如下:
system-view----进入系统配置模式[Quidway] 系统配置编辑模式[Quidway]VLAN 100---创建VLAN---ID为:100[Quidway]VLAN 101---创建VLAN---ID为:101
[Quidway-vlan100] port Ethernet 1/0/1 to Ethernet 1/0/10----从第1口到第10口添加到VLAN 100[Quidway-vlan101] port Ethernet 1/0/11 to Ethernet 1/0/24----从第11口到第24口添加到VLAN 101
[Quidway] interface Vlan-interface 100—进入VLAN 100[Quidway-Vlan-interface100]ip address 192.168.100.254255.255.255.0---给VLAN 100配置管理IP
[Quidway-Vlan-interface100]quit[Quidway]ip route-static 0.0.0.0 0.0.0.0 192.168.100.33—配置静态路由(网关)上联端口为千兆端口GigabitEthernet1/1/1在配置模式下配置命令如下:
[Quidway] interface GigabitEthernet 1/1/1---进入上联端口[Quidway-GigabitEthernet1/1/1] port link-type trunk --TRUNK是端口汇聚的意思
[Quidway-GigabitEthernet1/1/1] port trunk permit(允许)vlan all----配置允许通过的VLAN如果上联的路由器端口是自适应那么交换机上联口也是自适应,如果配置了1000M全双工那么交换机的上联端口也要配成1000M全双工。
如下命令:[Quidway-GigabitEthernet1/1/1] duplex full—配置端口为“全双工状态”[Quidway-GigabitEthernet1/1/1] speed 1000---配置端口为“1000M”
2.6 SNMP配置命令:[Quidway]snmp-agent community read 1234---SNMP读的密码[Quidway]snmp-agent community write 4567—SNMP写的密码
[Quidway]snmp-agent sys-info version all—SNMP软件版本有V1、V2c、V3这里配置的是允许所有版本2.7 配置防ARP攻击命令:system-view。
[Quidway]dhcp-snooping--开启交换机DHCP Snooping 功能开启VLAN 1 内所有端口的ARP 入侵检测功能[Quidway]vlan 1[Quidway-vlan1]arp detection enable。
[Quidway-vlan1]quit设置上联端口Ethernet1/0/1 为DHCP Snooping 信任端口,ARP 信任端口[Quidway]interfaceEthernet1/0/1[Quidway-Ethernet1/0/1]dhcp-snoopingtrust。
[Quidway-Ethernet1/0/1]arpdetection trust[Quidway-Ethernet1/0/1]quit开启端口Ethernet1/0/2上的ARP 报文限速功能,设置ARP 报文通过的最大速率为20pps。
--目的是针对用户接入口,除上联端口外,下联用户端口建议都设置该命令如下:[Quidway]interfaceEthernet1/0/2[Quidway-Ethernet1/0/2]arprate-limit enable
[Quidway-Ethernet1/0/2]arprate-limit 20[Quidway-Ethernet1/0/2]quit配置端口状态自动恢复功能,恢复时间间隔为30 秒[Quidway] arpprotective-down recover enable。
[Quidway] arpprotective-down recover interval 303 H3C交换机基本配置(中级版)3.1VRP,CMW简介3.1.1 VRP(Versatile RoutingPlatform,通用路由平台)是华为公司数据通信产品的通用网络操作系统平台。
3.1.2 CMW(Comware)是H3C公司的核心软件平台。3.1.3VRP、CMW的体系结构以TCP/IP模型为参考,实现了数据链路层、网络层和应用层的多种协议,其体系结构图如下:
3.1.4 VRP视图结构用户视图系统视图 命令: system-view在系统视图下 可以进入各种功能视图,在各功能视图中还可以进入子功能视图
3.2基本命令3.2.1配置系统名1)用途:用户名是设备的名字,目的是让用户更加方便的使用设备.2)配置命令: sysname3.2.2接口描述1)用途:接口描述是为了指明接口的一些属性,如是什么接口,对端接的什么设备等,让用户更加了解该接口。
2)配置命令:interface ethernet0/1 description connect to student3.2.3接口IP地址的配置1)用途:给接口一个网络上唯一的区分符.2)配置命令:interface vlan 1
ip address 168.10.2.1 255.255.255.03.2.4查看交换机信息1)用途:让用户对设备的信息更了解,也有利于对设备做配置.2)配置命令: 显示版本 display version
显示当前配置信息 display current 显示NVRAM的配置 display saved-config 显示接口信息 display interface XX 显示路由信息 display ip routing-table
3.2.5 调试交换机1)用途:更细致的查看交换机的各种数据包,帮助发现网络问题.2)常用调试命令: terminal debugging terminal monitor debugging ip packet
undo debugging all 3.2.6端口镜像1)用途:通过镜像来抓取网络流量,帮助分析网络问题.2)配置命令: monitor-portEthernet 0/1 both (监控端口) mirroring-port Ethernet0/2 both(源端口)
3.2.7流镜像1)用途: 通过镜像来抓取网络流量,帮助分析网络问题.2)配置命令:mirrored-toip-group 2000 interface Ethernet 0/1 acl number2000
rule 0permit 3.2.8快捷命令行介绍VRP、CMW Ctrl+F 前移一个字符 Ctrl+B 后移一个字符 Ctrl+P ↑(向上箭头)重用前一条命令 Ctrl+N ↓(向下箭头)重用下一条命令
3.2.9引导配置1)用途:通过引导配置,可以改变从什么地方取得交换机的系统软件.2)配置命令 boot boot-loader xxxx.bin 查看命令 displayboot-loader3.3交换
VLAN(VirtualLocal Area Network)技术是把一个LAN划分成多个逻辑的“LAN”-VLAN,每个VLAN是一个广播域,VLAN内的主机间通信就和在一个LAN内一样,而VLAN间则不能直接互通,这样,广播报文被限制在一个VLAN内。
vlan 100 (1-4094) 创建VLANundo vlan 100 (1-4094) 删除VLAN.port Ethernet 2/0/1 在VLAN中增加端口. undo port Ethernet 2/0/1 在VLAN中删除端口.
portaccessvlan 100 (1-4094)将端口加入VLANundo portaccessvlan100 (1-4094) 将端口脱离VLAN displayvlanVLANID (1-4094
) 显示VLAN信息TrunkTrunk允许在只有一条链路的情况下传输VLAN信息• 定义端口属性为Trunk.portlink-typetrunk• 删除端口Trunk属性.undoportlink-type
• 定义端口可以传输的VLAN.porttrunkpermitvlanVLAN ID• 在VLAN中删除端口.undoporttrunkpermitvlanVLAN IDLink Aggregation
链路聚合是将几条物理链路聚合在一起,当作一条 逻辑链路来使用分为静态聚合和动态聚合• 静态聚合端口.link-aggregationEthernet0/1toEthernet0/4both• 删除端口的静态聚合.。
undolink-aggregationall• 在端口下进行动态聚合.lacpenable• 在端口下取消动态聚合.undo lacp enableSTP(Spanning Tree Protocol)是生成树协议的英文缩写。
该协议可应用于环路网络,通过一定的算法阻断某些冗余路径,将环路网络修剪成无环路的树型网络,从而避免报文在环路网络中的增生和无限循环• 定义STP模式.stp mode stp• 取消STP模式.undo stp mode
• 定义MSTP模式.stp mode mstp• 取消MSTP模式.undo stp mode3.4路由3.4.1 RIPRIP是RoutingInformation Protocol(路由信息协议)的简称。
它是一种较为简单的内部网关协议(IGP),主要用于规模较小的网络中• 启动RIP,进入RIP视图rip• 停止RIP协议的运行undo rip• 在指定的网络接口上应用RIPnetworknetwork-address
• 在指定的网络接口上取消应用RIPundo networknetwork-address• 指定接口的RIP版本为RIP-1rip version 1• 指定接口的RIP版本为RIP-2 rip version 2 [ broadcast |multicast ]
• 将接口运行的RIP版本恢复为缺省值 undo rip version { 1 | 2 }3.4.2OSPFOSPF是Open Shortest PathFirst(开放最短路由优先协议)的缩写它是IETF组织开发的一个基于链路状态的内部网关协议。
目前使用的是版本2(RFC2328).• 定义router id• 启动OSPF,进入OSPF视图 ospf 关闭OSPF路由协议进程 undo ospf [ process-id ]• 进入OSPF区域视图
areaarea-id• 删除指定的OSPF区域 undo areaarea-id• 指定网段运行OSPF协议 network ip-address wildcard-mask• 取消网段运行OSPF协议
undo network ip-address wildcard-mask3.5网络管理3.5.1 SNMP的介绍• 介绍 简单网络管理协议(SNMP)是被广泛应用的一项工业标准,是目前用得最广泛的计算机网络管理协议.
• 结构 SNMP结构分为NMS(Network Management Station)和AGENT两部分,NMS是运行客户端的工作站,AGENT是运行在网络设备上的服务端软件.• SNMP版本 SNMP现在有三个版本,SNMP v3/v2c/v1,SNMP v3兼容v1和v2c.
• SNMP的配置包括: 启动和关闭SNMP AGENT服务 设置团体名 配置一个SNMP组 设置管理员的联系方法 允许/禁止发送Trap报文 设置Trap目标主机的地址 指定发送报文的源地址
SNMP实例配置• System-view 进入视图• Snmp-agent community read public 只读团体属性名public• Snmp-agent communty write private 只写团体属性名private
• Snmp-agent sys-inf contact Mr.wang-tel 3306设置管理员联系方法• Snmp-agent sys-info location telephone 3rd floor 路由器物理位置
• Snmp-agent trap enable 使能trap报文• Snmp-agent target-host trapaddress udp-domain 129.102.149.23 udp-port 5000 params securityname public 允许向网管工作站129.102.149.23发送trap报文,使用团体名为public.
3.6安全管理3.6.1认证与授权• 要点• 需要确定权利的等级• 需要确定授权的策略 Generic or per user RADIUS Local authentication3.6.2认证配置•
本地验证• VRP的配置 local-user huawei password simple 123 service-type telnet 设置本地认证用户名和密码 user-interface vty 0 4 进入vty视图
authentication-mode scheme 通过telnet访问的用户使用本地验证3.6.3限制授权区分用户在设备上的授权• 配置等级• 视图等级• 支持等级 使用特权等级(level1---level 3)
3.6.4授权配置• VRP的配置 local-user huawei password simple123 建立用户 local-user huawei level 3 设定授权等级• 应用命令 command-privilege level 3 view
serialdisplay interface• VRP的命令行保护 super password level {1/2/3}{simple/cipher} 1233.6.5 Vty和console的时间保护
• 用途 为了使通过vty和console登陆的设备在使用者离开后不被其他没有授权的人使用.• VRP的配置 Idle-timeout minite second3.6.6访问控制列表• 概述 路由器为了过滤数据包,需要配置一系列的规则,以决定什么样的数据包能够通过,这些规则就是通过访问控制列表ACL(Access Control List)定义的。
• 分类 基本的访问控制列表(basic acl) 高级的访问控制列表(advanced acl) 基于接口的访问控制列表(interface-basedacl) 基于MAC的访问控制列表(mac-based acl)
3.6.7标准访问列表的配置• 在系统视图下,创建一个基本访问控制列表 acl {number number/name namebasic} [match- order {config/auto}]•
在基本访问控制列表试图下,配置ACL规则. rule [rule-id] {permit/deny} [source sour-add sour-wildcast/any][time-range time-name] [logging] [fragment] [vpn-instance vpn-instance-name]
acl number 2000 rule 1 permit source 20.1.1.0 0.0.0.2554 H3C配置实验数据注解1、system-view 进入系统视图模式2、sysname 为设备命名
3、display current-configuration 当前配置情况4、 language-mode Chinese|English 中英文切换5、interface Ethernet 1/0/1 进入以太网端口视图
6、 port link-type Access|Trunk|Hybrid 设置端口访问模式7、 undo shutdown 打开以太网端口8、 shutdown 关闭以太网端口9、 quit 退出当前视图模式
10、 vlan 10 创建VLAN 10并进入VLAN 10的视图模式11、 port access vlan 10 在端口模式下将当前端口加入到vlan10中12、port E1/0/2 to E1/0/5 在VLAN模式下将指定端口加入到当前vlan中
13、port trunk permit vlan all 允许所有的vlan通过H3C路由器######################################################################################
1、system-view 进入系统视图模式2、sysname R1 为设备命名为R13、display ip routing-table 显示当前路由表4、 language-mode Chinese|English 中英文切换
5、interface Ethernet 0/0 进入以太网端口视图6、 ip address 192.168.1.1255.255.255.0 配置IP地址和子网掩码7、 undo shutdown 打开以太网端口
8、 shutdown 关闭以太网端口9、 quit 退出当前视图模式10、 ip route-static 192.168.2.0255.255.255.0 192.168.12.2 description To.R2 配置静态路由
11、 ip route-static 0.0.0.0 0.0.0.0192.168.12.2 description To.R2 配置默认的路由H3C S3100 SwitchH3C 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 248、设备命名规则:地名-设备名-系列号 例:PingGu-R-S3600H3C交换机的一些简单配置这里使用的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
H3C交换机路由器telnet和console口登录配置级别说明 Level 名称 命令 0 参观 ping、tracert、telnet 1 监控 display、debugging 2 配置 所有配置命令(管理级的命令除外)
3 管理 文件系统命令、FTP命令、TFTP命令、XMODEM命令 telnet仅用密码登录,管理员权限 [Router]user-interface vty 0 4[Router-ui-vty0-4]user privilege level 3[Router-ui-vty0-4]set authentication password simple abc
telnet仅用密码登录,非管理员权限 [Router]super password level 3 simple super [Router]user-interface vty 0 4[Router-ui-vty0-4]user privilege level 1[Router-ui-vty0-4]set authentication password simple abc
telnet使用路由器上配置的用户名密码登录,管理员权限 [Router]local-user admin password simple admin[Router]local-user admin service-type telnet[Router]local-user admin level 3
[Router]user-interface vty 0 4[Router-ui-vty0-4]authentication-mode local telnet使用路由器上配置的用户名密码登录,非管理员权限
[Router]super password level 3 simple super [Router]local-user manage password simple manage[Router]local-user manage service-type telnet[Router]local-user manage level 2
[Router]user-interface vty 0 4[Router-ui-vty0-4]authentication-mode local 对console口设置密码,登录后使用管理员权限 [Router]user-interface con 0[Router-ui-console0]user privilege level 3[Router-ui-console0]set authentication password simple abc
对console口设置密码,登录后使用非管理员权限 [Router]super password level 3 simple super [Router]user-interface con 0[Router-ui-console0]user privilege level 1[Router-ui-console0]set authentication password simple abc
对console口设置用户名和密码,登录后使用管理员权限 [Router]local-user admin password simple admin[Router]local-user admin service-type terminal[Router]local-user admin level 3
[Router]user-interface con 0[Router-ui-console0]authentication-mode local 对console口设置用户名和密码,登录后使用非管理员权限
[Router]super password level 3 simple super [Router]local-user manage password simple manage[Router]local-user manage service-type terminal[Router]local-user manage level 2
[Router]user-interface con 0[Router-ui-console0]authentication-mode local simple 是明文显示,cipher 是加密显示 路由器不设置telnet登录配置时,用户无法通过telnet登录到路由器上
[Router-ui-vty0-4]acl 2000 inbound可以通过acl的规则只允许符合条件的用户远程登录路由器路由器命令 ~~~~~~~~~~ [Quidway]display version 显示版本信息
[Quidway]display current-configuration 显示当前配置 [Quidway]display interfaces 显示接口信息 [Quidway]display ip route 显示路由信息
[Quidway]sysname aabbcc 更改主机名 [Quidway]super passwrod 123456 设置口令 [Quidway]interface serial0 进入接口 [Quidway-serial0]ip address
[Quidway-serial0]undo shutdown 激活端口 [Quidway]link-protocol hdlc 绑定hdlc协议 [Quidway]user-interface vty 0 4
[Quidway-ui-vty0-4]authentication-mode password [Quidway-ui-vty0-4]set authentication-mode password simple 222
[Quidway-ui-vty0-4]user privilege level 3 [Quidway-ui-vty0-4]quit [Quidway]debugging hdlc all serial0 显示所有信息
[Quidway]debugging hdlc event serial0 调试事件信息 [Quidway]debugging hdlc packet serial0 显示包的信息 静态路由: [Quidway]ip route-static {interface number|nexthop}[value][reject|blackhole]
例如: [Quidway]ip route-static 129.1.0.0 16 10.0.0.2 [Quidway]ip route-static 129.1.0.0 255.255.0.0 10.0.0.2
[Quidway]ip route-static 129.1.0.0 16 Serial 2 [Quidway]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2 动态路由:
[Quidway]rip [Quidway]rip work [Quidway]rip input [Quidway]rip output [Quidway-rip]network 1.0.0.0 可以all
[Quidway-rip]network 2.0.0.0 [Quidway-rip]peer ip-address [Quidway-rip]summary [Quidway]rip version 1
[Quidway]rip version 2 multicast [Quidway-Ethernet0]rip split-horizon 水平分隔 [Quidway]router id A.B.C.D 配置路由器的ID
[Quidway]ospf enable 启动OSPF协议 [Quidway-ospf]import-route direct 引入直联路由 [Quidway-Serial0]ospf enable area 配置OSPF区域
标准访问列表命令格式如下: acl [match-order config|auto] 默认前者顺序匹配 rule [normal|special]{permit|deny} [source source-addr source-wildcard|any]。
例: [Quidway]acl 10 [Quidway-acl-10]rule normal permit source 10.0.0.0 0.0.0.255 [Quidway-acl-10]rule normal deny source any
扩展访问控制列表配置命令 配置TCP/UDP协议的扩展访问列表: rule {normal|special}{permit|deny}{tcp|udp}source {|any}destination |any}
[operate] 配置ICMP协议的扩展访问列表: rule {normal|special}{permit|deny}icmp source {|any]destination {|any]
[icmp-code] [logging] 扩展访问控制列表操作符的含义 equal portnumber 等于 greater-than portnumber 大于 less-than portnumber 小于
not-equal portnumber 不等 range portnumber1 portnumber2 区间 扩展访问控制列表举例 [Quidway]acl 101 [Quidway-acl-101]rule deny souce any destination any
[Quidway-acl-101]rule permit icmp source any destination any icmp-type echo [Quidway-acl-101]rule permit icmp source any destination any icmp-type echo-reply
[Quidway]acl 102 [Quidway-acl-102]rule permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.0.0.0
[Quidway-acl-102]rule deny ip source any destination any [Quidway]acl 103 [Quidway-acl-103]rule permit tcp source any destination 10.0.0.1 0.0.0.0 destination-port equal ftp
[Quidway-acl-103]rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www [Quidway]firewall enable
[Quidway]firewall default permit|deny [Quidway]int e0 [Quidway-Ethernet0]firewall packet-filter 101 inbound|outbound
地址转换配置举例 [Quidway]firewall enable [Quidway]firewall default permit [Quidway]acl 101 [Quidway-acl-101]rule deny ip source any destination any
[Quidway-acl-101]rule permit ip source 129.38.1.4 0 destination any [Quidway-acl-101]rule permit ip source 129.38.1.1 0 destination any
[Quidway-acl-101]rule permit ip source 129.38.1.2 0 destination any [Quidway-acl-101]rule permit ip source 129.38.1.3 0 destination any
[Quidway]acl 102 [Quidway-acl-102]rule permit tcp source 202.39.2.3 0 destination 202.38.160.1 0 [Quidway-acl-102]rule permit tcp source any destination 202.38.160.1 0 destination-port great-than
1024 [Quidway-Ethernet0]firewall packet-filter 101 inbound [Quidway-Serial0]firewall packet-filter 102 inbound
[Quidway]nat address-group 202.38.160.101 202.38.160.103 pool1 [Quidway]acl 1 [Quidway-acl-1]rule permit source 10.110.10.0 0.0.0.255
[Quidway-acl-1]rule deny source any [Quidway-acl-1]int serial 0 [Quidway-Serial0]nat outbound 1 address-group pool1
[Quidway-Serial0]nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp [Quidway-Serial0]nat server global 202.38.160.102 inside 10.110.10.2 www tcp
[Quidway-Serial0]nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcp [Quidway-Serial0]nat server global 202.38.160.103 inside 10.110.10.4 smtp udp
PPP验证: 主验方:pap|chap [Quidway]local-user u2 password {simple|cipher} aaa [Quidway]interface serial 0 [Quidway-serial0]ppp authentication-mode {pap|chap}
[Quidway-serial0]ppp chap user u1 //pap时,不用此句 pap被验方: [Quidway]interface serial 0 [Quidway-serial0]ppp pap local-user u2 password {simple|cipher} aaa
chap被验方: [Quidway]interface serial 0 [Quidway-serial0]ppp chap user u1 [Quidway-serial0]local-user u2 password {simple|cipher} aaa
H3C路由器配置方案注解#version 5.20, Release 1719 //版本信息,自动显示#sysname H3C //给设备命名为H3C#super password level 3 cipher 7WC1<3E`[Y)./a!1$H@GYA!! //设置super密码
#domain default enable system#telnet server enable#vlan 1#domain systemaccess-limit disablestate active
idle-cut disableself-service-url disable#user-group system //从此以上未标注的为默认配置,不用去理解#local-user admin //添加用户名为admin的用户
password cipher .]@USE=B,53Q=^Q`MAF4<1!! //设置密码(密文)authorization-attribute level 3 //设置用户权限为3级(最高)service-type telnet //设置用户的模式为telnet用户
local-user share //从此往下四行同上password cipher [HM$GH8P1GSQ=^Q`MAF4<1!!authorization-attribute level 1service-type telnet
#controller E1 0/0 //进入E1物理端口(两兆口)using e1 //设置端口模式为E1(设置后下面会出现interface Serial0/0:0)#interface Aux0 //从此以下三行为主控板aux口默认配置
async mode flowlink-protocol ppp#interface Ethernet0/0 //进入E0/0接口(以太网口)port link-mode route //配置该接口为路由模式
#interface Serial0/0:0 //进入Serial0/0:0端口(前面用using e1命令后产生,对应E1端口)link-protocol ppp //配置链路协议为ppp(默认)ip address 74.1.63.170 255.255.255.252 //配置该接口IP地址
#interface NULL0#interface Vlan-interface1 //lan口vlan地址(lan口地址)ip address 192.168.1.1 255.255.255.0#interface Ethernet0/1
port link-mode bridge#interface Ethernet0/2port link-mode bridge#interface Ethernet0/3port link-mode bridge
#interface Ethernet0/4port link-mode bridge#ip route-static 74.1.8.0 255.255.255.0 74.1.63.169 //配置静态路由
#user-interface aux 0user-interface vty 0 4 //进入vty接口(远程登陆接口)0-4通道authentication-mode scheme //配置登陆验证类型为scheme(用户验证型)
user privilege level 1 //设置当验证模式不是scheme类型时的登录级别(废配置)#returnH3C路由器基本配置命令[Quidway]display version 显示版本信息
[Quidway]display current-configuration 显示当前配置 [Quidway]display interfaces 显示接口信息 [Quidway]display ip route 显示路由信息
[Quidway]sysname aabbcc 更改主机名 [Quidway]super passwrod 123456 设置口令 [Quidway]interface serial0 进入接口 [Quidway-serial0]ip address
[Quidway-serial0]undo shutdown 激活端口 [Quidway]link-protocol hdlc 绑定hdlc协议 [Quidway]user-interface vty 0 4
[Quidway-ui-vty0-4]authentication-mode password [Quidway-ui-vty0-4]set authentication-mode password simple 222
[Quidway-ui-vty0-4]user privilege level 3 [Quidway-ui-vty0-4]quit[Quidway]debugging hdlc all serial0 显示所有信息
[Quidway]debugging hdlc event serial0 调试事件信息 [Quidway]debugging hdlc packet serial0 显示包的信息静态路由: [Quidway]ip route-static {interface number|nexthop}[value][reject|blackhole]
例如: [Quidway]ip route-static 129.1.0.0 16 10.0.0.2 [Quidway]ip route-static 129.1.0.0 255.255.0.0 10.0.0.2
[Quidway]ip route-static 129.1.0.0 16 Serial 2 [Quidway]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2 动态路由:
[Quidway]rip [Quidway]rip work [Quidway]rip input [Quidway]rip output [Quidway-rip]network 1.0.0.0 ;可以all
[Quidway-rip]network 2.0.0.0 [Quidway-rip]peer ip-address [Quidway-rip]summary [Quidway]rip version 1
[Quidway]rip version 2 multicast [Quidway-Ethernet0]rip split-horizon ;水平分隔[Quidway]router id A.B.C.D 配置路由器的ID
[Quidway]ospf enable 启动OSPF协议 [Quidway-ospf]import-route direct 引入直联路由 [Quidway-Serial0]ospf enable area 配置OSPF区域
标准访问列表命令格式如下: acl [match-order config|auto] 默认前者顺序匹配 rule [normal|special]{permit|deny} [source source-addr source-wildcard|any]。
例: [Quidway]acl 10 [Quidway-acl-10]rule normal permit source 10.0.0.0 0.0.0.255 [Quidway-acl-10]rule normal deny source any
扩展访问控制列表配置命令配置TCP/UDP协议的扩展访问列表: rule {normal|special}{permit|deny}{tcp|udp}source {|any}destination |any}
[operate]配置ICMP协议的扩展访问列表: rule {normal|special}{permit|deny}icmp source {|any]destination {|any]
[icmp-code] [logging]扩展访问控制列表操作符的含义 equal portnumber 等于 greater-than portnumber 大于 less-than portnumber 小于
not-equal portnumber 不等 range portnumber1 portnumber2 区间扩展访问控制列表举例 [Quidway]acl 101 [Quidway-acl-101]rule deny souce any destination any
[Quidway-acl-101]rule permit icmp source any destination any icmp-type echo [Quidway-acl-101]rule permit icmp source any destination any icmp-type echo-reply
[Quidway]acl 102 [Quidway-acl-102]rule permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.0.0.0
[Quidway-acl-102]rule deny ip source any destination any[Quidway]acl 103 [Quidway-acl-103]rule permit tcp source any destination 10.0.0.1 0.0.0.0 destination-port equal ftp
[Quidway-acl-103]rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www [Quidway]firewall enable
[Quidway]firewall default permit|deny [Quidway]int e0 [Quidway-Ethernet0]firewall packet-filter 101 inbound|outbound
地址转换配置举例 [Quidway]firewall enable [Quidway]firewall default permit [Quidway]acl 101 [Quidway-acl-101]rule deny ip source any destination any
[Quidway-acl-101]rule permit ip source 129.38.1.4 0 destination any [Quidway-acl-101]rule permit ip source 129.38.1.1 0 destination any
[Quidway-acl-101]rule permit ip source 129.38.1.2 0 destination any [Quidway-acl-101]rule permit ip source 129.38.1.3 0 destination any
[Quidway]acl 102 [Quidway-acl-102]rule permit tcp source 202.39.2.3 0 destination 202.38.160.1 0 [Quidway-acl-102]rule permit tcp source any destination 202.38.160.1 0 destination-port great-than
1024[Quidway-Ethernet0]firewall packet-filter 101 inbound [Quidway-Serial0]firewall packet-filter 102 inbound
[Quidway]nat address-group 202.38.160.101 202.38.160.103 pool1 [Quidway]acl 1 [Quidway-acl-1]rule permit source 10.110.10.0 0.0.0.255
[Quidway-acl-1]rule deny source any [Quidway-acl-1]int serial 0 [Quidway-Serial0]nat outbound 1 address-group pool1
[Quidway-Serial0]nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp [Quidway-Serial0]nat server global 202.38.160.102 inside 10.110.10.2 www tcp
[Quidway-Serial0]nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcp [Quidway-Serial0]nat server global 202.38.160.103 inside 10.110.10.4 smtp udp
PPP验证: 主验方:pap|chap [Quidway]local-user u2 password {simple|cipher} aaa [Quidway]interface serial 0 [Quidway-serial0]ppp authentication-mode {pap|chap}
[Quidway-serial0]ppp chap user u1 //pap时,不用此句pap被验方: [Quidway]interface serial 0 [Quidway-serial0]ppp pap local-user u2 password {simple|cipher} aaa
chap被验方: [Quidway]interface serial 0 [Quidway-serial0]ppp chap user u1 [Quidway-serial0]local-user u2 password {simple|cipher} aaa
- 标签:
- 编辑:李松一
- 相关文章
-
eos70d(eos70d使用说明书)干货满满
佳能是市面上知名度以及销量口碑等等都十分出色的品牌,它旗下的产品也都拥有出色的性能参数优势和突出的性价比,因此能够…
-
eos70d(eos70d使用说明书)难以置信
专业摄像或犀利静物照相,佳能EOS 80D都不在话下相比已上市三年多的EOS 70D, 80D在保持其原有特色的全像素双核CMOS AF系统下,…
- 黑莓论坛(黑莓q20论坛)全程干货
- project2007(project2007工作日期改为7天)学到了
- super amoled(superamoled怎么读)这样也行?
- 荣耀3c(荣耀3c手机)全程干货
- 撕裂重罪(撕裂重罪手机上可以玩吗)硬核推荐