文档库 最新最全的文档下载
当前位置:文档库 › CCNA笔记:IOS介绍(二)

CCNA笔记:IOS介绍(二)

CCNA笔记:IOS介绍(二)
CCNA笔记:IOS介绍(二)

CCNA笔记:IOS介绍(二)

只有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

64000

(略)

Router(config-if)#clock rate 64000

% Error: This commands applies only to DCE interfaces Router(config-if)#int s1

Router(config-if)#clock rate 64000

确定serial接口是否是DCE线缆使用sh controllers命令,如下:

Router>sh controllers s 0

HD unit 0, idb=0x297DE8, driver structure at 0x29F3A0

Buffer size 1524 HD unit 0, V.35 DCE cable

Cisco的router的默认serial连接带宽是T-1(1.544Mbps).有的路由协议要以带宽做为度来进行衡量,所以,我们给它配置带宽,使用bandwidth命令,注意参数单位是kb,如下:

Router(config-if)#bandwidth ?

<1-10000000> Bandwidth in kilobits

Router(config-if)#bandwidth 64

Hostnames

给router配置主机名,使用hostname命令,这个是本地标志,不影响router在Internet上的工作,注意回车立即生效,如下: Router(config)#hostname Noko

Noko(config)#hostname Noco

Noco(config)#

Descriptions

description命令:本地标志,可以给接口加描述,以便用于区分,如下:

Noco(config)#int e0

Noco(config-if)#description Sales LAN

Noco(config-if)#^Z

来验证下:

Noco#sh int e0

(略)

Description: Sales LAN

(略)

Viewing and Saving Configurations

将running-config(DRAM)的文件复制到startup-config(NVRAM)里,使用copy running-config startup-config命令:

Noco#copy run start

可以使用erase startup-config命令删除startup-config文件,如下:

Noco#erase startup-config

(略)

Noco#sh start

%% Non-volatile configuration memory is not present

假如在这个情况下在特权模式使用reload命令重新启动router,将进入setup模式

Verifying Your Configuration

ping:采用了ICMP echo requests和replies

traceroute:使用ICMP和IP TTL来跟踪包所经过的路径

Verifying with the show ip interface Command

show ip interface:提供router接口的层3信息,包括:

1.接口状态

2.IP地址和掩码

3.访问列表(access-list)信息

4.一些其他的基本的IP信息

Using the show ip interface brief Command

show ip interface brief:和show ip interface类似,只是提供简洁点的总结信息

Using the show controllers Command

sh controllers:显示物理接口的信息,还提供serial口线缆信息,如下:

Router#sh controllers serial 0/0

(略)

buffer size 1524 HD unit 0, V.35 DTE cable

(略)

Router#sh controllers serial 0/1

(略)

buffer size 1524 HD unit 1, V.35 DCE cable

(略)

相关文档