题目要求
1.将R1的环回以重发布的方式宣告
2.消除次优路径
配置内容
R1
acl number 2000 ----抓取流量
rule 5 permit source 192.168.12.0 0 ----设置规则,抓取相对应的流量
rule 10 permit source 192.168.13.0 0
#
interface GigabitEthernet0/0/0
ip address 192.168.12.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.13.1 255.255.255.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.0
#
ospf 1 router-id 1.1.1.1
import-route direct route-policy aa ----在重发布中调用名称为aa的策略
area 0.0.0.0
network 192.168.12.1 0.0.0.0
network 192.168.13.1 0.0.0.0
#
route-policy aa deny node 10 ----创建一个名称为aa的策略,大动作为拒绝,节点编号为10
if-match acl 2000 ----条件语句 ----当匹配到ACL 2000 内的内容时
#
route-policy aa permit node 100 ----允许所有
R2
acl number 2000
rule 5 permit source 192.168.34.0 0
#
interface GigabitEthernet0/0/0
ip address 192.168.12.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.24.1 255.255.255.0
rip metricout ip-prefix aa 5 ----在出接口出调用前缀列表aa,修改其抓取的流量的度量值为5
#
ospf 1 router-id 2.2.2.2
import-route rip 1 route-policy aa ----将RIP的内容重发布到OSPF内,并调用名称为aa的策略
preference ase route-policy aa 150 ----修改引入到OSPF内的五七类LSA的路由信息的优先级
area 0.0.0.0
network 192.168.12.2 0.0.0.0
#
rip 1
version 2
network 192.168.24.0
import-route ospf 1 ----将OSPF的内容重发布到RIP内
#
route-policy aa deny node 10
if-match acl 2000
#
route-policy aa permit node 20
if-match ip-prefix bb
apply preference 90 ----修改OSPF的路由优先级为90
#
route-policy aa permit node 100
#
ip ip-prefix aa index 10 permit 192.168.13.0 24 ----创建一个名称为aa,编号为10的前缀列表,抓取流量
ip ip-prefix bb index 10 permit 1.1.1.0 24
R3
acl number 2000
rule 5 permit source 192.168.24.0 0
#
interface GigabitEthernet0/0/0
ip address 192.168.13.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.34.1 255.255.255.0
rip metricout ip-prefix bb 5
#
ospf 1 router-id 3.3.3.3
import-route rip 1 route-policy aa
preference ase route-policy aa 150
area 0.0.0.0
network 192.168.13.2 0.0.0.0
#
rip 1
version 2
network 192.168.34.0
import-route ospf 1
#
route-policy aa deny node 10
if-match acl 2000
#
route-policy bb permit node 20
if-match ip-prefix bb
apply preference 90 ----修改OSPF的路由优先级为90
#
route-policy aa permit node 100
#
ip ip-prefix bb index 10 permit 192.168.12.0 24
ip ip-prefix aa index 10 permit 1.1.1.0 24
R4
interface GigabitEthernet0/0/0
ip address 192.168.24.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.34.2 255.255.255.0
#
rip 1
version 2
network 192.168.24.0
network 192.168.34.0
实验结果
R1路由表
去往R4两条链路的路由信息
R2路由表
R3路由表
R4路由表
R4去往R1环回的路由信息
R4去往R1两条链路的路由信息