资源描述
,单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,杭州华三通信技术有限公司,单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,命令行操作基础,ISSUE 1.0,日期:,杭州华三通信技术有限公司 版权所有,未经授权不得使用与传播,可以通过,Console,、,AUX,、,Telnet,和,SSH,多种途径,搭建网络设备配置环境,H3C Comware,在上述配置方法中使用的命令行采用了配置权限的分级控制,引入,掌握配置网络设备的基本方法,掌握分级命令行的使用方法,掌握网络设备的常用配置命令,课程目标,学习完本课程,您应该能够:,配置网络设备的方法,命令行使用入门,常用的命令,配置远程登录,目录,访问网络设备命令行接口的方法,通过,Console,口本地访问,使用,Telnet,终端访问,使用,SSH,终端访问,使用,Console,口进行连接,Console,线缆,Router/Switch,终端,Console,口,串口,创建新连接,选择,COM,口,设置属性参数,进入设备配置界面,使用,Telnet,进行连接,主机,Router/Switch,IP,网络,Telnet,客户端,Telnet,服务器,网络接口,网络接口,SSH,介绍,SSH,(,Secure Shell,,安全外壳)在无安全保证的网络上提供安全的远程登录等服务,由传输协议、验证协议和连接协议三部分组成,使用,TCP,端口,22,提供,Password,和,Publickey,两种验证方式,PSTN/ISDN,主机,Router/Switch,IP,网络,SSH,客户端,SSH,服务器,配置网络设备的方法,命令行使用入门,常用的命令,配置远程登录,目录,命令视图,用户视图,设备启动后的缺省视图,可查看启动后基本运行状态和统计信息,系统视图,配置系统全局通用参数的视图,路由协议视图,配置路由协议参数的视图,接口视图,配置接口参数的视图,用户界面视图,配置登陆设备的各个用户属性的视图,各种视图之间的关系,用户视图,用户界面视图,接口视图,路由协议视图,VLAN,视图,用,可以从任意视图直接回到用户视图,以任意方式登录命令行,system-view,quit,user-interface,命令,quit,interface,命令,quit,router,命令,quit,vlan,命令,quit,系统视图,使用命令视图,*,*Copyright(c)2004-2007 Hangzhou H3C Tech.Co.,Ltd.All rights reserved.*,*Without the owners prior written consent,*,*no decompiling or reverse-engineering shall be allowed.*,*,User interface con0 is available.,Please press ENTER.,%Apr 22 16:44:16:802 2008 H3C SHELL/4/LOGIN:Console login from con0,system-view,System View:return to User View with Ctrl+Z.,H3Cinterface GigabitEthernet 0/0,H3C-GigabitEthernet0/0description to_MyPC,H3C-GigabitEthernet0/0ip add 192.168.0.1 255.255.255.0,H3C-GigabitEthernet0/0quit,H3Cuser-interface vty 0 4,H3C-ui-vty0-4authentication-mode scheme,命令级别,访问级(,0,级),网络诊断工具命令、从本设备出发访问外部设备的命令,监控级(,1,级),用于系统维护、业务故障诊断的命令,系统级(,2,级),业务配置命令,管理级(,3,级),关系到系统基本运行,系统支撑模块的命令,用户级别,用户级别,允许使用的命令级别,0,访问级,1,访问级、监控级,2,访问级、监控级、系统级、,3,访问级、监控级、系统级、管理级,命令行帮助特性,?,User view commands:,backup Backup next startup-configuration file to TFTP server,boot-loader Set boot loader,bootrom Update/read/backup/restore bootrom,cd Change current directory,clock Specify the system clock,copy Copy from one file to another,debugging Enable system debugging functions,delete Delete a file,dialer Dialer disconnect,dir List files on a file system,display Show running system information,fixdisk Recover lost chains in storage device,format Format the device,free Clear user terminal interface,ftp Open FTP connection,graceful-restart Restart LDP protocol,language-mode Specify the language environment,license Software license information,-More-,Sysname interface vlan?,VLAN interface number,Sysname interface vlan 1?,命令行帮助特性(续),di?,dialer,dir,display,dis?,display,dis,display,display v?,version,virtual-access,vlan,voice,voiceboard,vrrp,display ver?,version,display ver?,此处按下,键可以补全命令,错误提示信息,Routerdi,%Ambiguous command found at position.,Routerdispaly,%Unrecognized command found at position.,Routerdisplay,%Incomplete command found at position.,Router display interface gigabitethernet 0/0 0,%Too many parameters found at position.,Routerdisplay interface gigabitethernet 0/0/0,%Wrong parameter found at position.,Router,命令行历史记录功能,查看历史命令记录,翻阅和调出历史记录中的某一条命令,用,或,快捷键调出上一条历史命令,用,或,快捷键调出下一条历史命令,display history-command,命令行编辑功能,按键,功能,普通字符键,若编辑缓冲区未满,则插入到当前光标位置,并向右移动光标,删除光标位置的前一个字符,光标前移,或,光标向左移动一个字符位置,或,光标向右移动一个字符位置,将光标移动到当前行的开头,将光标移动到当前行的末尾,删除当前光标所在位置的字符,删除光标左侧连续字符串内的所有字符,删除光标所在位置及其右侧连续字符串内的所有字符,将光标移动到左侧连续字符串的首字符处,将光标向右移到下一个连续字符串之前,删除光标左侧所有的字符,删除光标右侧所有的字符,分页显示,本页未显示完,还有下一页,display interface,Aux0 current state:DOWN,Line protocol current state:DOWN,Description:Aux0 Interface,The Maximum Transmit Unit is 1500,Hold timer is 10(sec),Internet protocol processing:disabled,Link layer protocol is PPP,LCP initial,Output queue:(Urgent queuing:Size/Length/Discards)0/50/0,Output queue:(Protocol queuing:Size/Length/Discards)0/500/0,Output queue:(FIFO queuing:Size/Length/Discards)0/75/0,Physical layer is asynchronous,Baudrate is 9600 bps,Phy-mru is 1700,Last clearing of counters:Never,Last 300 seconds input rate 0.00 bytes/sec,0 bits/sec,0.00 packets/sec,Last 300 seconds output rate 0.00 bytes/sec,0 bits/sec,0.00 packets/sec,Input:0 packets,0 bytes,0 broadcasts,0 multicasts,0 errors,0 runts,0 giants,-More-,:继续显示下一屏信息,:继续显示下一行信息,:停止显示和命令执行,配置网络设备的方法,命令行使用入门,常用的命令,配置远程登录,目录,常用设备管理命令,配置设备名称,配置系统时间,显示系统时间,配置欢迎/提示信息,H3Csysname?,TEXT Host name(1 to 30 characters),clock datetime?,TIME Specify the time(HH:MM:SS),H3Cheader?,incoming Specify the banner of the terminal user-interface,legal Specify the legal banner,login Specify the login authentication banner,motd Specify the banner of today,shell Specify the session banner,display clock,常用信息查看命令,查看版本信息,查看当前配置,显示接口信息,显示接口IP状态与配置信息,显示系统运行统计信息,display version,display current-configuration,display ip interface brief,display interface,display diagnostic-information,配置网络设备的方法,命令行使用入门,常用的命令,配置远程登录,目录,路由器,Telnet,服务配置命令,配置与网络相连端口的,IP,地址,使能,Telnet,服务器端功能,进入,vty,用户界面视图,设置验证方式,H3Ctelnet server enable,H3C-ethernet0/0ip address,ip-address,mask,|,mask-length,H3Cuser-interface vty,first-num2,last-num2,H3C-ui-vty0authentication-mode none|password|scheme,路由器,Telnet,服务配置命令(续),设置登录密码和用户级别,创建用户、配置密码、设置服务类型、设置用户级别,H3C-ui-vty0set authentication password cipher|simple,password,H3C-ui-vty0user privilege level,level,H3Clocal-user,username,H3C-luser-xxx password cipher|simple,password,H3C-luser-xxx service-type telnet,H3C-luser-xxx level,level,Telnet,配置例子,RTA,system-view,H3Ctelnet server enable,H3Cinterface ethernet0/0,H3C-ethernet0/0ip address 192.168.0.254 24,H3Cuser-interface vty 0,H3C-ui-vty0set authentication password cipher 123456,H3C-ui-vty0user privilege level 2,PCA,IP,地址:,192.168.0.1,子网掩码:,255.255.255.0,Telnet,客户端,Telnet,服务器,G0/0,用,Telnet,登录,Microsoft Windows XP,版本,5.1.2600,(C),版权所有,1985-2001 Microsoft Corp.,C:Documents and Settingsusertelnet 192.168.0.254,*,*Copyright(c)2004-2007 Hangzhou H3C Tech.Co.,Ltd.All rights reserved.*,*Without the owners prior written consent,*,*no decompiling or reverse-engineering shall be allowed.*,*,Login authentication,Password:,输入密码,路由器,SSH,服务配置命令,使能,SSH,服务器功能,配置,SSH,客户端登录时的用户界面,配置,SSH,用户,H3C ssh server enable,H3C-ui-vty0-4authentication-mode scheme,H3C-ui-vty0-4protocol inbound ssh,H3Clocal-user,username,H3C-luser-xxx password cipher|simple,password,H3C-luser-xxx service-type ssh,H3C-luser-xxx level,level,路由器,SSH,服务配置命令(续),生成,RSA,密钥,导出,RSA,密钥,销毁,RSA,密钥,H3Crsa local-key-pair create,H3Crsa local-key-pair export ssh2,H3Crsa local-key-pair destroy,SSH,配置例子,RTA,H3Crsa local-key-pair create,H3Cinterface gigabitethernet0/0,H3C-GigabitEthernet0/0ip address 192.168.0.254 255.255.255.0,H3Cssh server enable,H3Cuser-interface vty 0 4,H3C-ui-vty0-4authentication-mode scheme,H3C-ui-vty0-4protocol inbound ssh,H3Clocal-user sshclient,H3C-luser-sshclientpassword simple abc,H3C-luser-sshclientservice-type ssh,H3C-luser-sshclientlevel 3,PCA,IP,地址:,192.168.0.1,子网掩码:,255.255.255.0,运行,SSH,客户端软件,SSH,客户端,SSH,服务器,G0/0,启动,SSH,客户端,登录网络设备,支持,Console,口本地配置、远程配置、,Telnet,或,SSH,本地或远程配置,命令行提供多种命令视图,系统命令行采用分级保护方式,命令行划分为访问级、监控级、系统级、管理级,4,个级别,本章总结,
展开阅读全文