Hello Bruce
An eBGP router will only share with other eBGP routers, prefixes that are in its local BGP table. In order to enter the BGP table, a particular prefix must either be indicated using the network command on the router to which that network is directly connected, or using redistribution from another routing protocol.
In the scenario that you describe in question 1, you can do one of two things:
- issue the network command on R1 for that particular prefix. This will place the prefix in the BGP table, and thus this prefix will be shared using iBGP with R2. R2 will have the prefix in its BGP table, and will be able to share it using eBGP with R3.
- don’t issue the network command on R1, but employ redistribution on R2, where you can redistribute the prefix from EIGRP to BGP. The result is that the prefix enters the BGP table of R2 and is shared with R3 using eBGP.
Now from the point of view of R3, both will work equally. But within the AS of R1 and R2, the way in which the prefix is learned by R2 is different. For a small network like the one, you have here, using one or the other method will make little difference. But as your AS gets larger, it becomes more difficult to manage such a network, to remember what prefix you’ve redistributed to BGP and what you haven’t. Imagine you have hundreds of prefixes on dozens of routers, it would become almost impossible to go into your eBGP router and redistribute selectively the networks you want to share with another AS using eBGP.
Additionally, if you use only redistribution, you will not be able to take advantage of other BGP features such as route reflectors, confederations, and peer groups, which vastly simplify BGP implementation.
For this reason, in production networks, you would typically use the network
command on the local routers to which the networks are directly connected, in order to indicate what prefixes you’d like BGP to share. The redistribution
command is then used to implement exceptions, where you would like a slightly different behavior for particular destinations.
Concerning your second question, yes you could create a route map to filter out prefixes you don’t want to share with other BGP routers. Ultimately, however, if you have prefixes that you simply don’t want to be advertised outside of an AS, then just don’t include them in your network
commands (or your redistribution
commands). If however, you want a scenario where you need to share a particular prefix with one AS, but not with another, then yes, the most direct and simplest way is to use a route map. But you can also use prefix lists and distribute lists to filter BGP, and examples of both of those options can be seen here:
I hope this has been helpful!
Laz