cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 
cancel
705
Visitas
2
ÚTIL
11
Respuestas

filter routes in ospf for a neighbor

Electronic20
Spotlight
Spotlight

Hello community,

I have a router with hostname BANK, I have 2 segments 192.168.10.0/24 and 192.168.20.0/24 that are learned from 10.10.10.2 by ospf.

but the segments must be learned by neighbor 20.20.20.2,

They are learned on both sides, but 10.10.10.2 sends with a metric of 1, so it has a better preference.

How could my router with hostname BANCO stop receiving segments 192.168.10.0/24 and 192.168.20.0/24 from its neighbor 10.10.10.2?

please your kind help

1 SOLUCIÓN ACEPTADA

Soluciones aceptadas
11 RESPUESTAS 11

M02@rt37
VIP
VIP

Hello @Electronic20,

You could do one of these two methods:

-1- Set a specific OSPF cost for the neighbor 10.10.10.2 higher than the cost towards 20.20.20.2.

router ospf <process_id>
neighbor 10.10.10.2 cost <higher_cost_value>

-2- Use an access list to deny OSPF routes from 10.10.10.2. Apply that ACL under OSPf process to filter routes from 10.10.10.2.

access-list <acl_number> deny <ip>

access-list <acl_number> permit any

router ospf <process_id>
distribute-list <acl_number> in <interface>

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Hi M02@rt37 ,

I got confused on an IP, I show the configuration:

router ospf 10
router id 1.1.1.1


interface vlan 10
ip add 10.10.10.3 255.255.255.0
ip ospf 10 area 0

neighbor 1: 10.10.10.1
neighbor 2: 10.10.10.2

network 192.168.10.0/24 and network 192.168.20.0/24 learn of 10.10.10.1 have cost 1

but, the 192.168.10.0/24 and 192.168.20.0/24 must be learned by the neighbor 10.10.10.2

In that scenario, how could these routes be learned by 10.10.10.2?

I can't modify that configuration:

router ospf <process_id>
neighbor 10.10.10.2 cost <higher_cost_value>

and If I apply the second option it would modify both neighbors

access-list <acl_number> deny <ip>

access-list <acl_number> permit any

router ospf <process_id>
distribute-list <acl_number> in <interface>

your kind support

 

 

OK @Electronic20 

Have you got a draw of your topology?

In your first post you talk about neighbor 20.20.20.2 ? 10.10.10.2 in fact? Neighbor 10.10.10.1 and .2 are then throught the same interface ?

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

hi M02@rt37 ;

 

Electronic20_0-1695794070849.png

 

 

Thanks @Electronic20,

On SW-L3-3 interface vlan 10 add ip ospf cost 50 command. 

This command allows you to manually override this automatic calculation and set a specific cost for the OSPF interface. This can be useful for influencing OSPF route selection without changing the actual bandwidth of the interface.

 

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

but it would affect SW L3-2 and SW L3-3 on routes 192.168.10.0/24 and 192.168.20.0/24

I send you message check it 

M02@rt37
VIP
VIP

@Electronic20 

You could use ip ospf cost command on the interface's remote router.

https://study-ccna.com/ospf-cost-metric/#:~:text=The%20Cost%20formula%20is%20reference,Mbps%20%2F%2010%20Mbps%20%3D%2010.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Hello @Electronic20

Great you find the issue ! Possible to share the solution on a post ? That could help others...

Thanks a lot.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Hello M02@rt37 

The solution I wanted was not found.
The scenario had to be changed taking a point to multipoint scenario.

Ok @Electronic20 

Thanks for you feedback.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.