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 220.127.116.11 / 8 but the 18.104.22.168 / 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.
Thank you so much for your help. With regards, Juan.
Solved! Go to Solution.
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
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 22.214.171.124/16 le 32
ip prefix-list prefixes-from-ospf seq10 permit 126.96.36.199/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
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?
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 188.8.131.52 / 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 184.108.40.206 / 16 with an ACL in each border router of the ISP.
Is this a good approach? Thanks for your help.