在全局配置模式下切换router接口,输入interface命令,?用于提示可选参数,为如下: Router(config)#interface ? (略) Serial Serial 前半部分为参数,后半部分为描述,接着输入serial 0,进入router接口配置模式,如下: Router(config)#interface serial 0 Router(config-if)#
Subinterfaces
在router的某个接口划分逻辑子接口(subinterface),输入命令进入子接口模式,如下,注意提示符: Router(config)#interface fa0/0.? <0-4294967295> FastEhernet interface number Router(config)#interface fa0/0.1 Router(config-subif)#
一些特写: 1.在命令行下输入?,将得到该模式下可以使用的命令列表以及其描述 2.假如你不确定1个命令是如何写的,比如你只记得是字母c开头,你可以输入c加1个?,将得到该模式下可以使用的所有命令: Router#c? clear clock configuration connect copy Router#clock ? set Set the time and date 3.假如你输入的命令不完整,将得到1个错误提示:Imcomplete command,这样有助于分析命令哪出错了 4.router支持命令缩写,比如show可以缩写为sh,sho,但是假如你像如下那样输入了不完整的缩写,将得到错误提示:Ambiguous command Router#sh te % Ambiguous command: sh te Router#sh te? tech-support template terminal
其他的一些关于历史的命令: 1.show history:显示最后输入的10条命令,默认是10条,可以修改该值 2.terminal history size:修改显示最后输入过的的命令的数量,默认是10条,最大是256条 3.show terminal:显示命令历史缓存大小,如下: Router#sh terminal (略) History is enabled,history size is 10 (略) Router#terminal history size ? <0-256> Size of history buffer Router#terminal history size 25 Router#sh terminal (略) History is enabled,history size is 25 (略)
Gather Basic Routing Information
show version:显示系统硬件的基本配置和软件版本,以及配置文件的名字和来源,还有启动镜象,最后是configuration register的值
enable password:给console和AUX口加密,防止未授权用户进入特权模式,但是密码是非加密形式 enable secret:给console和AUX口加密,防止未授权用户进入特权模式,密码是加密形式,并且一旦起用了这个密码,将凌驾于enable password之上,如果同时设置了enable password和enable secret的情况下,必须输入不同的密码,如下: Router(config)#enable password 123 Router(config)#enable secret 123 The enable password you have chosen is the same as your enable secret.This is not recommended.Re-enter the enable password Router(config)#enable secret 321
如果VTY线路的密码没有设置,你将无法使用telnet来连上它
Auxiliary Password
配置AUX密码: Router#conf t Router(config)#line aux ? <0-0> First line number Router(config)#line aux 0 Router(config-line)#login Router(config-line)#password 123
Console Password
配置console密码以及一些辅助命令: Router#conf t Router(config)#line console ? <0-0> First line number Router(config)#line console 0 Router(config-line)#login Router(config-line)#password 123 Router(config-line)#exec-timeout ? <0-35791> Timeout in minutes Router(config-line)#exec-timeout 0 ? <0-2147483> Timeout in seconds Router(config-line)#exec-timeout 0 0 Router(config-line)#logging synchonous exec-timeout命令:如果X分钟X秒不活动的话将自动退出,默认是10分钟,0 0代表永远不自动退出 logging synchronous:光标跟随
Telnet Password
配置VTY密码:如果你的IOS不是企业版(Enterprise edition),默认你只能有5条VTY线路,线路0到4.配置如下: Router(config-line)#line vty 0 ? <1-4> Last Line Number Router(config-line)#line vty 0 4 Router(config-line)#login Router(config-line)#password 123