路由基础配置命令

发布时间:2020-06-12 06:23:36   来源:文档文库   
字号:

路由基础配置命令

UTP双绞线类型:

直通线

交叉线

广域网线缆连接类型:

DTE

DCE:

时钟速率:

路由器的接口:(作用)

1. 广域网接口: serial

2. 内网接口: fastethernet

3. 管理接口: console (控制台) AUX(备份)

连接两个设备:

1. 物理连接

2. 逻辑连接

配置网络设备:

1. 管理属性:用户名 密码 描述 警告

2. 协议地址:IP IPX

3. 协议策略:vlan 静态 访问控制

交换机 直接可以应用

路由器 需要初始配置才能应用

设备启动过程:

1. 加电自检

2. 查找加载操作系统

3. 查找加载配置文件

配置网络设备方式:

1. 初始配置:console

2. 初始配置后通过interface(拥有ip地址的接口):

1telnet

2TFTP

3WEB

4)网络管理工具: SNA SDM

配置直接应用到内存

登陆路由器:

Router>

Router>enable /*进入特权模式

Router#

Router#disable /*退出特权模式

Router>

Router>logout /*退出路由器

Router>exit /*退出路由器

路由器IOS帮助功能:?的三个用法

1/ 直接问号

2/

Router#cl?

clear clock

Router#cl

3/

Router#clock

% Incomplete command.

Router#clock ?

set Set the time and date

Router#clock

问号的帮助功能:(查找路由器设置时间的命令并设置时间)

Router#cl?

clear clock

Router#clock

% Incomplete command.

Router#clock ?

set Set the time and date

Router#clock set

% Incomplete command.

Router#clock set ?

hh:mm:ss Current Time

Router#clock set 11:04:50

% Incomplete command.

Router#clock set 11:04:50 ?

<1-31> Day of the month

MONTH Month of the year

Router#clock set 11:04:50 15

% Incomplete command.

Router#clock set 11:04:50 15 ?

MONTH Month of the year

Router#clock set 11:04:50 15 09

^

% Invalid input detected at '^' marker.

Router#clock set 11:04:50 15 ?

MONTH Month of the year

Router#clock set 11:04:50 15 sep ?

<1993-2035> Year

Router#clock set 11:04:50 15 sep 2009

Router#

Router#clok

Translating "clok"...domain server (0.0.0.0)

% Unknown command or computer name, or unable to find computer address

Router#clok /* 输入快捷键 Ctrl+Shift+6

Translating "clok"...domain server (0.0.0.0) % Name lookup aborted

Router#clock sit

^

% Invalid input detected at '^' marker.

Router#

Router#clock s?

set

Router#clock s

Router#show history /*查看输入的历史命令

clock set 10:41:30

clock set 10:41:30 22

clock set 10:41:30 22 dec 2009

clok

clock sit

configure terminal

clo

configure terminal

history

show history

Router#

查看操作系统版本

Router#show version

查看配置文件

1. 查看正在运行的配置文件 工作在内存 RAM

Router#show run

2. 查看启动的配置文件存储过的配置文件 NVRAM

Router#show start

Router#show startup-config

startup-config is not present /*没有启动的配置文件

Router#

路由器的硬件

RAM 内存

NVRAM存储配置文件

FLASH存储IOS

ROM类似计算机BIOS

Interface

CPU

保存路由器的配置文件

Router#copy run start

Destination filename [startup-config]?

Building configuration...

[OK]

Router#write

Building configuration...

[OK]

Router#

重新启动路由器

Router#reload

Proceed with reload? [confirm]

设置路由的标识符

1. 路由器的名称

Router#conf t

Router(config)#hostname R1

R1(config)#

2. 每日欢迎信息

R1(config)#banner motd # This is R1, shenyang ,Don't shutdown it!! #

重新登录路由器

3. 端口描述

R1(config)#interface serial 0/0/0 (进入接口的子模式)

R1(config-if)#description To R2 S0/0/0 端口的描述信息

R1(config-if)#

查看端口信息

R1#show interfaces fastEthernet 0/0

R1#show run

路由器的密码:

1. 控制台管理接口的密码:

R1(config)#line console 0 (进入console接口的配置模式)

R1(config-line)#password cisco (密码是cisco)

R1(config-line)#login (登陆过程中,检查密码)

R1(config-line)#

2. 用户到特权模式的密码

R1(config)#enable password 1234 (明文方式显示密码)

R1(config)#enable secret 4321 (加密方式显示密码,权限比明文高)

3. 删除密码:

R1(config)#no enable password

R1(config)#no enable secret

4. 启动密码的加密服务:

R1(config)#service password-encryption

Console接口有用的命令

1.设置超时时间

R1(config)#line con 0

R1(config-line)#exec-timeout 0 0

2. 设置console的同步

R1(config)#line con 0

R1(config-line)#logging synchronous

3. 关闭路由器名称查找功能

R1(config)#no ip domain-lookup

Router#adfdsaf

Translating "adfdsaf"

% Unknown command or computer name, or unable to find computer address

Router#

设置路由器的协议地址

1. 配置路由器广域网接口serial

R1(config)#interface serial 0/0/0

R1(config-if)#exit

R1(config)#int s0/0/0

R1(config-if)#clock rate 64000 设置时钟输率

R1(config-if)#bandwidth 64 设置接口带宽

启动路由器的接口

R1(config-if)#no shutdown 开启接口

R1(config-if)#

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up (接口的物理层UP)

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up 接口的数据链路层UP

R1(config-if)#

配置接口的ip地址

R1(config)#int s0/0/0

R1(config-if)#ip address 12.1.1.1 255.255.255.0

R1(config-if)#no shutdown 开启接口

测试接口的连通性

R1#ping 12.1.1.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms

R1#

查看端口的状态

R1# show int s0/0/0

Serial0/0/0 is up, line protocol is up (connected)

Hardware is HD64570

Description: To R2 S0/0/0

Internet address is 12.1.1.1/24

MTU 1500 bytes, BW 64 Kbit, DLY 20000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Encapsulation HDLC, loopback not set, keepalive set (10 sec)

Last input never, output never, output hang never

Last clearing of "show interface" counters never

Input queue: 0/75/0 (size/max/drops); Total output drops: 0

Queueing strategy: weighted fair

Output queue: 0/1000/64/0 (size/max total/threshold/drops)

Conversations 0/0/256 (active/max active/max total)

Reserved Conversations 0/0 (allocated/max allocated)

Available Bandwidth 48 kilobits/sec

5 minute input rate 5 bits/sec, 0 packets/sec

5 minute output rate 5 bits/sec, 0 packets/sec

5 packets input, 640 bytes, 0 no buffer

Received 0 broadcasts, 0 runts, 0 giants, 0 throttles

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

5 packets output, 640 bytes, 0 underruns

0 output errors, 0 collisions, 2 interface resets

0 output buffer failures, 0 output buffers swapped out

0 carrier transitions

DCD=up DSR=up DTR=up RTS=up CTS=up

R1#

查看接口连接线缆的类型:

R1#show controllers serial 0/0/0

Interface Serial0/0/0

Hardware is PowerQUICC MPC860

DCE V.35, clock rate 64000

idb at 0x81081AC4, driver data structure at 0x81084AC0

SCC Registers:

.... ....

R2#show controllers serial 0/0/0

Interface Serial0/0/0

Hardware is PowerQUICC MPC860

DTE V.35 TX and RX clocks detected

idb at 0x81081AC4, driver data structure at 0x81084AC0

SCC Registers:

........

接口状态的提示

R3#show int serial 0/3/0 /* 默认关闭的端口或手工关闭的端口

Serial0/3/0 is administratively down, line protocol is down (disabled)

........

Router#show int s0/0/0 /* 端口物理层有问题远端接口没有开启

Serial0/0/0 is down, line protocol is down (disabled)

........

Router#show int s0/0/0 /* 物理层工作正常数据链路层有问题1.时钟速率 2.端口的封装类型 3.Keeplive 周期不一样

Serial0/0/0 is up, line protocol is down (disabled)

........

Router#show int s0/0/0 /* 物理层工作正常数据链路层工作正常

Serial0/0/0 is up, line protocol is up (connected)

远程管理网络设备

设置远程登录的密码

R1#conf t

R1(config)#line vty 0 4

R1(config-line)#password 5678

R1(config-line)#login

R1(config-line)#exit

R1(config)#enable password cisco

在计算机上

PC>telnet 12.1.1.1

Trying 12.1.1.1 ...Open

User Access Verification

Password:

R1>enable

% Error in authentication. /* 缺少用户模式到特权模式的密码

R1>enable

Password:

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#exit

R1#exit /* 退出telnet会话

[Connection to 12.1.1.1 closed by foreign host]

PC>

本文来源:https://www.2haoxitong.net/k/doc/1b96f742670e52ea551810a6f524ccbff021ca63.html

《路由基础配置命令.doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式