新手上路

- UID
- 68
- 威望
- 0
- 贡献
- 0
- 在线时间
- 0 小时
- 注册时间
- 2014-2-26
|
静态路由和直连路由引入配置
一、 实验目的
1. 掌握路由引入的配置
2. 理解路由引入的原理
二、 应用环境
1. 在某些应用环境中需要将静态路由引入到某些动态路由协议里
三、 实验设备
DCR-1751 两台
四、 实验拓扑
五、 实验要求
配置表:
Router-A Router-B
F0/0 192.168.0.1/24 F0/0 192.168.2.1/24
S1/1 (DCE) 192.168.1.1/24 S1/0 192.168.1.2/24
在 A 上配置将直连和静态路由引入到 RIP 和 OSPF 协议中
六、 实验步骤
第一部分:引入到 RIP 协议中: 第一步:参照实验三和上表配置接口地址并测试连通性
第二步:配置路由器 A 的静态路由,查看直连和静态路由
Router-A#config
Router-A_config#ip route 191.13.2.0 255.255.255.0 192.168.0.4 !配置静态路由
Router-A_config#^Z
Router-A#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
S
191.13.2.0/24
[1,0] via 192.168.0.4
C
192.168.0.0/24
is directly connected, FastEthernet0/0
C
192.168.1.0/24
is directly connected, Serial1/1
第三步:在 A 上配置 RIP 协议,并将直连和静态路由引入
Router-A_config#router rip
Router-A_config_rip#network 192.168.1.0 !注意并没有宣告 192.168.0.0Router-A_config_rip#redistribute connect !将直连的路由引入
Router-A_config_rip#redistribute static !将静态路由引入
第四步:在 B 上配置 RIP 协议,查看从 A 学习到的被引入的路由
Router-B#conf
Router-B_config#router rip
Router-B_config_rip#network 192.168.1.0
Router-B_config_rip#^Z Router-B#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
R
191.13.0.0/16
[120,1] via 192.168.1.1(on Serial1/0)
!注意是有类的路由
R
192.168.0.0/16
[120,1] via 192.168.1.1(on Serial1/0)
C
192.168.1.0/24
is directly connected, Serial1/0
C
192.168.2.0/24
is directly connected, FastEthernet0/0
第二部分:引入到 OSPF 协议中
第一步和第二步同上
第三步:在 A 上配置 OSPF 协议,并将直连和静态引入
Router-A#conf
Router-A_config#router ospf 1
Router-A_config_ospf_1#net 192.168.1.0 255.255.255.0 area 0
Router-A_config_ospf_1#redistribute connect
Router-A_config_ospf_1#redistribute static
第四步:在 B 上配置 OSPF 协议,并查看从 A 学习到的路由
Router-B#conf
Router-B_config#router ospf 1
Router-B_config_ospf_1#net 192.168.1.0 255.255.255.0 area 0
Router-B_config_ospf_1#exit Router-B_config#no router rip Router-B_config#^Z
Router-B#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
和花费值
1. 注意是将已经存在的路由引入到动态路由协议中,静态路由要先配置
2. 引入成功后,该动态路由协议将引入的路由发布出去,在其他的路由器上查看
3. RIP-1 是有类的路由协议
八、 配置序列
Router-A#sh run
Building configuration...
Current configuration:
!
!version 1.3.2E
service timestamps log date service timestamps debug date no service password-encryption
!
hostname Router-A
!
!
interface FastEthernet0/0
ip address 192.168.0.1 255.255.255.0 no ip directed-broadcast
!
interface Serial1/0 no ip address
no ip directed-broadcast
physical-layer speed 64000
!
interface Serial1/1
ip address 192.168.1.1 255.255.255.0 no ip directed-broadcast
physical-layer speed 64000
!
interface Async0/0 no ip address
no ip directed-broadcast
!
!
router ospf 1network 192.168.1.0 255.255.255.0 area 0 redistribute staticredistribute connect!
!
!
ip route 191.13.2.0 255.255.255.0 192.168.0.4
!
!
!
|
|