路由器最基本考试配置命令

enable 从非特权模式进入特权模式
conf t 进入全局配置模式
hostname RX 配置一个路由器的名字
no ip domain-lookup 去消域名解析
ip classless 支持可变长子网掩码长度
ip subnet-zero 支持零子网
int fa2/0 配接口
ip address 201.0.0.1 255.255.255.0 IP地址
no shutdown 激活
end 返回特权模式
show ip interface brief 显示接口的状况



路由器基本配置命令语法
为路由器命令 Router(config)#hostname 'name
设置口令 Router(config)#enable secret 'password 设置进入特权执行模式的加密口令
Router(config)#Line console 0 进入控制台线路的线路配置模式
Router(config-line)#password 'password设置控制台口令
Router(config-line)#Login 来要求登录时输入口令
Router(config)#line vty 0 4 进入所有五条虚拟终端线路的线路配置模式
Router(config-line)#password 'password 设置 vty 口令
Router(config-line)#login 来要求登录时输入口令
按 Ctrl+z 退出配置模式。输入命令 copy running-config startup-config,将更改保存到 NVRAM。出现提示时,按 Enter 确认目标文件名
配置登录提示文字 Router(config)#banner motd # 'message #
配置接口 Router(config)#interface 'type number
Router(config-if)#ip address 'address mask
Router(config-if)#description 'description
Router(config-if)#no shutdown
保存路由器更改 Router#copy running-config startup-config
检查show命令的输出 Router#show running-config
Router#show ip route
Router#show ip interface brief
Router#show interfaces



路由器第一次启动时会进入设置模式,以便用户执行基本路由器配置。Packet Tracer 仅支持基本的管理设置,因此您只能配置一个接口来连接到管理系统,从而通过该系统执行其余配置。
清除所有现有配置:
Router>enable
Router#erase startup-config
重新启动路由器:
Router>enable
Router#reload
输入 yes 确认使用配置对话框 Continue with configuration dialog? [yes/no]: yes configuration:n. 配置;结构;外形 dialog:n. 对话;会话
键入 yes 以便输入基本管理设置 Would you like to enter basic management setup? [yes/no]: yes
输入 class 作为使能加密口令 Enter enable secret: class
输入 cisco 作为使能口令 Enter enable password: cisco
输入 cisco 作为虚拟终端口令 Enter virtual term

inal password: cisco
输入 FastEthernet0/0 作为用来连接到管理网络的接口 Enter interface name used to connect to the
management network from the above interface summary: FastEthernet0/0
接受默认设置以将此配置保存到 nvram 并退出 Save this configuration to nvram and exit



输入命令 enable secret class,设置进入特权执行模式的加密口令。
输入命令 line con 0 进入控制台线路的线路配置模式。注意提示符发生了改变。
输入命令 password cisco 设置控制台口令。输入命令 login 来要求登录时输入口令。输入命令 exit 返回全局配置模式。
输入命令 line vty 0 4 进入所有五条虚拟终端线路的线路配置模式。输入命令 password cisco 设置 vty 口令。输入命令 login 来要求登录时输入口令。
按 Ctrl+z 退出配置模式。输入命令 copy running-config startup-config,将更改保存到 NVRAM。出现提示时,按 Enter 确认目标文件名。




校验配置:
show running-config
show startup-config
show ip route
show interfaces
show ip interface brief


路由器创建路由表时会首先添加自身接口上配置的 IP 地址所在的网络。这些网络是与该路由器直接相连的网络。
当所有的接口均已配置有正确的地址,但接口状态为shutdown,是不是在激活这些接口是不需在ip address ip mask?

静态路由由网络管理员配置,包括远程网络的网络地址和子网掩码,以及下一跳路由器的 IP 地址或本地路由器的送出接口。
路由器能够通过静态路由或动态路由获知远程网络。
Router>enable
Router#show ip route
Router#configure terminal
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1
Router(config)#end
静态路由是由网络管理员配置的,它包括:
? 网络地址。
? 远程网络的子网掩码。
? 下一跳路由器的 IP 地址或本地路由器的送出接口。
动态路由协议可让路由器从其它路由器那里自动获知远程网络。通过路由协议获知的网络以及到达每个网络的最佳路径会自动加入路由表中。















一、用户模式
Router>
二、特权模式
Router>enable
password:
Router#
三、设置模式
四、全局配置模式
Router#configure terminal
Enter configuration commands,one per line,End with CNTL/Z
Router(config)#
五、其它配置模式
1、接口配置模式
Router(config)#int f0/12
Router(config-if)#
2、虚拟终端配置模式
Router(config)#line vty 015
Router(config-line)#
3、RIP路由协议配置模式
Router(config)#router rip
Router(config-router)#
六、RXBOOT模式








设置系统时钟
Router#calendar set 10:24:00 22 march 2007
保存配置
Router#write memory
Router#write networktftp
删除配置
Router#write erase
网络的基本检测命令
1、telnet
Router>telnet paris
Router>
2、ping
Router>p

ing 182.105.130.110
Type escape sequenc to abort.
Sending 5,100-byte ICMP Echos to 182.105.130.110,timeout is 2 seconds:
!!!!!
Success rate is 100 percent(5/5),round-trip min/avg/max=4/4/4ms
3、trace
Router>trace 137.189.11.73

Router>traceroute https://www.360docs.net/doc/1e12706162.html,
4、show
a、查看flash:
Router>show flash
System flash directory:
File length Name/status
......
b、查看系统时钟
Router>show clock
*23:36:09.614 UTC Thu Apr 14 1994
Router>
c、查看路由器软、硬件版本
Router>show version
Cisco internetwork Operating System Software
.................
d、查看路由器配置
Router#show configuration
Using 6907 out of 32762 bytes
!.............
e、查看路由表
Router#show ip route
f、查看IP路由协议的详细信息:
Router#show ip protocols
Routing Protocol is "rip"
...........


接口配置
1、配置接口描述信息
Router(config)#int g6/0
Router(config-if)#description To-Beijing Roreign Studies University
Router(config-if)#
(注:描述信息说明该接口连接到北京外国语大学)
2、配置接口带宽
Router(config)#interface POS3/0
Router(config-if)#bandwidth 2500000 (设置接口带宽为2.5Gbps)
Router(config-if)#
3、配置接口的IP地址
Router(config)#interface f2/3
Router(config-if)#ip address 202.112.7.249 255.255.255.252
Router(config-if)#
4、接口的开启与关闭
Router(config)#interface f2/3
Router(config-if)#shutdown (关闭接口)
Router(config-if)#
Router(config-if)#no shutdown (开启接口)
Router(config-if)#

局域网接口配置
1、配置标准以太网接口
Router(config)#interface Ethernet0
Router(config-if)#description To HuabeiDiQuWANG
Router(config-if)ip address 202.112.7.4 255.255.255.0
Router(config-if)#bandwidth 10000
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#
2、配置快速以太网接口
Router(config)#interface f2/1
Router(config-if)#description To-XianDaiKuan-YuanXiao
Router(config-if)#ip address 202.112.41.145 255.255.255.240
Router(config-if)#bandwidth 100000
Router(config-if)#duplex full
Router(config-if)#no ip directed-broadcast
Router(config-if)#no ip proxy-arp
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#
3、配置千兆以太网接口
Router(config)#interface g0/1
Router(config-if)#description To-BeiJingWaiGuoYuDaXue
Router(config-if)#ip address 202.112.41.49 255.255.255.252
Router(config-if)#bandwidth 1000000
Router(config-if)#duplex full
Router(config-if)#no ip directed-broadcast
Router(config-if)#no ip proxy-arp
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#

广域网接口配置
1、配置异步串行接口
Router(config)#interface a1
Router(config-if)#ip unnumbered ethernet0
Router(config-if)#iencapsulation ppp
Router(config-if)#async default ip address 202.332.7.129
Router(config-if)#async dynamic routing
Router(config-if)#async

mode interactive
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#
2、配置高速同步串行接口
Router(config)#interface s1/1
Router(config-if)#description To-shenzhen
Router(config-if)#bandwidth 2048 (带宽为2M)
Router(config-if)#ip address 212.112.41.81 255.255.255.252
Router(config-if)#encapsulation hdlc (封装HDLC或PPP协议,HDLC为缺省值)
Router(config-if)#no ip directed-broadcast
Router(config-if)#no ip proxy-arp
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#
3、配置POS接口
Router(config)#interface POS3/0
Router(config-if)#description To TianJingDaXue
Router(config-if)#bandwidth 2500000
Router(config-if)#ip address 212.12.37.18 255.255.255.252
Router(config-if)#crc 32
Router(config-if)#pos framing sdh
Router(config-if)#no ip directed-broadcast
Router(config-if)#pos flag s1s0 2

Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#exit
Router#

loopback接口的配置
Router(config)#int loopback 0
Router(config-if)#ip address 192.167.167.6 255.255.255.255
Router(config-if)#no ip route-cache
Router(config-if)#no ip mroute-cache
Router(config-if)#exit
Router(config)#exit
Router#


静态路由的配置
命令格式:ip route <目的网络地址><子网掩码><下一跳路由器的IP地址>
Router(config)#ip route 59.65.96.0 255.255.240.0 222.112.37.1
Router(config)#


动态路由配置
一、RIP动态路由协议的配置
1、RIP的基本配置
Router(config)#router rip
Router(config-router)#network 159.105.0.0
Router(config-router)#network 212.112.7.0
Router(config-router)#exit
Router(config)#exit
Router#
2、RIP的高级配置
a、配置被动接口
Router(config)#router rip
Router(config-router)#passive-interface ethernet 0
Router(config-router)#exit
Router(config)#exit
Router#
b、配置路由过滤
Router(config)#access-list 12 deny any
Router(config)#router rip
Router(config-router)#distribute-list 12 in ethernet0
Router(config-router)#end
Router#
c、配置管理距离
Router(config)#router rip
Router(config-router)#distance 50
Router(config-router)#exit
Router(config)#exit
Router#
d、定义邻居路由器
Router(config)#router rip
Router(config-router)#neighbor 202.112.7.2
Router(config-router)#exit
Router(config)#exit
Router#
二、OSPF动态路由协议的配置
1、OSPF的基本配置
(1)使用network命令定义参与OSPF的子网地址
a、单个IP地址参与OSPF
Router(config)#router ospf 63
Router(config-router)#network 131.107.25.1 0.0.0.0 area 0
Router(config-router)#exit
Router(config)#exit
Router#
b、网络地址参与OSPF
Router(config)#router ospf 63
Router(config-router)#network 133.181.0.0 0.0.255.255 area 0
Router(config-router)#exit
Router(config)#exit
Router#
(2)使用area range命令定义参与OSPF的子网地址
Router(config)#router ospf 63
Router(config-router)#area 0 range 212.37.123.0 2

55.255.255.0
Router(config-router)#exit
Router(config)#exit
Router#
2、几个常用OSPF参数的配置
(1)配置被动接口
a、路由器的配置命令
Router(config)#router ospf 63
Router(config-router)#passive-interface ethernet 0
Router(config-router)#end
Router#
b、第三层交换机的配置命令
Router(config)#router ospf 63
Router(config-router)#passive-interface vlan37
Router(config-router)#end
Router#
(2)配置路由过滤
Router(config)#access-list 12 deny any
Router(config)#router ospf 63
Router(config-router)#distribute-list 12 in serial 0
Router(config-router)#end
Router#
(3)配置管理距离
Router(config)#router ospf 63
Router(config-router)#distance 10
Router(config-router)#end
Router#
(4)配置引入外部路由到OSPF的参数
a、配置OSPF引入外部路由的花费值
Router(config)#router ospf 63
Router(config-router)#redistribute metric 100
Router(config-router)#end
Router#
b、配置引入外部路由时缺省的标记值
Router(config)#router ospf 63
Router(config-router)#redistribute tag 10
Router(config-router)#end
Router#
c、配置引入外部路由时缺省的外部路由类型
Router(config)#router ospf 63
Router(config-router)#redistribute connected metric-type 1 subnets
Router(config-router)#end
Router#
3、一个OSPF路由协议的配置信息
(1)路由器的OSPF路由协议的配置信息
router ospf 63
area 0 range 166.105.0.0 255.255.0.0
area 0 range 212.112.7.0 255.255.255.0
...........

相关文档
最新文档