-
目录
实验一
路由器基本配置
.
< br>............................................... .................................................. ...............1
实验二
静态路由
.
..................................................
..................................................
........................3
实验三
缺省路由
.
..................................................
..................................................
........................5
实验四
静态路由
&
缺省路由
&CDP
协议
...............................
..................................................
.....7
实验五
三层交换机实
现
VLAN
间通信
< br>............................................... .........................................9
实验六
Vtp
.
....................................
..................................................
..............................................
1
1
实验七
生成树
STP
..........
..................................................
..................................................
.........13
实验八
RIP
路由协议
1
< br>.
...................................
..................................................
...........................17
实验九
RIP
路由协议
2
< br>.
...................................
..................................................
...........................19
实验十
OSPF
单区域
1 ........
..................................................
..................................................
.....21
实验十一
OSPF
单区域
2 ........
..................................................
..................................................
.22
实验十二
OSPF
单区域
3 ........
..................................................
..................................................
.24
实验十三
EIGRP ..
..................................................
..................................................
.....................26
实验十四
ACL
标准访问控制列表
............................................ .................................................. 29
实验十五
扩展
ACL -1
.
..............................................
..................................................
.................31
实验十六
扩展
ACL -2
.
..............................................
..................................................
.................33
实验十七
专家级访问控制列表
.......
..................................................
..........................................36
实验十八
动态
NAT ......................
..................................................
..............................................37
实验十九
NAT
地址转换
.........
..................................................
..................................................
.39
实验二十
单臂路由
.
..................................................
..................................................
..................41
实验二十一
PPP chap
认证
.
.................................
..................................................
.......................43
实验二十二
研究应用层和传输层协议
.....
..................................................
................................44
实验二十三
检查路由
.
..................................................
..................................................
..............45
实验二十四
研究
ICMP
数据包
........................
..................................................
.......................47
实验二十五
研究第
2
层帧头
.............
..................................................
......................................49
实验二十六
地址解析协议
(ARP)
.
...............................
..................................................
.............50
实验二十七
中间设备用作终端设备
......
..................................................
...................................52
实验二十八
管理设备配置
..........
..................................................
...............................................54
实验一
路由器基本配置
一
< br>、
实
验
设
备
一台路由器,一台
PC
,配置线一条。
二
、
实
p>
验
要
求
1.
更改路由器名称为
RA
2.
设置
p
assword
为
cisco1,secret
为
cisco2,vty
为
c
isco3,
并要求所有密码都加密。
3.
关闭域名查找,命令输入同步。
4.
配置以太网口的
IP
为
202.119.249.219
5.
设置登陆提示信息
6.
对串行口进行描述(描述信息为:
welcome to
lixin lab
)
7.
将上述信息保存到
tftp server
8.
将实验过程配置写在记事本中进行粘贴。
9.
配置
V
TY
访问权限。
10.
禁止路由器进行域名解析。
三
、
实
p>
验
步
骤
Router>enable
Router#configure terminal
Router(config)#hostname RA
设置路由器名
RA(config)#enable password cisco1
设置密码
RA(config)#enable secret cisco2
设置加密密码
RA (config)#no ip domain-
lookup
关闭域名查找(当我们打错命令时,不会去查找
DNS
,造成延时)
RA
(config)#line console 0
RA (config-
line)#logging synchronous
命令输入达到同步(信息提示不会打断你的输入)
RA (config-line)#exec-timeout 0 0
设置永久不超时
RA
(config-line)#exit
RA(config)#line vty 0 4
RA(config-line)#
(
enable
)
password cisco3
设置<
/p>
vty
密码
1 / 55
RA(config-line)#exit
RA(config)#service password-encryption
对密码加密
RA(config)#int fastEthernet 0/0
RA(config-if)#ip address 202.119.249.1
255.255.255.0
对以太网口
fa0/0
配置
IP
RA(config-if)#no shutdown
开启端口
RA(config-
if)#exit
RA(config)#banner motd &
welcome welcome to ccna lab!!!
&
设置登陆提示信息
RA(config)#int fa0/1
RA(config-if)#description this is a
fast port
描述端口信息
RA(config-
if)#exit
RA(config)#copy running-config
tftp
把信息保存到
tftp
2 / 55
实验二
静态路由
一
、
实
验
设
备<
/p>
两台
28
系列
型号路由器通过串口相连。
二
、
p>
实
验
要
求
在
R1
和
R2
上启用动态路由,使两端网络能够互通。
R1
为
DCE
端,
R2
为
DTE
端。
三
、
实
验
步
骤
<
/p>
1
.
基
本
配
置
(
以
后
的
实
验
基
本
配
置
全
部
省
略
)
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#logging synchronous
R1(config-line)#exec-
timeout 0 0
R1(config-line)#exit
2
.
在
p>
R
1
上
配
置
接
口
I
P
地
址
和
< br>时
钟
频
率
R1(config)#int s1/0
R1(config-if)#ip address 20.0.0.1
255.255.255.0
R1(config-if)#clock rate
64000
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#int fa0/1
R1(config-if)#ip address 10.0.0.1
255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
3
.
在
p>
R
2
上
配
置
接
口
I
P
地
址
R2(config)#
R2(config)#int
s1/0
R2(config-if)#ip address 20.0.0.2
255.255.255.0
3 / 55
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#int fa0/1
R2(config-if)#ip address 30.0.0.1
255.255.255.0
R2(config-if)#no shutdown
4
.
在
p>
R
1
和
R
2
上
配
置
静
态
路
由
< br>
R1(config)#ip route 30.0.0.1
255.255.255.0 20.0.0.2
R2(config)#ip
route 10.0.0.1 255.255.255.0 20.0.0.1
【
注
意
事
p>
项
】
1
.
R
p>
(
c
o
n
f
i
g
)
#
i
p
< br>r
o
u
t
e
目
标
网
络
子
网
p>
掩
码
下
一
跳
接
口
2
.
< br>在
D
C
E
端
设
置
时
钟
频
率
。
3
.
电
p>
脑
网
关
不
要
忘
记
设
置
4
.
V
p>
.
3
5
连
接
2
台
路
由
器
,
路
< br>由
器
的
串
口
灯
应
亮
的
,
如
果
不
p>
亮
请
插
紧
线
缆
或
更
换
线
缆
。
< br>
5
.
学
会
用
s
h
o
w
排
错
p>
?
R
o
u
t
e
r
1
#
s
< br>h
o
w
i
n
t
e
r
f
a
c
e
p>
s
s
e
r
i
a
l
1
/
2
p>
查
看
接
口
的
状
态
。
?
R
< br>o
u
t
e
r
1
#
s
h
o
w
i
p
i
p>
n
t
e
r
f
a
c
e
b
r
i
< br>e
f
?
R
o
p>
u
t
e
r
1
#
s
h
o
w
i
p
r
p>
o
u
t
e
6
.
如
果
连
线
的
< br>接
头
没
有
标
识
是
D
T
E
接
头
还
p>
是
D
C
E
接
头
,
用
下
面
的
命
< br>令
查
看
两
个
s
e
r
i
a
l
口
的
p>
情
况
,
方
法
为
:
R
o
u
t
< br>e
r
#
s
h
o
w
c
o
n
t
r
p>
o
l
l
e
r
s
e
r
i
a
l
< br>
p
o
r
t
_
n
u
m
b
e
r
p>
7
.
或
者
把
线
缆
拧
开
,
针
的
< br>一
头
是
D
T
E
,
洞
的
一
头
是
D
p>
C
E
。
4 /
55
实验三
缺省路由
一
、
实
验
设
备<
/p>
3
台
28
p>
系列型号路由器通过串口相连。
二
、
实
验
要
求
三台
2811
通过缺省路由使全网互通。
三
、
实
p>
验
步
骤
R
1
的
基
本
配
置
:
< br>
R1#conf t
R1#(config)#
int fa0/0
R1#(config-if)# ip add
192.168.0.1 255.255.255.0
R1#(config-
if)# exit
R1#(config)# int fa0/1
R1#(config-if)# ip add 192.168.3.1
255.255.255.0
R1#(config-if)# exit
R1#(config)# int s0/0/0
R1#(config-if)# ip add 192.168.1.1
255.255.255.0
R1#(config-if)# no shut
R1#(config-if)# clock rate 64000
R
2
的
p>
基
本
配
置
:
R2#conf t
R2(config)# int fa0/0
R2(config-if)# ip add 192.168.4.1
255.255.255.0
R2(config-if)# exit
5 / 55
R2(config)# int s0/0/0
R2(config-if)# ip add 192.168.1.2
255.255.255.0
R2(config-if)# no shut
R2(config-if)# exit
R2(config)# int s0/0/0
R2(config-if)# ip add 192.168.1.2
255.255.255.0
R2(config-if)# no shut
R2(config-if)# exit
R2(config)# int s0/0/1
R2(config-if)# ip add 192.168.2.1
255.255.255.0
R2(config-if)# no shut
R2(config-if)# clock rate 64000
R
3
的
p>
基
本
配
置
:
R3#conf t
R3#(config)# int fa0/0
R3#(config-if)# ip add 192.168.6.1
255.255.255.0
R3#(config-if)# exit
R3#(config)# int fa0/1
R3#(config-if)# ip add 192.168.5.1
255.255.255.0
R3#(config-if)# exit
R3#(config)# int s0/0/1
R3#(config-if)# ip add 192.168.2.2
255.255.255.0
R3#(config-if)# no shut
缺
省
p>
路
由
配
置
:
R1(config)# ip
route
0.0.0.0
0.0.0.0
192.168.1.2
R2(config)# ip
route
0.0.0.0
0.0.0.0
192.168.1.1
R2(config)# ip
route
0.0.0.0
0.0.0.0
192.168.2.2
R3(config)# ip
route
0.0.0.0
0.0.0.0
192.168.2.1
6 /
55
实验四
静态路由
&
缺省路由
&CDP
协议<
/p>
一
、
实
验
设
备
三台
28
系列型号路由器通过串口相连。
二
、
实
验
要
求
< br>三台路由连接
5
个网段,配置静态路由和缺省路由。
p>
R2
为
DCE
端。
三
、
p>
实
验
步
骤
Router>en
Router#conf t
Router(config)# hostname R1
R1(config)#int fa0/1
进入
fa
0/1
端口
R1(config-
if)#ip address 192.168.0.1 255.255.255.0
添加
fa
0/1
口的
IP
R1(config-if)#no shutdown
打开
fa0/1
端口
R1(config-if)#exit
R1(config)#int s1/0
R1(config-if)#
ip address 192.168.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-
if)#exit
R1(config)#ip route
0.0.0.0
0.0.0.0
192.168.1.2
添加缺省路由
Router>en
Router#conf t
Router(config)# hostname R2
R2 (config)#int fa0/1
R2 (config-if)#ip address
192.168.4.1
255.255.255.0
R2 (config-if)#no shutdown
R2 (config-
if)#exit
R2 (config)#int s1/0
7 / 55
R2
(config-if)#ip address 192.168.1.2
255.255.255.0
R2 (config-if)#clock rate 56000
设置时钟
R2 (config-if)#no shutdown
R2 (config-
if)#exit
R2 (config)#int s1/1
R2
(config-if)#ip address 192.168.2.1
255.255.255.0
R2 (config-if)#clock rate
56000
R2 (config-if)#no shut
R2
(config-if)#exit
R2
(config)#ip route 192.168.0.0
255.255.255.0
192.168.1.1
添加静态路由
R2 (config)#ip route 192.168.3.0
255.255.255.0
192.168.2.2
添加静态路由
Router>en
Router#conf t
Router(config)# hostname
R3
R3(config)#int fa0/1
R3 (config-if)#ip address 192.168.3.1
255.255.255.0
R3 (config-
if)#no shutdown
R3 (config-if)#exit
R3 (config)#int s1/0
R3 (config-if)#ip address 192.168.2.2
255.255.255.0
R3
(config-if)#no shut
R3
(config-if)#exit
R3 (config)#ip route
0.0.0.0
0.0.0.0
192.168.3.1
添加缺省路由
在
R2
上操作:
R2 #show cdp neighbors
查看邻居汇总信息
R2 #show
cdp neighbors
detail
查看所有邻居的详细信息
R2
#show cdp
显示<
/p>
CDP
信息
R2 #show cdp traffic
显示<
/p>
CDP
所用的数据包的信息
R2 #show cdp entry *
显示所有相邻路由器的所有信息
R2
#un all
关闭所有
DEBUG
信息
R2
#(config)#cdp run
启动
CD
P
协议
R2 #show cdp
interface
(
端口
)
显示该端口的
CDP
信息
R2 #clear cdp counter
清除
CD
P
计数器
R2 #debug
cdp packet
p>
启动
CDP
数据包调试模式
【
注
意
事
项
】
D
C
E
应
该<
/p>
在
路
由
器
2
的
的
两
个
接
口
上
都
配
置
时
钟
频
率
。
如
果
把
R
p>
1
作
为
D
C
E
,
就
只
需
要
配
< br>置
一
个
接
口
的
时
钟
频
率
了
。
p>
电
脑
的
网
关
地
址
需
要
设
置
正
< br>确
。
8 / 55
实验五
三层交换机实现
VLAN
间通信
一
、
实
验
设
备
2<
/p>
台
3560
三层交换机,
3
台电脑。
二
、
实
验
要
< br>求
使在同一
VLAN
里的计算机系统能跨交换机进行相互通信,而在不同
VLAN
里的计算
机系统也能进行相互通信。
三
、
实
p>
验
步
骤
第一步:
在交换机
SwitchA
上创建
Vlan 10
,并将
0/5
端口划分到
Vlan
10
中。
SwitchA #
configure terminal
!进入全局配置模式。
SwitchA(config)# vlan 10
!创建
Vlan
10
。
SwitchA(config-vlan)# name sales
!将
Vlan 10
命名为
sales
。
SwitchA(config-vlan)#exit
SwitchA(config)#interface fastethernet
0/5
!进入接口配置模式。
SwitchA(config-if)#switchport access
vlan 10
!将
0/5
端口划分到
Vl
an 10
。
第二步:
在交换机
SwitchA
上创建
Vlan 20
,并将
0/15
端口划分到
Vlan
20
中。
SwitchA(config)# vlan 20
!创建
Vlan
20
。
SwitchA(config-vlan)# name technical
!将
Vlan 20
命名为
technical
。
SwitchA(config-vlan)#exit
SwitchA(config)#interface fastethernet
0/15
!进入接口配置模式。
SwitchA(config-if)#switchport access
vlan 20
!将
0/15
端口划分到
V
lan 20
。
< br>第三步:
在交换机
SwitchA
上将与
SwitchB
相连的端口定义为
tag vlan
模式。
SwitchA(config)#interface fastethernet
0/24
!进入接口配置模式。
9 / 55
SwitchA(config-
if)#switchport mode trunk
!将
fastethernet
0/24
端口设为
tag
vlan
模式。
< br>第四步:
在交换机
SwitchB
上创建
Vlan 10
,并将
0/5
端口划分到
Vlan
10
中。
SwitchB #
configure terminal
SwitchB(config)# vlan 10
SwitchB(config-
vlan)# name sales
SwitchB(config-vlan)#exit
SwitchB(config)#interface fastethernet
0/5
SwitchB(config-
if)#switchport access vlan 10
第五步
:
在交换机
SwitchB
上将与
p>
SwitchA
相连的端口定义为
tag
vlan
模式。
SwitchB(config)#interface fastethernet
0/24
!进入接口配置模式。
SwitchB(config-if)#switchport mode
trunk
!将
fastethernet
0/24
端口设为
tag
vlan
模式。
< br>第六步:
验证
PC1
与
PC3
能互相通信,但
PC2
< br>与
PC3
不能互相通信。
C:>ping 192.168.10.30
!在<
/p>
PC1
的命令行方式下验证能
Ping<
/p>
通
PC3
。
C:>ping 192.168.10.30
!在<
/p>
PC2
的命令行方式下验证不能
Ping
通
PC3
。
第七步:
设置三层交换机
VLAN
间通讯。
SwitchA(config)# int vlan 10
!
创建虚拟接口
vlan 10
SwitchA(config-if)#ip address
192.168.10.1255.255.255.0
!
配置虚拟接口
vlan
10
的地址
SwitchA(config-if)#exit
SwitchA(config)# int vlan
20
!
创建虚拟接口
vlan 20
SwitchA(config-if)#ip address
192.168.20.1255.255.255.0
第
八步:
将
PC1
和
PC3
的默认网关设置为
192.168.10.1
,将
PC2
的默认网关设置为
192.168.20.1
第九步:
测试结果
< br>不同
VLAN
内的主机可以互相
PING
通
【
注
意
事
项
】
两
台
p>
交
换
机
之
间
相
连
的
端
口
应
该
< br>设
置
为
t
a
g
v
l
a
n
模
式
p>
。
需
要
设
置
P
C
的
网
关
10 / 55
实验六
Vtp
一
、
实
验
设
备<
/p>
三台三层交换机,一台二层交换机。
二
、
实
验
p>
要
求
能够学习到
vlan
信息。
三
、
实
p>
验
步
骤
在
S
W
1
上
的
配
置
< br>:
switch(config)#ho SW1
SW1(config) #int range fa0/1
–
3
SW1 (config-
if-range)# sw mo tr
SW1 (config-if-
range)#no shut
SW1 (config-if-
range)#exit
SW1 #vlan da
SW1
(vlan)#vtp domain gg
SW1 (vlan)#vtp
server
SW1 (vlan)#exi
SW1
#vlan da
SW1 (vlan)#vlan 10
SW1 (vlan)#vlan 20
在
< br>S
W
2
上
的
配
置
:
Switch(config)#ho SW2
SW2(config)#int f0/2
SW2
(config-if)#sw mo tr
SW2 (config-
if)#exi
11 / 55
SW2 #vlan da
SW2(vlan)#vtp
domain gg
SW2 (vlan)#vtp client
SW2 (vlan)#exi
在
S
W
3
上
的
p>
配
置
:
Switch(config)#ho SW3
SW3(config)#int f0/1
SW3
(config-if)#sw mo tr
SW3(config-if)#exi
SW3 #vlan da
SW3(vlan)#vtp
domain gg
SW3 (vlan)#vtp client
SW3 (vlan)#exi
在
S
W
4
上
的
p>
配
置
:
Switch(config)#ho SW4
SW4(config)#int f0/3
SW4
(config-if)#sw mo tr
SW4(config-if)#exi
SW4 #vlan da
SW4(vlan)#vtp
domain gg
SW4(vlan)#vtp client
SW4 (vlan)#exi
12
/ 55
实验七
生成树
STP
一
、
实
验
设
备
3
台
29
60
交换机,
2
台
2811
路由器。
二
、
实
验
要
求
启用
STP
,使网络正常运行。
三
、
实
验
p>
步
骤
步
骤
1
.
R
o
u
t
e
< br>r
1
基
本
配
置
R1(config)#interface e0/0
R1(config-if)#ip address 12.0.0.1
255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
步
< br>骤
2
.
R
o
u
t
e
r
1
基
本
配
p>
置
R2(config)#interface e0/1
R2(config-if)#ip address 12.0.0.2
255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
步
< br>骤
3
.
S
w
i
t
c
h
1
基
本
配
p>
置
13 /
55
SW1
上配置
VTP
,
TRUNK
:
SW1#vlan database
!进
入
VLAN DATEBASE
SW1(vlan)#vtp
server
<
/p>
!
配置
成为
VT
P SERVER
端
SW1(vlan)#vtp domain
!配置
V
TP
域
SW1(vlan)#vtp
pruning
!打开
VTP
修剪
SW1(vlan)#vtp v2-mode
!使用
V
2
版的
VTP
协议
SW1(vlan)#vtp password ambow
!配置
V
TP
密码
SW1(vlan)#vlan 10 name ambow_vlan_10
!创建
VLAN 10
SW1(vlan)#exit
SW1(config)#interface f0/10
!配置中继端口
SW1(config-if)#switchport trunk
encapsulation isl
SW1(config-if)#switchport mode trunk
SW1(config-if)#exit
SW1(config)#interface f0/11
!配置中继端口
SW1(config-if)#switchport trunk
encapsulation isl
SW1(config-if)#switchport mode trunk
SW1(config-if)#exit
步
骤
4
.
S
w
i
t
c
h
1
基
本
配<
/p>
置
SW2
上配
置
VTP
,
TRUNK
:
SW2#vlan
database
!
进入
VLAN
DATEBASE
SW2(vlan)#vtp
client
!配置成为
VTP
CLIENT
端
SW2(vlan)#vtp domain
!配置
V
TP
域
SW2(vlan)#vtp
pruning
!打
开
VTP
修剪
SW2(vlan)#vtp v2-mode
!使
用
V2
版的
VTP
协议
SW2(vlan)#vtp password
ambow
!配置
VTP
密码
SW2(vlan)#exit
SW2(config)#interface f0/10
!配置中继端口
SW2(config-if)#switchport trunk
encapsulation isl
SW2(config-
if)#switchport mode trunk
SW2(config-
if)#exit
SW2(config)#interface f0/12
!配置中继端口
SW2(config-if)#switchport trunk
encapsulation isl
SW2(config-
if)#switchport mode trunk
SW2(config-
if)#exit
步
骤
5
.
S
w
i
t
c
h
1
基
本
配
置
14 / 55
SW2
上配置
VTP
,
TRUN
K
:
SW2#vlan
database
!
进入
VLAN
DATEBASE
SW2(vlan)#vtp
client
!配置成为
VTP
CLIENT
端
SW2(vlan)#vtp domain
!配置
V
TP
域
SW2(vlan)#vtp
pruning
!打
开
VTP
修剪
SW2(vlan)#vtp v2-mode
!使
用
V2
版的
VTP
协议
SW2(vlan)#vtp password
ambow
!配置
VTP
密码
SW2(vlan)#exit
SW2(config)#interface f0/10
!配置中继端口
SW2(config-if)#switchport trunk
encapsulation isl
SW2(config-
if)#switchport mode trunk
SW2(config-
if)#exit
SW2(config)#interface f0/12
!配置中继端口
SW2(config-if)#switchport trunk
encapsulation isl
SW2(config-
if)#switchport mode trunk
步
骤
6
.
S
w
p>
i
t
c
h
1
基
本
配
置
SW3
上配置
VTP
,
TRUNK
:
SW3#vlan
database
!配置中继端口
SW3(vlan)#vtp client
!配置成为
VTP
CLIENT
端
SW3(vlan)#vtp domain
!配置
V
TP
域
SW3(vlan)#vtp
pruning
!打
开
VTP
修剪
SW3(vlan)#vtp v2-mode
p>
!使用
V2
版的
V
TP
协议
SW3(vlan)#vtp password ambow
p>
!配置
VTP
密码
SW3(vlan)#exit
SW3(config)#interface f0/11
!配置中继端口
SW3(config-if)#switchport trunk
encapsulation isl
SW3(config-
if)#switchport mode trunk
SW3(config-
if)#exit
SW3(config)#interface f0/12
!配置中继端口
SW3(config-if)#switchport trunk
encapsulation isl
SW3(config-
if)#switchport mode trunk
步
骤
6
.
划
分
p>
V
L
A
N
的
配
置
SW1(config)#interface f0/1
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan
10
!将
R1
划入
VLAN 10
SW1(config-if)#exit
15 / 55
SW2(config)#interface f0/2
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan
10
!将
R2
划入
VLAN 10
16 / 55
实验八
RIP
路由协议
1
< br>一
、
实
验
设
备
两台
28
系列型号路由器通过串口相连。
二
、
实
验
要<
/p>
求
2
台路由器
分别命名为
Router1
和
Rout
er2
,路由器之间通过串口连接,采用
V.35
DCE/DTE
电缆。
将电缆的
< br>DCE
端连接到
Router1
的串口
Serial 0
上,
PC1<
/p>
的
IP
地址和缺
省网关分别为
172.16.1.2
和
172.16.1.1
,
PC2
的
p>
IP
地址和缺省网关分别为
172.16.
3.2
和
172.16.3.1
,网络
掩码都是
255.255.255.0
。
三
p>
、
实
验
步
骤
第一步:
在路由器
Router1
上配置接口的
IP
p>
地址和串口上的时钟频率
Router1(config)# int fa0/0
Router1(config-if)# ip address
172.16.1.1 255.255.255.0
Router1(config-if)# no
shutdown
Router1(config)# int s0/0/0
Router1(config-if)# ip
address 172.16.2.1 255.255.255.0
Router1(config-
if)#clock rate 64000
Router1(config-if)# no shutdown
第二步
:
在路由器
Router1
上配置
p>
RIP
V2
路由协议
Router1(config)# router rip
!创建
R
IP
路由进程
Router1(config-router)#version 2
!定义
RIP
版本
Router1(config-router)#network
172.16.0.0
!
定义关联
网络
(必须是直连的主类网络地址)
第三步:
在路由器
Router2
p>
上配置接口的
IP
地址和串口上的时钟频率
Router2(config)# interface
fastethernet 0/0
Router2(config-if)# ip
address 172.16.3.2 255.255.255.0
Router2(config-
if)# no shutdown
Router2(config)# interface serial 0/0/0
Router2(config-
if)# ip address 172.16.2.2 255.255.255.0
Router2(config-if)# no shutdown
第四步
:
在路由器
Router2
上配置
p>
RIP V2
路由协议
Router2(config)# router rip
Router1(config-
router)#version 2
17 / 55
Router2(config-router)#network
172.16.0.0
第五步:
测试网络的连通性
C:>ping 172.16.3.22
!从
PC1 ping PC2
结果显示网络是连通的
【
注
意
事
项
】
当
定
义
R
I
P
版
本
后
,<
/p>
路
由
器
只
接
收
该
版
本
的
路
由
信
息
;
缺
省
情
况
下
,
路
由
器<
/p>
接
收
两
个
R
I
P
版
本
的
路
由
信
息
,
但
只
发
送
版
本
1
的
路
由<
/p>
信
息
;
在
三
层
交
换
机
上
配
置
R
I
P
v
2
与
在
路
由
器
上<
/p>
配
置
一
样
。
有
学
生
把
子
网
写
成
2
5
5
.
2
5
5
.
0
.
0<
/p>
,
导
致
网
络
不
通
网
关
不
要
忘
了
填
写
。
有
学
生
没
用
n
o<
/p>
s
h
u
t
开
启
端
口
导
致
实
验
失
败
。
在
P
T
中
实
验
,
配<
/p>
置
完
要
稍
等
一
会
再
测
试
。
学
会
使
用
s
h
o
w
i
p
i
n
t
b
r
i
;
s
h
p>
o
w
r
u
n
;
s
h
o
w
< br>
i
n
t
p>
端
口
;
分
段
p
i
n
g
来
排
除
< br>故
障
。
18 / 55
实验九
RIP
路由协议
2
< br>一
、
实
验
设
备
四台
28
系列型号路由器通过串口相连。
二
、
实
验
要<
/p>
求
根据拓扑结果图,用
RIPv2
p>
协议配置使全网互通。
三
、
实
验
步
骤
R
A
的
配
置
RTA#conf t
RTA(config)#int
s1/1/0
RTA(config-if)#ip add 172.16.4.2
255.255.255.0
RTA(config-if)#no shut
RTA(config-if)#clock rate 64000
RTA(config-if)#exit
RTA(config)#int s1/1/1
RTA(config-if)#ip add 10.3.0.1
255.255.0.0
RTA(config-if)#no shut
RTA(config-if)#clock rate 64000
RTA(config-if)#exit
RTA(config)#int s1/0/0
RTA(config-if)#ip add 192.168.1.1
255.255.255.0
RTA(config-if)#clock rate
64000
RTA(config-if)#exit
RTA(config)#router rip
RTA(config-router)#ver 2
19 / 55
RTA(config-
router)#network 172.16.4.0
RTA(config-
router)#network 10.3.0.0
RTA(config-
router)#network 192.168.1.0
R
B
的
配
置
RTB#conf t
RTB(config)#int
s1/1/0
RTB(config-if)#ip add 172.16.4.1
255.255.255.0
RTB(config-if)#no shut
RTB(config-if)#exit
RTB(config)#int fa0/0
RTB(config-if)#ip add 172.16.3.1
255.255.255.0
RTB(config-if)#no shut
RTB(config-if)#exit
RTB(config)#router rip
RTB(config-router)#ver 2
RTB(config-router)#network 172.16.0.0 <
/p>
R
C
的
配
置
RTC#conf t
RTC(config)#int s1/1/1
RTC(config-if)#ip add 10.3.0.2
255.255.0.0
RTC(config-if)#no shut
RTC(config-if)#exit
RTC(config)#int fa0/0
RTC(config-if)#ip add 10.2.0.1
255.255.255.0
RTC(config-if)#no shut
RTC(config-if)#exit
RTC(config)#router rip
RTC(config-router)#ver 2
RTC(config-router)#network 10.3.0.0
RTC(config-router)#network 10.2.0.0
R
D
的
配
置
RTD#conf t
RTD(config)#int s1/1/0
RTD(config-if)#ip add 192.168.1.2
255.255.255.0
RTD(config-if)#no shut
RTD(config-if)#exit
RTD(config)#int fa0/0
RTD(config-if)#ip add 192.168.2.1
255.255.255.0
RTD(config-if)#no shut
RTD(config-if)#exit
RTD(config)#router rip
RTD(config-router)#ver 2
RTD(config-router)#network 192.168.0.0
20 / 55
实验十
OSPF
单区域
1
< br>一
、
实
验
设
备
两台
28
系列型号路由器通过串口相连,两台
PC
< br>。
二
、
实
验
要
求
根据拓
扑结果图,用
OSPF
协议配置使全网互通。
< br>
三
、
实
验
步
骤
步
骤
1
p>
.
R
o
u
t
e
r
1
基
本
配
置
< br>:
Router#conf t
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.1.1
255.255.255.0
Router(config-if)#no shut
Router(config-if)#int S0/0/0
Router(config)#clock rate 64000
Router(config-if)#ip add 192.168.2.2
255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#router ospf 10
Router(config-router)#network
192.168.1.0
0.0.0.255
area 0
Router(config-router)#network
192.168.2.0
0.0.0.255
area 0
步
< br>骤
2
.
R
o
u
t
e
r
2
基
本
配
p>
置
:
Router#conf t
Router(config)#int S0/0/0
Router(config)#clock rate 64000
Router(config-if)#ip add 192.168.2.3
255.255.255.0
Router(config-if)#no shut
Router(config-if)#int fa0/1
Router(config-if)#ip add 192.168.3.1
255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#router ospf 10
Router(config-router)#network
192.168.2.0
0.0.0.255
area 0
Router(config-router)#network
192.168.3.0
0.0.0.255
area 0
21 / 55
实验十一
OSPF
单区域
2
一
、
实
p>
验
设
备
三台
28
系列型号路由器通过串口相连。
二
、
实
验
要
求
3
台路由器分别命名为
Router0
,
Router1
和
< br>Router2
,路由器之间通过串口连接,采
用
V.35
DCE/DTE
电缆。将电缆的<
/p>
DCE
端连接到
Router1
的串口
Serial
0
上,
PC1
的
IP
< br>地址和缺省网关分别为
172.16.1.2
和
172.16.1.1
,
PC2
的
IP
地址和缺省网关分别为
172.16.4.2
和
172.16.4.1
,网络掩码都是
255.255.255.0
。
三
p>
、
实
验
步
骤
第
一
步
:
在
路
< br>由
器
R
o
u
t
e
r
1
上
配
置
接
p>
口
的
I
P
地
址
和
串
口
上
的
时
< br>钟
频
率
。
直
连
全
通
!
Router0
上的配置
Router0#conf t
Router0(config)#int s0/0/1
Router0(config-if)#ip add 172.16.3.2
255.255.255.0
Router0(config-if)#clock
rate 64000
Router0(config-if)#no
shutdown
Router0(config-if#exit
Router0(config)#int fa0/0
Router0(config-if)#ip add 172.16.4.1
255.255.255.0
Router0(config-if)#no
shutdown
Router1
上的配置
Router1(config)#int s0/0/1
Router1(config-if)#ip add 172.16.3.1
255.255.255.0
Router1(config-if)#clock
rate 64000
Router1(config-if)#no
shutdown
Router1(config-if)#exit
Router1(config)#int s0/0/0
Router1(config-if)#ip add 172.16.2.2
255.255.255.0
Router1(config-if)#clock
rate 64000
Router1(config-if)#no
shutdown
Router1(config-if)#exit
Router2
上的配置
22 / 55
Router2(config)#int s0/0/0
Route2r(config-if)#ip add 172.16.2.1
255.255.255.0
Router2(config-if)#clock
rate 64000
Router2(config-if)#no
shutdown
Router2(config-if)#exit
Router2(config)#int f0/0
Router2(config-if)#ip add 172.16.1.1
255.255.255.0
Router2(config-if)#no
shutdown
第
二
步
:
在
路
由
器
R
o
u
t
e
r
0
,
R
o
u
t<
/p>
e
r
1
,
R
o
u
t
e
r
2
上
配
置
o
s
p
f
路
由
协
议
Router0(config)#router ospf 10
Router0(config-router)#network
172.16.4.0 255.255.255.0 area 0
Router0(config-router)#network
172.16.3.0 255.255.255.0 area 0
Router1(config)#router ospf 10
Router1(config-router)#network
172.16.3.0 255.255.255.0 area 0
Router1(config-router)#network
172.16.2.0 255.255.255.0 area 0
Router2(config)#router ospf 10
Router2(config-router)#network
172.16.2.0 255.255.255.0 area 0
Router2(config-router)#network
172.16.1.0 255.255.255.0 area 0
第
三
步
:
测
试
网
络
的
连
通
性
用
PC0 ping PC2
结果显示网络是连通的
【
注
意
事
项
】
有
学
生
把
子
网
写
成
2
5<
/p>
5
.
2
5
5
.
0
.
0
,
导
致
网
络
不
通
网
关
不
要
忘
了
填
写<
/p>
。
有
学
生
没
用
n
o
s
h
u
t
开
启
端
口
导
致
实
验
失
败
。<
/p>
在
P
T
中
实
验
,
配
置
完
要
稍
等
一
会
再
测
试
。
学
会
使
用
p>
s
h
o
w
i
p
i
n
t
b
r
i
;
s
h
p>
o
w
r
u
n
;
s
h
o
w
< br>
i
n
t
p>
端
口
;
分
段
p
i
n
g
来
排
除
< br>故
障
。
23
/ 55
实验十二
OSPF
单区域
3
一
、
实
p>
验
设
备
三台
28
系列型号路由器和一台
2950
交换机。
二
、
实
p>
验
要
求
3
台路由器分别命名为
Router1
,
Router2
和
< br>Router3
,路由器全部连接到
2950
交换
机上,配置
OSPF
,使全网互通。
三
、
实
验
步
骤
路
由
器
1
的
配
置<
/p>
:
Router>en
Router#conf t
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.1.1
255.255.255.0
Router(config-if)#no shut
Router(config-if)#int fa0/1
Router(config-if)#ip add 10.1.1.1
255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#router ospf 100
Router(config-router)#net
Router(config-router)#network 10.1.1.0
0.0.0.255 area 0
Router(config-
router)#network 192.168.1.0 0.0.0.255 area 0
24 / 55
路
由
器
2
的
配
置
:
Router>en
Router#conf t
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.1.2
255.255.255.0
Router(config-if)#no shut
Router(config-if)#int fa0/1
Router(config-if)#ip add 172.16.1.1
255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#router ospf 100
Router(config-router)#network
192.168.1.0
0.0.0.255
area 0
Router(config-router)#network
172.16.1.0
0.0.0.255
area 0
路
< br>由
器
3
的
配
置
:
Router>en
Router#conf t
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.1.3
255.255.255.0
Router(config-if)#no shut
Router(config-if)#int fa0/1
Router(config-if)#ip add 10.1.2.1
255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#router ospf 100
Router(config-router)#network
192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 10.1.2.0
0.0.0.255 area 0
在
R
3
上
运
行
:
Router#Show ip
route
查询路由器
C
的路由表信息
Router#Show ip ospf
neighbor
查看邻居表信息
Router#Show ip ospf interface
查看接口所属区域,以及邻居
Router#Show ip protocol
显示路由器的定时器、过滤器、度量值。
Router#Show ip ospf database
显示路由器维护的拓扑数据库的内容。
Router#Show ip ospf neighbor detail
显示邻居路由器的详细信息。
debug ip ospf adj
命令查看
OSPF
< br>路由器之间建立邻居关系的过程。
debug ip
ospf events
命令查看
OSPF
事件。
debug ip ospf packet
命令查看
LSA
包的内容。
25 / 55
实验十三
EIGRP
一
、
实
验
设
备
4
台
28
11
路由器,
6
台
PC
,路由器用串口线相连
二<
/p>
、
实
验
要
求
在路由器上配置
EIRGP
使得全网互通,
R1,R2,R3
< br>为
DCE
端,
R4
为
DTE
端
三
、
实
p>
验
步
骤
1
.
在
R
1
上
配
置
< br>接
口
I
P
地
址
和
时
钟
频
率
R1>en
R1#conf t
R1(config)#int f0/0
R1(config-if)#ip add 192.168.4.1
255.255.255.0
R1(config-if)#no shut
R1(config)#int f0/1
R1(config-if)#ip add 192.168.5.1
255.255.255.0
R1(config-if)#no
shut
R1(config)#int s0/0/0
R1(config-if)#clock rate 64000
R1(config-if)#ip add 192.168.2.2
255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
2
< br>.
在
R
1
上
宣
告
直
连
网
段
26 / 55
R1(config)#route
eigrp 100
R1(config-router)#net
192.168.4.0
R1(config-router)#net
192.168.5.0
R1(config-router)#net
192.168.2.0
3
.
p>
在
R
2
上
配
置
接
口
I
P
地
址
< br>和
时
钟
频
率
R2>en
R2#conf
t
R2(config)#int f0/1
R2(config-if)#ip add 192.168.7.1
255.255.255.0
R2(config-if)#no shut
R2(config-if)#int f0/0
R2(config-if)#ip add 192.168.6.1
255.255.255.0
R2(config-if)#no shut
R2(config-if)#int s0/0/0
R2(config-if)#clock rate 64000
R2(config-if)#ip add 192.168.1.2
255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
4
< br>.
在
R
2
上
宣
告
直
连
网
段
R2(config)#route eigrp 100
R2(config-router)#net 192.168.6.0
R2(config-router)#net 192.168.7.0
R2(config-router)#net 192.168.1.0
5
.
在
p>
R
3
上
配
置
接
口
I
P
地
址
和
< br>时
钟
频
率
R3>en
R3#conf t
R3(config)#int f0/0
R3(config-if)#ip add 192.168.8.1
255.255.255.0
R3(config-if)#no shut
R3(config-if)#int f0/1
R3(config-if)#ip add 192.168.9.1
255.255.255.0
R3(config-if)#no shut
R3(config-if)#int s0/0/0
R3(config-if)#clock rate 64000
R3(config-if)#ip add 192.168.3.2
255.255.255.0
R3(config-if)#no shut
R3(config-if)#exit
6
< br>.
在
R
3
上
宣
告
直
连
网
段
R3(config)#route eigrp 100
R3(config-router)#net 192.168.8.0
27 / 55
-
-
-
-
-
-
-
-
-
上一篇:B2U4课文翻译及课后练习答案
下一篇:实验动物常用英文词汇(中英文对照)