OSPF过滤外部路由

简介:
【实验拓扑】

 

 

【实验要求】
1、按照上图配置好网络
2、在R5上增加1条静态路由150.1.50.0/24 指向null 0,并重发布到OSPF中
3、 在R6上增加1条静态路由150.1.60.0/24 指向null 0,并重发布到OSPF中
4、在R1与R4上设置过滤,过滤掉来自R6的外部路由

【实验思考】
我们知道OSPF从外部学习的路由都会标记为E2,我们可以通过route-map来过滤外部标记,但是如何只过滤来自于R6的呢?
同样用Route-map 中的过滤路由来源。

【配置方法】
R1 & R4
access-list 1 permit 150.1.6.6
!
route-map FILTER_OSPF deny 10
match route-type external type-2
match ip route-source 1
route-map FILTER_OSPF permit 1000
!
router ospf 1
distribute-list route-map FILTER_OSPF in
R5:
ip route 160.1.50.0 255.255.255.0 null 0
router ospf 1
redistribute static subnets
R6:
ip route 160.1.60.0 255.255.255.0 null 0
router ospf 1
redistribute static subnets

 

【过滤后验证方法】
过滤之前
----------------------------------------------------------------------------------------------->>
R1#show ip route ospf
     160.1.0.0/24 is subnetted, 2 subnets
O E2    160.1.50.0 [110/20] via 155.1.0.5, 00:01:00, Serial0/0
O E2    160.1.60.0 [110/20] via 155.1.146.6, 00:01:00, FastEthernet0/0
     150.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
O       150.1.6.6/32 [110/11] via 155.1.146.6, 00:01:00, FastEthernet0/0
O       150.1.5.5/32 [110/65] via 155.1.0.5, 00:01:00, Serial0/0
O       150.1.4.4/32 [110/11] via 155.1.146.4, 00:01:00, FastEthernet0
过滤之后,仅剩余1条外部学习到的路由
----------------------------------------------------------------------------------------------->>
R1#show ip route ospf
     160.1.0.0/24 is subnetted, 1 subnets
O E2    160.1.50.0 [110/20] via 155.1.0.5, 00:00:03, Serial0/0
     150.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
O       150.1.6.6/32 [110/11] via 155.1.146.6, 00:00:03, FastEthernet0/0
O       150.1.5.5/32 [110/65] via 155.1.0.5, 00:00:03, Serial0/0
O       150.1.4.4/32 [110/11] via 155.1.146.4, 00:00:03, FastEther


 

【实验前的基本配置】
----------------------------------------------------------------------------------------------
R1:
interface Fa 0/0
ip address 155.1.146.1 255.255.255.0
no shut
!
interface Serial 0/0
encapsulation frame-relay
no frame-relay inverse-arp
ip address 155.1.0.1 255.255.255.0
frame-relay map ip 155.1.0.5 105
frame-relay map ip 155.1.0.4 105
ip ospf priority 0
no shutdown
!
interface Loopback0
ip address 150.1.1.1 255.255.255.0
!
router ospf 1
router-id 150.1.1.1
network 155.1.146.1 0.0.0.0 area 1
network 150.1.1.1 0.0.0.0 area 1
network 155.1.0.1 0.0.0.0 area 0
R4:
interface Eth 0/1
ip address 155.1.146.4 255.255.255.0
!
interface Serial 0/0
encapsulation frame-relay
no frame-relay inverse-arp
ip address 155.1.0.4 255.255.255.0
frame-relay map ip 155.1.0.5 405
frame-relay map ip 155.1.0.1 405
ip ospf priority 0
!
interface Loopback0
ip address 150.1.4.4 255.255.255.0
!
router ospf 1
router-id 150.1.4.4
network 155.1.146.4 0.0.0.0 area 1
network 150.1.4.4 0.0.0.0 area 1
network 155.1.0.4 0.0.0.0 area 0
R5:
interface Serial 0/0
encapsulation frame-relay
no frame-relay inverse-arp
ip address 155.1.0.5 255.255.255.0
frame-relay map ip 155.1.0.4 504
frame-relay map ip 155.1.0.1 501
!
interface Loopback0
ip address 150.1.5.5 255.255.255.0
router ospf 1
router-id 150.1.5.5
network 150.1.5.5 0.0.0.0 area 0
network 155.1.0.5 0.0.0.0 area 0
neighbor 155.1.0.4
neighbor 155.1.0.1
R6:
interface Gig 0/1
ip address 155.1.146.6 255.255.255.0
!
interface Loopback0
ip address 150.1.6.6 255.255.255.0
!
router ospf 1
router-id 150.1.6.6
network 155.1.146.6 0.0.0.0 area 1
network 150.1.6.6 0.0.0.0 area 1
 
 
本文转自zcm8483 51CTO博客,原文链接:http://blog.51cto.com/haolun/993184

相关文章
|
2月前
|
网络协议 安全 网络架构
|
3月前
|
网络架构 Perl
BGP路由属性与选路
BGP路由属性与选路
|
11月前
|
安全 API
路由的作用
路由的作用
45 1
|
存储 算法 网络架构
BGP-4中关于路由聚合的相关介绍
当 BGP 发言者为了向特定对等体通告的目的而聚合多个路由时,聚合路由的 AS_PATH 通常包括一个 AS_SET,该 AS_SET 由形成聚合的 AS 集合形成。在许多情况下,网络管理员可以确定是否可以在没有 AS_SET 且不形成路由环路的情况下安全地通告聚合。
153 0
BGP-4中关于路由聚合的相关介绍
|
网络协议 网络架构
路由与交换系列之简单的路由策略与默认路由汇总路由的运用
路由策略使用不同的匹配条件和匹配模式选择路由和改变路由属性。在特定的场景 中,路由策略的6种过滤器也能单独使用,实现路由过滤。
3669 1
路由与交换系列之简单的路由策略与默认路由汇总路由的运用
|
网络协议 网络架构
IP路由基础、路由器静态路由配置方法、自治系统、缺省路由的配置方法、路由选路规则、缺省路由、备份路由、等价路由、三种查询路由表命令
路由器特点,网络IP地址规划网络间的特性,基本路由思想,编辑静态路由部分,查询设备整个路由表,查看特定的路由协议时使用,查询目的地址2.2.2.2的路由条目,IP路由表代码写法,IP路由表里的信息,路由表来源,路由表的信息,路由表选路规则,缺点:缺省路由,备份路由,等价路由,做实验的步骤......
IP路由基础、路由器静态路由配置方法、自治系统、缺省路由的配置方法、路由选路规则、缺省路由、备份路由、等价路由、三种查询路由表命令
|
网络协议 测试技术 网络架构
|
网络协议 网络架构 数据安全/隐私保护