CCNA中文笔记第4章IOS介绍 联系客服

发布时间 : 星期四 文章CCNA中文笔记第4章IOS介绍更新完毕开始阅读1cf3742e2af90242a995e504

Set Passwords:

有5种密码用于加密你的Cisco router: 1.控制口(console) 2.辅助口(AUX) 3.VTY

4.enable password 5.enable secret

Enable Passwords

enable password:给console和AUX口加密,防止未授权用户进入特权模式,但是密码是非加密形式

enable secret:给console和AUX口加密,防止未授权用户进入特权模式,密码是加密形式,并且一旦起用了这个密码,将凌驾于enable password之上,如果同时设置了enable password和enable secret的情况下,必须输入不同的密码,如下:

Router(config)#enable secret 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

刚才说过了,如果你的VTY线路没有配置密码的话,你将无法telnet连上它,它会报

错:VTY线路没有配置密码.但是你可以取消VTY密码,这样就可以在没有密码的情况下进行telnet,处于安全考虑,此方法不推荐,配置如下: Router(config-line)#line vty 0 4 Router(config-line)#no login

Encryption Your Passwords

只有enable secret是加密的,当你在特权模式下输入sh running-config显示DRAM的配置文件时,其他密码将被罗列出来: Router#sh run (略)

!

enable secret jhdflkdfg$#sdf enable password 123 ! (略)

对密码进行加密:在全局配置模式下使用service password-encryption命令

Banners

banner类似标语,问候语.最常用的是MOTD(message of the day),分界符用于分隔信息,但是分隔符不能出现在MOTD信息中,如下: Router(config)#banner motd # The Router is mine #

Router(config)#^Z(Ctrl+Z) Router#exit

Router con0 is now available Press RETURN to get started The Router is mine Router>

其他的3种banner: 1.exec banner 2.incoming banner 3.login banner

Router Interfaces

配置router的接口,一般命令模式采用:interface type number的格式,比如:

Router(config)#int ethernet 0

但是Cisco的2600,3600,4000和7000等系列采用了物理卡槽和模块化的端口机制.因此,命令变化为:interface type slot/port,比如: Router(config)#int fastethernet 0 % Imcomplete command Router(config)#int fastethernet 0? /

Router(config)#int fastethernet 0/? <0-1> Fastethernet interface number Router(config)#int fastethernet 0/1

配置连接器的介质类型,使用media-type命令,不过这个一般是自动检测,如下: Router(config)#int fa 0/0

Router(config-if)#media-type ?

100BaseX Use RJ45 for -TX; SC F0 for –FX MII Use MII connector

Bring Up an Interface

打开和关闭1个接口,分别使用shutdown和no shutdown命令,当你关闭某个接口的时候,使用sh interfaces命令可以查看接口状态,并且你将看到以下输出: Router#sh int e0

Ethernet0 is administratively down,line protocol is down (略)

接口是关闭的,所以你要手动打开它,如下:

Router#conf t

Router(config)#int e0 Router(config-if)#no shut Router(config-if)#^Z

Router#sh int e0

Ethernet is up,line protocol is up (略)

Configuring an IP Address on an Interface

给某个接口配置IP地址,使用ip address [address] [mask]命令,如下: Router(config)#int e0

Router(config-if)#ip address 172.16.10.2 255.255.255.0 记得把接口打开: Router(config-if)#no shut

Router(config-if)#^Z

如果你需要在1个接口添加第二个子网地址,在末尾使用secondary参数,这将替换现有IP地址,如下:

Router(config)#int e0

Router(config-if)#ip address 172.16.20.2 255.255.255.0 secondary Router(config-if)#^Z 来验证下: Router#sh run (略) !

interface Ethernet0

ip address 172.16.20.2 255.255.255.0 secondary ip address 172.16.10.2 255.255.255.0 !

Serial Interface Commands

Serial口一般是连接在CSU/DSU等类型的提供时钟频率的设备上.但是,假如你在个实验环境里采用了背对背配置,那么1端将作为DCE设备提供时钟频率.默认Cisco的router都是DTE,所以你必须让1个serial接口来提供时钟频率,采用的命令是:clock rate,如下: Router(config)#int s0 Router(config-if)#clock rate ? Speed (bits per second) 1200 (略) 56000