Content

| 9.10 |  | BGP Redistribution |
| 9.10.4 |  | BGP redistribution configuration example |

As with IGP routes, all known static routes can be injected into BGP using the redistribute command. A subset of static routes can be injected using the BGP network command. Again, the network command provides greater control, while increasing the administrative burden.

Figure demonstrates how routing information can be injected dynamically into BGP.

Issue the following commands to configure RTB in the Figure to redistribute OSPF learned routes into BGP dynamically:

> RTB(config)#router bgp 200
> RTB(config-router)#neighbor 10.1.1.2 remote-as 100
> RTB(config-router)#neighbor 10.1.1.2 route-map BLOCK-BAD-ADDRESSES out
> RTB(config-router)#redistribute ospf 1 match internal metric 50
> RTB(config-router)#redistribute static

For insurance, configure a route map that matches any private addresses that are not to be advertised outside the AS. The route map, appropriately called BLOCK-BAD-ADDRESSES, is applied to outbound BGP updates. Also, BGP has been configured to redistribute only internal OSPF routes and assign them a metric of 50. The

redistribute static command will dynamically populate BGP with any static routes that RTB happens to be configured with.

Alternatively, configure RTB to inject internal routes semi dynamically, by using the BGP

network command as follows:

> RTB(config)#router bgp 200
> RTB(config-router)#neighbor 10.1.1.2 remote-as 100
> RTB(config-router)#neighbor 10.1.1.2 route-map BLOCK-BAD-ADDRESSES out
> RTB(config-router)#network 192.168.1.0
> RTB(config-router)#network 192.168.2.0

If RTB is configured accordingly, it will not inject all the internal routes into BGP. Only the two networks specified, 192.168.1.0 and 192.168.2.0, will be injected, although all of them could have been configured the same way. In a sense, the BGP

network command redistributes the specified IGP route into BGP, allowing for precise control.

| Lab Activity e-Lab Activity: BGP Redistribution configuration Example This lab redistributes OSPF learned routes into BGP dynamically.