OSPF prefix-suppression vs. OSPF distribute-list

Hi @Network_Eric

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?

@Network_Eric


is the second bullet is correct or not ?

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