华为配置命令(HCNA入门部分).docx_第1页
华为配置命令(HCNA入门部分).docx_第2页
华为配置命令(HCNA入门部分).docx_第3页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

HCNA入门部分一、命令行基础Huawei用户视图; Huawei系统视图逐级退出:quit; 完全退出:Ctrl+Z; 打断:Ctrl+C1、修改设备名称:Huaweisysname R12、配置系统时钟:设置所在时区:R1clock timezone beijing add 08:00:00设置当前时间:R1clock datetime 16:35:25 2018-03-29设置采用夏时制:clock daylight-saving-time3、配置标题消息:配置在用户登陆前显示的标题消息:R1header login information welcome to R1配置在用户登陆后显示的标题消息:R1header shell information no reboot R14、配置特定等级用户在特定视图具有特定命令:R1command-privilege level 15 view user save5、为VRP系统创建账户(创建账户缺省是level15,服务类型包括terminal):R1aaaR1-aaalocal-user admin privilege level 15 password cipher huaweiR1-aaalocal-user admin service-type terminal(用于指定账户的服务类型,默认是ALL)6、在console口配置使用超级终端登录时的验证方式(缺省时不验证):R1user-interface console 0R1-ui-console0authentication-mode aaa7、用户界面:VTY虚拟类型终端:R1user-interface vty 0 4R1-ui-vty0-4authentication-mode password(或者aaa)8、配置登录的超时时间(缺省是10分钟):R1user-interface console 0R1-ui-console0idle-timeout 5 09、指定终端屏幕临时显示的行数(缺省是24行):R1user-interface console 0R1-ui-console0screen-length 1010、历史命令缓冲区大小(缺省是10行):R1user-interface console0R1-ui-console0history-command max-size 2011、配置只使用口令登录之后获取的权限:R1user-interface console 0R1-ui-console0user privilege level 1512、配置IP地址:R1int g0/0/1R1-GigabitEthernet0/0/1ip add 24二、文件系统基础1、基本查询命令(1)查看当前目录:R1pwd(2)查看当前目录下的文件列表:R1dir(3)查看文办文件:more .txt2、目录操作(1)创建目录:R1mkdir aaa(2)进入目录:R1cd aaa(3)删除目录:R1mkdir aaa3、文件操作(1)文件拷贝:R1copy flash:/dhcp/dhcp-duid.txt flash:/bbb/ Copy flash:/dhcp/dhcp-duid.txt to flash:/bbb/dhcp-duid.txt? (y/n)n:y(2)文件重命名:R1rename flash:/bbb/dhcp-duid.txt flash:/bbb/123.txtRename flash:/bbb/dhcp-duid.txt to flash:/bbb/123.txt? (y/n)n:y(3)文件移动:R1move flash:/bbb/123.txt flash:/aaa/ Move flash:/bbb/123.txt to flash:/aaa/123.txt? (y/n)n:y(4)删除文件:R1delete flash:/aaa/123.txt Delete flash:/aaa/123.txt? (y/n)n:y(5)恢复被删除文件:R1undelete flash:/aaa/123.txt Undelete flash:/aaa/123.txt? (y/n)n:y(6)永久删除文件:R1delete /unreserved flash:/aaa/123.txt Warning: The contents of file flash:/aaa/123.txt cannot be recycled. Continue? (y/n)n:y4、管理配置文件(1)查看当前配置文件(RAM):R1display current-configuration(2)查看保存的配置文件(flash/SD卡):R1display saved-configuration(3)保存配置:R1save(4)删除保存的配置文件,恢复出厂设置:R1delete flash:/vrpcfg.zip或R1reset saved-configuration(5)系统启动文件的查询:R1display startup(6)修改系统启动后加载的配置文件:Huaweistartup saved-configuration flash:/123.zip(7)修改系统启动系统文件:R1startup system-software 路径(8)比较配置文件:R2compare configuration5、修复存储设备:R1fixdisk flash: 6、格式化存储设备:R1format flash:三、VRP系统管理1、升级路由器的VRP系统:(1)在FTP SERVER下准备更新的VRP系统文件(2)实现路由器与FTP SERVER的网络连接性(3)在路由器的用户视图下连接到FTP SERVER:R1ftp R1-ftpget 文件名 (get下载,put上传)R1startup system-software flash:文件名2、备份路由器的VRP系统:(1)在FTP SERVER下准备更新的VRP系统文件(2)实现交换机与FTP SERVER的网络连接性Quidwayinterface vlanif 1Quidway-vlanif1IP add 00.24(3)在交换机的用户视图下连接到FTP SERVER: Quidwayftp ftpput 文件名四、修改丢失的口令(1)必须使用console口连接设备,(2)打开电源之后使用Ctrl+B进入BOOTROM菜单中(默认口令是huawei) ;(3)在进入BOOTROM MENU中,选择5 (5. Enter filesystem submenu) ;(4)然后再选择4 (4.Rename file from Flash);(5)选择vrecfg.zip文件进行重命名(vrpcfg1.zip); (6)最后选择6(6.Return to main menu) 回到BOOTROM菜单,再选择7 (7.Reboot) 重启设备;(7)设备重启之后将不能加载配置文件(即此时不需要验证口令就可登录)此时可以在用户视图下再将之间重命名的配置文件再修改成vrpcfg.zip Quidwayrename vrpcfg1.zip vrpcfg.zip Rename flash:/vrpcfg1.zip to flash:/vrpcfg.zip ?Y/N:y_(8)在用户视图下使用display saved-configuration命令查看保存的配置文件,然后再将保存的配置文件拷贝到系统视图下执行,以加载到当前配置文件中;(9)修改验证的口令,并保存配置 SW1aaa sW1-aaalocal-user test password cipher 123456sw1user-interface console 0 sW1-ui-consoleauthentication-mod ? aaa AAA authentication none Login without checking password Authentication through the password of a user terminal五、交换网络基础(1)查看交换机MAC地址表:S1display mac-address(2)配置接口的速率和双工(缺省是自动协商:就低不就高):S1interface Ethernet0/0/1S1-Ethernet0/0/1negotiation auto(3)手工修改速率和双工需要关闭自动协商:S1interface Ethernet0/0/1S1-Ethernet0/0/1undo negotiation autoS1-Ethernet0/0/1speed 100S1-Ethernet0/0/1duplex (4)查看交换机接口状态:S1-Ethernet0/0/1display interface e0/0/1六、配置STP1)配置交换机的STP模式为STPS1-4stp mode stp2)通过修改优先级,调整跟交换机的位置(缺省是32768,推荐使用汇聚层交换机为跟交换机)S3stp priority ? INTEGER0-61440 Bridge priority, in steps of 4096S3stp priority 0S4stp priority 40963)通过配置端口开销选择RP(1Gbps端口在STP中默认的开销是20000)S4interface g0/0/4S4-GigabitEthernet0/0/4stp cost 100004)修改端口开销计算方式S4stp pathcost-standard ? dot1d-1998 IEEE 802.1D-1998 dot1t IEEE 802.1T legacy Legacy5)通过配置端口优先级选择RP(缺省是128)S3int g0/0/3S3-GigabitEthernet0/0/3stp port priority 112S4int g0/0/3S4-GigabitEthernet0/0/3stp cost 100006)检查stp运行:S1display stpS1display stp briefS4display stp interface g0/0/4七、配置RSTP1)配置STP模式为RSTPS1stp mode rstp2)配置边缘端口S1int e0/0/1S1-Ethernet0/0/1stp edged-port enable3)配置根桥S3stp priority 0S4stp priority 40964)配置端口开销和优先级S4-GigabitEthernet0/0/4stp cost 1-200000000S3-GigabitEthernet0/0/3stp port priority 0-240 5)配置根保护(在根桥连接接入层交换机的DP上配置)S3int g0/0/1S3-GigabitEthernet0/0/1stp root-protection (S3:g0/0/1、g0/0/2、S4:g0/0/1、g0/0/2)被配置为根保护的DP端口接收到更优BPDU时,端口要被置为Discarding(丢弃)状态6)配置BPDU保护边缘端口一般用于连接PC,不能接收到BPDU,但如果攻击者恶意伪造BPDU发送到边缘端口,边缘端口会自动变为非边缘端口,并参与网络拓扑计算,引发网络的震荡。配置BPDU保护可以让边缘端口在接收到BPDU时,端口直接被关闭,并通知到网管系统,端口需要背手工开启之后才能正常工作。S1/2stp bpdu-protection 7)配置环路保护当AP端口所在链路发生故障,成为单向链路时可能产生环路,配置环路保护,可以解决该问题S1int g0/0/2S1-GigabitEthernet0/0/2stp loop-protection配置分公司访问到总部的服务器群R3int g0/0/0R3-GigabitEthernet0/0/0ip add 24R3int g0/0/2R3-GigabitEthernet0/0/2ip add 24R3int Pos5/0/0R3-Pos5/0/0ip add 24R1int g0/0/2R1-GigabitEthernet0/0/2ip add 24R1int Pos5/0/0R1-Pos5/0/0ip add 24在R3上配置到达服务器群的静态路由1)配置静态路由的负载均衡R3ip route-static 24 R3ip route-static 24 2)配置静态浮动路由(备份)R1ip route-static 24 R1ip route-static 24 preference 100八、配置RIPv1在华为路由器中启用RIP时,缺省使用的进程ID是1,缺省的版本是RIPv1 Compatible(即发送RIPv1更新,可接收RIPv1和RIPv2)1、RIP的基本配置1)RIPv1的基本配置R1ripR1-rip-1version 1R1-rip-1network R1-rip-1network R1-rip-1network R1-rip-1network R3rip R3-rip-1version 1R3-rip-1network R3-rip-1network R3-rip-1network 2)配置RIPv2R3rip R3-rip-1version 2R1rip R1-rip-1version 22、RIP的其他配置1)配置RIP的水平分割(缺省已启用)R3int g0/0/2R3-GigabitEthernet0/0/2rip split-horizon R3display rip 1 interface g0/0/2 v2)配置RIP的毒性反转(缺省未开启)水平分割和毒性反转同时启用时,毒性反转生效R3-GigabitEthernet0/0/2rip poison-reverse3)配置接口接收或发送路由时的偏移R3int Pos 5/0/0R3-Pos5/0/0rip metricout 3R3-Pos5/0/0rip metricin 34)配置RIP在接口是否发送或接收RIP报文R3int g0/0/0R3-GigabitEthernet0/0/0undo rip output R3-GigabitEthernet0/0/0undo rip inputR1int g0/0/1R1-GigabitEthernet0/0/1undo rip output R1-GigabitEthernet0/0/1undo rip input 5)配置接口的静默R1ripR1-rip-1silent-interface g0/0/0检查参与RIP进程的接口:R1display rip 1 interface 检查RIP学习到的路由:R3display ip routing-table protocol rip查看RIP的数据库R3display rip 1 database 查看RIP进程R1dis rip 1九、OSPF1、OSPF的基本配置:R1undo rip 1R1ospf 1 router-id R1-ospf-1area 0R1-ospf-1-area-network 55R1-ospf-1-area-network 55R3undo rip 1R3ospf 1 rouR3ospf 1 router-id R3-ospf-1area 0R3-ospf-1-area-network R3-ospf-1-area-network R3-ospf-1-area-network 2、OSPF的其他配置:(1)配置接口的成本R3int pos5/0/0R3-Pos5/0/0ospf cost 10(2)配置接口的优先级(默认是1):R3-GigabitEthernet0/0/2ospf dr-priority 10R1-GigabitEthernet0/0/2ospf dr-priority 0(3)配置OSPF认证:R1int Pos 5/0/0R1-Pos5/0/0ospf authentication-mode md5 1 cipher 123456R3int Pos 5/0/0R3-Pos5/0/0ospf authentication-mode md5 1 cipher 1234563、检查OSPF:(1)查看参与OSPF进程的接口:R3dis ospf interface(2)查看OSPF邻居:R3dis ospf peer (3)查看OSPF建立的IP路由表:R3dis ip routing-table protocol ospf十、DHCPDHCP接口地址池配置R3int g0/0/0R3-GigabitEthernet0/0/0ip add 24R3ospf 1R3-ospf-1area 0R3-ospf-1-area-undo network R3-ospf-1-area-network 55或R3-GigabitEthernet0/0/0ospf enable 1 area 0必须先创建区域0R3dhcp enable R3int g0/0/0R3-GigabitEthernet0/0/0dhcp select interface R3-GigabitEthernet0/0/0dhcp server dns-list R3-GigabitEthernet0/0/0dhcp server excluded-ip-address 54R3-GigabitEthernet0/0/0dhcp server lease day 1查看DHCP SERVER数据库:R3dis dhcp server database 查看IP地址池:R3dis ip pool DHCP全局地址池配置R3int g0/0/0R3-GigabitEthernet0/0/0undo dhcp select interface R3-GigabitEthernet0/0/0qR3ip pool R3R3-ip-pool-R3network mask R3-ip-pool-R3gateway-list R3-ip-pool-R3dns-list R3-ip-pool-R3excluded-ip-address 54R3-ip-pool-R3lease day 2R3-ip-pool-R3qR3int g0/0/0R3-GigabitEthernet0/0/0dhcp select global DHCP中继(Relay)配置DHCP SERVERint g0/0/0DHCP SERVER-GigabitEthernet0/0/0ip add 24DHCP SERVERdhcp enable DHCP SERVERip route-static 0 51DHCP SERVERip pool LAN1DHCP SERVER-ip-pool-LAN1network mask 28DHCP SERVER-ip-pool-LAN1gateway-list 01DHCP SERVER-ip-pool-LAN1dns-list DHCP SERVER-ip-pool-LAN1excluded-ip-address 00DHCP SERVER-ip-pool-LAN1excluded-ip-address 02 06DHCP SERVER-ip-pool-LAN1lease day 2DHCP SERVER-GigabitEthernet0/0/0dhcp select global R1dhcp enR1dhcp enable R1int g0/0/1R1-GigabitEthernet0/0/1ip add 01 25R1-GigabitEthernet0/0/1dhcp select relay R1-GigabitEthernet0/0/1dhcp relay server-ip R1

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论