Block O E2 routes

Answered Question
Jun 27th, 2008

i have 3 routers in ospf area 0.

SW1-

interface Vlan1

ip address 9.9.9.1 255.255.255.248

ip ospf network non-broadcast

ip ospf dead-interval minimal hello-multiplier 10

!

router ospf 1

log-adjacency-changes

network 9.9.9.0 0.0.0.7 area 0

neighbor 9.9.9.2

neighbor 9.9.9.3

R2-

interface GigabitEthernet0/0

description ### Int to AS65337 ###

ip address 9.9.9.3 255.255.255.248

ip ospf network non-broadcast

ip ospf dead-interval minimal hello-multiplier 10

ip ospf priority 0

duplex auto

speed auto

media-type rj45

!

router ospf 1

log-adjacency-changes

redistribute bgp 65334 subnets route-map Redistrib

network 9.9.9.0 0.0.0.7 area 0

R3-

!

interface GigabitEthernet0/0

description ### Int to AS65337 ###

ip address 9.9.9.2 255.255.255.248

ip ospf network non-broadcast

ip ospf dead-interval minimal hello-multiplier 10

ip ospf priority 0

duplex auto

speed auto

media-type rj45

!

!

router ospf 1

log-adjacency-changes

network 9.9.9.0 0.0.0.7 area 0

!

R2 redistribute routes from BGP into OSPF and SW1 and R3 got that routes as O E2.

I don't want to have that routes at R3. How it's possible to block O E2 routes at R3?

I have this problem too.
0 votes
Correct Answer by Nagendra Kumar ... about 8 years 6 months ago

Hi,

In ASBR, redistribute all those BGP routes with some tag set. Say for example set tage 90 for all those routes as below,

R2(ASBR) config:

----------------

router ospf 1

redistribute bgp 65334 subnets route-map Redistrib tag 90

Now in R3, use distribute-list with route-map to deny all those routes with tag 90 as below,

R3 config:

---------

route-map DENY_BGP_ROUTE deny 10

match tag 90

route-map DENY_BGP_ROUTE permit 500

router ospf 1

distribute-list route-map DENY_BGP_ROUTE in

HTH,

Nagendra

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4.5 (2 ratings)
Loading.
shibindong Fri, 06/27/2008 - 01:45

can you try this:

assume x.x.x.x is the network you want to block:

access-list 1 deny x.x.x.x x.x.x.x

access-list 1 pemit any

router ospf 1

distribute-list 1 in

The bad thing is: if you have a lot of subnets to block, you need type everyone in the ACL, and distribute-list only block the subnet into routing table and has nothing to do with OSPF topology table, so even you block the route in R3, it still can adverstise it to other OSPF peer.

rmv72 Fri, 06/27/2008 - 01:55

unfortunately i need to block a lot of subnets

Correct Answer
Nagendra Kumar ... Fri, 06/27/2008 - 02:52

Hi,

In ASBR, redistribute all those BGP routes with some tag set. Say for example set tage 90 for all those routes as below,

R2(ASBR) config:

----------------

router ospf 1

redistribute bgp 65334 subnets route-map Redistrib tag 90

Now in R3, use distribute-list with route-map to deny all those routes with tag 90 as below,

R3 config:

---------

route-map DENY_BGP_ROUTE deny 10

match tag 90

route-map DENY_BGP_ROUTE permit 500

router ospf 1

distribute-list route-map DENY_BGP_ROUTE in

HTH,

Nagendra

Actions

This Discussion