Exclude network using BGP Network command

Answered Question
Jun 4th, 2014
User Badges:

Hello:

I'm using BGP and i'm doing redistribution of OSPF into BGP so as i have been reading the best way to do that is to use the network command.

At the moment I'm doing the redistribution of OSPF into BGP using a prefix list that specifies the networks to redistribute.

Is possible to do this by the network command?

My Network to redistribute is the 8.0.0.0 / 8 but the 8.0.0.0 / 16 is excluded.

The network in the IGP is with specific IP directions so I think that I have also use the auto-summary option or configure the aggregate-address command.

Another option that I prefer is to advertise the network in to parts because some of the ingress routers to the AS are better for the first part of the network and the other are better to the second part. So I'm planning to advertise this networks.

  • 8.0.0.0 / 9 (Excluding 8.0.0.0 / 16)
  • 8.128.0.0 / 9 

 

Thank you so much for your help. With regards, Juan.

Correct Answer by syed kazim abbas about 3 years 2 months ago

hi dear,

By default, network command advertise only specific mask which u applied and it should be existed in routing table.

another option , you can use  route map as well with network command

Regard,

kazim

 

"please rate me if post helpful"

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 3.5 (2 ratings)
Loading.
Correct Answer
syed kazim abbas Wed, 06/04/2014 - 05:15
User Badges:
  • Bronze, 100 points or more

hi dear,

By default, network command advertise only specific mask which u applied and it should be existed in routing table.

another option , you can use  route map as well with network command

Regard,

kazim

 

"please rate me if post helpful"

juandyb01 Wed, 06/04/2014 - 06:01
User Badges:

Hello:

I know that the network command would match the exact prefix but it's possible to use the aggregated route if you use the aggregate command or the auto-summary command. Is that correct?

For excluding routes is it possible to do with the route map? I think that the route-map in this case was only to modify parameters. 

Thanks for your help. With regards, Juan

milan.kulik Wed, 06/04/2014 - 13:10
User Badges:
  • Red, 2250 points or more

Hi,


 

are you talking about excluding routes while redistributing from OSPF  to BGP or while advertising to a BGP neighbor?


 

IMHO, you could use a route-map in both cases. Matching a prefix-list would be the easiest way.


 

As an example, you could use

ip prefix-list  prefixes-from-ospf seq 5 deny 8.0.0.0/16 le 32

ip prefix-list  prefixes-from-ospf seq10 permit 8.0.0.0/8 le 32

!

route-map to-bgp permit 10

match ip address prefix-list prefixes-from-ospf

!

You could use

router bgp ....

redistribute ospf ... match internal external ... route-map to-bgp

!

or

router bgp ....

neighbor .... route-map  to-bgp out

!

The route-map would permit any 8.x.x.x/y prefix with the exception of 8.0.x.x/y prefixes.


 

Is this what you need?


 

Best regards,

Milan



 

juandyb01 Fri, 06/06/2014 - 02:45
User Badges:

Hello:

Replying to your question. I'm searching the better way to include routes in BGP to advertise them later to the other ISPs. Now I have this with redistribute OSPF into BGP using a route-map. So I think that the better way to do it is using network command. Could you please explain me the reason of this?

I have been thinking that my idea does not have so much sense because the network to exclude is inside the aggregated prefix  ;)

I will explain my case.

The network 8.0.0.0 / 16 is used in the core of my ISP so this network dos not have to be advertised to other ISP.

And the following networks is used by the clients of the ISP. This networks have to be advertised to other ISPs.

So I think that the better way is to advertise the two networks and block connections to 8.0.0.0 / 16 with an ACL in each border router of the ISP.

  • 8.0.0.0 / 9 (Excluding 8.0.0.0 / 16)
  • 8.128.0.0 / 9 

 

Is this a good approach? Thanks for your help.

Actions

This Discussion

Related Content