I have a router that is receiving a prefix via redistributed eigrp and bgp. It installs the first in its routing table. The administrative distance are by default.
I don't know that is happening.
Thanks Peter, Great explanation! I was investigating this exact same issue when I came across this post. I had seen the issue years back also and thought I resolved it by adjusting the admin distance on one or the other protocols but it doesn't sound like that will work here.
Well, now it's clear.
Have a look at this document describing the BGP Best Path selection algorithm:
Specifically, have a look at the step 3: Prefer the path that was locally originated via a network or aggregate BGP subcommand or through redistribution from an IGP.
In your case, you have a network in your routing table that comes from EIGRP. This network is subsequently redistributed into BGP database. Now, the BGP goes over entries in its database and for each prefix, it tries to locate the best path. As the locally originated (injected) entries are preferred to entries coming from other BGP peers, the BGP considers these entries to be the best, and does not replace the routing table contents with the prefix information from external BGP peers. That is why the path to those prefixes through the BGP peer is not installed into your routing table because according to the BGP best path selection algorithm, it is currently not considered as the best path.
The question is whether you need to redistribute these networks from EIGRP back into BGP. If not then you should simply filter them out in the redistribution command using a suitable prefix-list or a route-map. In such case, the BGP will not consider these networks as locally injected, and will instead consider the best path to be the path through the BGP neighbor which will subsequently have a better administrative distance than the EIGRP.
Are you sure you need to redistribute those networks into BGP?