路由过滤与路由策略实验

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

路由过滤与路由策略实验

路由过滤与路由策略实验

需求1:
在R3使用acl+filter-policy过滤财务部10.1.1.0/24的路由。
使得市场部与财务部不能互通。
*OSPF的import方向过滤路由,只能影响路由表,不能过滤LSA。
需求2:
在R1上引入外部路由时,进行过滤。
2.2在import-route中调用pFx+route-policy,不发布10.1.2.0/24的路由。
2.1使用Prefix-list+filter-policy不发布10.1.3.0/24的路由。
*在ASBR上引入外部路由时部署策略,可直接过滤5/7类LSA。
需求3:
在R4上尝试使用acl/pfx+filter-policy,不发布10.1.2.0 /24的路由。发现
无法过滤,这是由于0SPF的1/2类LSA无法在出方向过滤,只有5/7类LSA
在ASBR上可以使用出方向过滤。
由1/2类lsa计算出来的路由,只能在本地使用入方向过滤(需求1)
需求4:
在R2上过滤3类lsa,使得R1收不到10.1.5.0 /24的路由
*R2作为ABR,会产生关于区域0的3类LSA发送到区域1。可以使
用area o export或area 1 import过滤3类LSA。

需求1解法:R3
acl number 2000
rule 5 deny source 10.1.1.0 0
rule 10 permit
\\acl的deny代表不抓的路由,permit代表抓出来的路由
ospf 1 router-id 10.3.3.3
filter-policy 2000 import
\\凡是没有被抓出来的路由,全部被过滤。

需求2.1解法:R1:
ip ip-prefix ziliao index 10 deny 10.1.3.0 24 greater-equal 24 less-equal
ip ip-prefix ziliao index 20 permit 0.0.0.0 0 less-equal 32

ospf 1 router-id 10.1.1.1
filter-policy ip-prefix ziliao export 1
\\在OSPF中使用过滤策略,在出方向过滤路由
2.2解法:R1:
ip ip-prefix yanfa index 10 permit 10.1.2.0 24
\\使用前级列表抓路由。

route-policy DENY2 deny node 10
if-match ip-prefix yanfa
\\调用前级列表,并过滤路由。
route-policy DENY2 deny node 100

\\使用空的策略允许其他路由。
route-policy DENY2 permit node 100

ospf 1 router-id 10.1.1.1
import-route direct route-policy DENY2
\\在引入时调用路由策略。
需求4解法:R2:
ip ip-prefix 5 index 10 deny 10.1.5.0 24
ip ip-prefix 5 index 20 permit o.0.0.0 0 less-equal 32
\\前缀列表匹配路由
ospf 1 router-id 10.2.2.2
area 0.0.0.0
filter ip-prefix zongbu export.
\\当产生关于区域0的3类LSA时,过滤掉总部LSA.

AR1配置如下:

[AR1]dis cu
[V200R003C00]
#
sysname AR1
#
interface GigabitEthernet0/0/0
ip address 12.1.1.1 255.255.255.0
#
interface LoopBack0
ip address 10.1.1.1 255.255.255.0
ip address 10.1.2.1 255.255.255.0 sub
ip address 10.1.3.1 255.255.255.0 sub
#
ospf 1 router-id 1.1.1.1
filter-policy ip-prefix 3 export
import-route direct route-policy yanfa
area 0.0.0.1
network 12.1.1.1 0.0.0.0
#
route-policy pfx2 deny node 10
if-match ip-prefix 2
#
route-policy pfx2 permit node 1100
#
route-policy yanfa deny node 10
if-match ip-prefix 2
#
route-policy yanfa permit node 100
#
ip ip-prefix 3 index 10 deny 10.1.3.0 24
ip ip-prefix 3 index 20 permit 0.0.0.0 0 less-equal 32
ip ip-prefix 2 index 10 permit 10.1.2.0 24

AR2配置如下:

[AR2]dis cu
[V200R003C00]
#
sysname AR2
#
interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 23.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 24.1.1.2 255.255.255.0
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 23.1.1.2 0.0.0.0
network 24.1.1.2 0.0.0.0
area 0.0.0.1
network 12.1.1.2 0.0.0.0

AR3配置如下:

[AR3]dis cu
[V200R003C00]
#
sysname AR3
#
interface GigabitEthernet0/0/0
ip address 23.1.1.3 255.255.255.0
#
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 10.1.4.0 0.0.0.255
network 23.1.1.3 0.0.0.0

AR4配置如下:

[AR4]dis cu
[V200R003C00]
#
sysname AR4
#
interface GigabitEthernet0/0/0
ip address 24.1.1.4 255.255.255.0
#
interface LoopBack0
ip address 10.1.5.1 255.255.255.0
#
ospf 1 router-id 4.4.4.4
filter-policy ip-prefix 5 export
area 0.0.0.0
network 10.1.5.0 0.0.0.255
network 24.1.1.4 0.0.0.0
#
ip ip-prefix 5 index 10 deny 10.1.5.0 24
ip ip-prefix 5 index 20 permit 0.0.0.0 0 less-equal 32

路由

路由过滤配置如下:
ip ip-prefix 3 index 10 deny 10.1.3.0 24
ip ip-prefix 3 index 20 permit 0.0.0.0 0 less-equal 32

ospf 1 router-id 1.1.1.1
filter-policy ip-prefix 3 export
area 0.0.0.1
network 12.1.1.1 0.0.0.0

路由策略配置如下:
route-policy
ip ip-prefix 2 index 10 permit 10.1.2.0 24

route-policy yanfa deny node 10
if-match ip-prefix 2
#
route-policy yanfa permit node 100

ospf 1 router-id 1.1.1.1
import-route direct route-policy yanfa
area 0.0.0.1
network 12.1.1.1 0.0.0.0

路由策略:

路由过滤

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