锐捷实战系列

锐捷实战系列(四十六) OSPF多ASBR选路原则

2018-04-24  本文已影响110人  3c21cb88ae2b

实验目的

实训背景

ASBR(Autonomous System Boundary Router, 自治系统边界路由器),ASBR 位于OSPF自主系统和非OSPF网络之间。ASBR可以运行OSPF和另一路由选择协议(如RIP),把OSPF上的路由发布到其他路由协议上。ASBR必须处于非存根OSPF区域中。由ASBR发出的LSA5,用于向自治系统区域通告网络拓扑。

实训拓扑

OSPF多ASBR选路原则-聚星云学院

实验所需设备:

设备类型 设备型号 数量
路由器 RSR20 3
三层交换机 S3760 1
主机 Windows 10 1

实训步骤

步骤1:基本配置。

SW1:

Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#hostname SW1
SW1(config)#

R1:

Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#honame R1
R1(config)#

R2:

Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#honame R2
R2(config)#

R3:

Ruijie>enable
Ruijie#configure terminal
Ruijie(config)#honame R3
R3(config)#

步骤2:全网基本IP地址配置。

SW1(config)#interface fastEthernet 0/1
SW1(config-if-FastEthernet 0/1)#no switchport
SW1(config-if-FastEthernet 0/1)#ip address 192.168.1.2 255.255.255.0
SW1(config-if-FastEthernet 0/1)#exit
SW1(config)#interface fastEthernet 0/2
SW1(config-if-FastEthernet 0/2)#no switchport
SW1(config-if-FastEthernet 0/2)#ip address 192.168.2.1 255.255.255.0
SW1(config-if-FastEthernet 0/2)#exit
SW1(config)#interface fastEthernet 0/3
SW1(config-if-FastEthernet 0/3)#no switchport
SW1(config-if-FastEthernet 0/3)#ip address 192.168.5.1 255.255.255.0
SW1(config-if-FastEthernet 0/3)#exit
SW1(config)#
R1(config)#interface fastEthernet 0/0
R1(config-if-FastEthernet 0/0)#ip address 192.168.1.1 255.255.255.0
R1(config-if-FastEthernet 0/0)#exit
R1(config)#interface fastEthernet 0/1
R1(config-if-FastEthernet 0/1)#ip address 192.168.4.1 255.255.255.0
R1(config-if-FastEthernet 0/1)#exit
R1(config)#
R2(config)#interface fastEthernet 0/0
R2(config-if-FastEthernet 0/0)#ip address 192.168.3.1 255.255.255.0
R2(config-if-FastEthernet 0/0)#exit
R2(config)#interface fastEthernet 0/1
R2(config-if-FastEthernet 0/1)#ip address 192.168.2.2 255.255.255.0
R2(config-if-FastEthernet 0/1)#exit
R2(config)#
R3(config)#interface fastEthernet 0/0
R3(config-if-FastEthernet 0/0)#ip address 192.168.4.2 255.255.255.0
R3(config-if-FastEthernet 0/0)#exit
R3(config)#interface fastEthernet 0/1
R3(config-if-FastEthernet 0/1)#ip address 192.168.3.2 255.255.255.0
R3(config-if-FastEthernet 0/1)#exit
R3(config)#interface loopback 0
R3(config-if-Loopback 0)#ip address 172.16.1.1 255.255.255.0
R3(config-if-Loopback 0)#exit
R3(config)#

PC1:

OSPF多ASBR选路原则-聚星云学院

步骤3:全网路由配置。

1.R1、R2、SW1配置OSPF。

R1(config)#route ospf 1
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0
R1(config-router)#network 192.168.4.0 0.0.0.255 area 0
R1(config-router)#exit
R1(config)#
R2(config)#route ospf 1
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
R2(config-router)#network 192.168.3.0 0.0.0.255 area 0
R2(config-router)#exit
R2(config)#
SW1(config)#route ospf 1
SW1(config-router)#network 192.168.1.0 0.0.0.255 area 0
SW1(config-router)#network 192.168.2.0 0.0.0.255 area 0
SW1(config-router)#network 192.168.5.0 0.0.0.255 area 0
SW1(config-router)#exit
SW1(config)#

2.配置完OSPF后,在SW1上查看路由表。如下图所示,说明已经通过OSPF学习到路由。

SW1#show ip route
OSPF多ASBR选路原则-聚星云学院

2.R1、R2、R3通过静态路由互联。

R1(config)#ip route 172.16.1.0 255.255.255.0 192.168.4.2
R2(config)#ip route 172.16.1.0 255.255.255.0 192.168.3.2
R3(config)#ip route 192.168.5.0 255.255.255.0 192.168.4.1
R3(config)#ip route 192.168.5.0 255.255.255.0 192.168.3.1

步骤4:在ASBR路由器上将静态路由重分发进OSPF。

R1(config)#route ospf 1
R1(config-router)#redistribute static subnets
R1(config-router)#exit
R1(config)#
R2(config)#route ospf 1
R2(config-router)#redistribute static subnets
R2(config-router)#exit
R2(config)#

配置完成后在交换机SW1上查看是否学习到了重分布的静态路由。

SW1#show ip route
OSPF多ASBR选路原则-聚星云学院

步骤5:修改重发布路由类型。

1.在R1上将静态路由重发布的类型修改为type1(默认为type2),使到172.16.1.1 的数据强制走R1。

R1(config)#route ospf 1
R1(config-router)#redistribute static metric-type 1
R1(config-router)#exit
R1(config)#

2.此时在PC1上对目标地址172.16.1.1进行ping测试,并跟踪地址。如下图所示,数据已通过R1到达R3。

OSPF多ASBR选路原则-聚星云学院

3.在R1上将静态路由重发布的类型改回type2,在R2上将到R3的路由度量值改为10(默认为20),使到172.16.1.1的数据强制走R2。

R1(config)#route ospf 1
R1(config-router)#no redistribute static metric-type
R1(config-router)#end
R1#
R2(config)#route ospf 1
R2(config-router)#redistribute static metric 10
R2(config-router)#end
R2#

4.此时在PC1上对目标地址172.16.1.1进行ping测试,并跟踪地址。如下图所示,数据已通过R2到达R3。

OSPF多ASBR选路原则-聚星云学院
上一篇下一篇

猜你喜欢

热点阅读