# OSPF prefix-suppression vs. OSPF distribute-list

**URL:** <https://legacy-community.ine.com/t/ospf-prefix-suppression-vs-ospf-distribute-list/3745>\
**Category:** CCNP Enterprise\
**Tags:** networking, ine, security, lab\
**Created:** [May 21, 2023, 10:00am UTC](https://legacy-community.ine.com/t/ospf-prefix-suppression-vs-ospf-distribute-list/3745 "2023-05-21T10:00:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![major133-ac9365513dd](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@major133-ac9365513dd](https://legacy-community.ine.com/u/major133-ac9365513dd)\
**Post date:** [May 21, 2023, 10:00am UTC](https://legacy-community.ine.com/t/ospf-prefix-suppression-vs-ospf-distribute-list/3745/1 "2023-05-21T10:00:40Z")

</div>

Hi @Network_Eric

 ![OSPF Topology](https://us1.discourse-cdn.com/flex015/uploads/ine/original/1X/6662a3d87c460cee606fb6d5ce2a6ecc6355a2ed.png)

in order to do filtering on R3`s global routing table to have 10.1.12.0/24 we have two solutions :-

1-prefix-suppression  
2-do ospf route-filtering for 10.1.12.0/24 which means we need to do route filtering for routes are within the same area.

let`s do the the first way:

1. R1#show running-config interface fastEthernet 0/0.12
2. interface FastEthernet0/0.12
3. encapsulation dot1Q 12
4. ip address 10.1.12.1 255.255.255.0
5. ip ospf network point-to-point
6. ip ospf prefix-suppression

R2#show running-config interface fastEthernet 0/0.12  
interface FastEthernet0/0.12  
encapsulation dot1Q 12  
ip address 10.1.12.2 255.255.255.0  
ip ospf network point-to-point  
ip ospf prefix-suppression

R3#show ip route ospf | begin Ga  
Gateway of last resort is not set

```
  1.0.0.0/32 is subnetted, 1 subnets

```

O 1.1.1.1 [110/3] via 10.1.23.2, 00:00:04, FastEthernet0/0.23  
2.0.0.0/32 is subnetted, 1 subnets  
O 2.2.2.2 [110/2] via 10.1.23.2, 00:00:04, FastEthernet0/0.23

now let`s do the second solution

R1(config)#interface fastEthernet 0/0.12  
R1(config-subif)#ip ospf prefix-suppression disable  
R2(config)#interface fastEthernet 0/0.12  
R2(config-subif)#ip ospf prefix-suppression disable

R3(config)#ip access-list standard test  
R3(config-std-nacl)#deny 10.1.12.0 0.0.0.255  
R3(config-std-nacl)#permit any  
R3(config)#router ospf 1  
R3(config-router)#distribute-list test in  
R3#show ip route ospf  
1.0.0.0/32 is subnetted, 1 subnets  
O 1.1.1.1 [110/3] via 10.1.23.2, 00:00:09, FastEthernet0/0.23  
2.0.0.0/32 is subnetted, 1 subnets  
O 2.2.2.2 [110/2] via 10.1.23.2, 00:00:09, FastEthernet0/0.23  
ok,everything is working as expected

but the question is, what is the difference between the first solution and the second solution?

R3(config)#router ospf 1  
R3(config-router)#no distribute-list test in  
R3#show ip route ospf  
1.0.0.0/32 is subnetted, 1 subnets  
O 1.1.1.1 [110/3] via 10.1.23.2, 00:00:19, FastEthernet0/0.23  
2.0.0.0/32 is subnetted, 1 subnets  
O 2.2.2.2 [110/2] via 10.1.23.2, 00:00:19, FastEthernet0/0.23  
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks  
O 10.1.12.0/24 [110/2] via 10.1.23.2, 00:00:19, FastEthernet0/0.23  
another question , why i see 10.1.12.0/24 only one time in the routing table? why i don`t see it two times from R1 and R2 ?  
another question, why the loo0 for R1 cost =3 but the loo0 R2 cost=2?why both are not have cost=2 on R3?

---

<div class="post-metadata">

**Author:** ![major133-ac9365513dd](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@major133-ac9365513dd](https://legacy-community.ine.com/u/major133-ac9365513dd)\
**Post date:** [May 22, 2023, 4:52pm UTC](https://legacy-community.ine.com/t/ospf-prefix-suppression-vs-ospf-distribute-list/3745/2 "2023-05-22T16:52:52Z")

</div>

@Network_Eric

 ![PBR feature](https://us1.discourse-cdn.com/flex015/uploads/ine/original/1X/3b24124cccba162f6a80d5c36e4af2f3815dde87.png)  
is the second bullet is correct or not ?

i could apply the PBR feature for the packets are locally originated
