路由策略配置

优质老薛主机推荐:15%终身付款折扣:xwseo15 25%首次付款折扣 : xwseo115 点击下图进入购买

拓扑如下:

实验需求:
1.让R3可以学到10.1.2.0 /24和10.1.3.0 /24的路由,不能学到10.1.1.0 /24的路由。
2.让R2向R1通告R3的三个环回接口,cost设置为10.

 

配置步骤
1.配置ip地址
2.配置rip和ospf
3.R2上配置路由引入和路由策略,并进行路由过滤和cost设置
4.验证测试

配置如下

AR1配置如下:

[AR1]dis cu
#
sysname AR1
#
interface GigabitEthernet0/0/0
ip address 12.1.1.1 255.255.255.252
#
interface LoopBack0
ip address 10.1.1.1 255.255.255.0
#
interface LoopBack1
ip address 10.1.2.1 255.255.255.0
#
interface LoopBack2
ip address 10.1.3.1 255.255.255.0
#
rip 1
version 2
network 12.0.0.0
network 10.0.0.0

AR2配置如下:

[AR2]dis cu
#
sysname AR2
#
acl number 2000
rule 10 permit source 10.1.2.0 0.0.0.255
rule 20 permit source 10.1.3.0 0.0.0.255
acl number 2001
rule 10 permit source 30.1.1.0 0.0.0.255
#
interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.252
#
interface GigabitEthernet0/0/1
ip address 23.1.1.1 255.255.255.252
#
ospf 1
import-route rip 1 route-policy 10
area 0.0.0.0
network 23.1.1.0 0.0.0.3
#
rip 1
version 2
network 12.0.0.0
import-route ospf 1 route-policy 20
#
route-policy 10 permit node 10
if-match acl 2000
#
route-policy 20 permit node 10
if-match acl 2001
apply cost 10

AR3配置如下:

[AR3]dis cu
#
sysname AR3
#
interface GigabitEthernet0/0/1
ip address 23.1.1.2 255.255.255.252
#
interface LoopBack0
ip address 30.1.1.1 255.255.255.0
#
interface LoopBack1
ip address 30.1.2.1 255.255.255.0
#
interface LoopBack2
ip address 30.1.3.1 255.255.255.0
#
ospf 1
area 0.0.0.0
network 23.1.1.0 0.0.0.3
network 30.1.1.0 0.0.0.255
network 30.1.2.0 0.0.0.255
network 30.1.3.0 0.0.0.255

验证

赞 (0)
分享到:更多 ()