10-1 redistribute protocol
< Free Open Study >
Syntax Description:
Purpose: To redistribute routes into BGP that have been learned via a routing protocol other than BGP. The metric of the non-BGP-learned routes is transferred to the metric or multi-exit discriminator (MED) of the new BGP route. Routes can be redistributed from connected, dvmrp, egp, eigrp, igrp, isis, iso-igrp, mobile, odr, ospf, rip, and static.
Cisco IOS Software Release: 10.0
Configuration Example: Redistributing Connected, Static, and EIGRP Learned Routes into BGP
In Figure 10-1 , Router C is advertising 172.16.2.0/24 and 172.16.3.0/24 to Router B via EIGRP. Routers A and B have an EBGP relationship. This example redistributes EIGRP and static into BGP on Router B and redistributes connected on Router A.
Figure 10-1. Redistributing Routes into BGP
Router A
interface loopback 0
ip address 172.16.0.1 255.255.255.0
!
interface loopback 1
ip address 172.16.1.1 255.255.255.0
!
router bgp 1
network 172.17.1.0 mask 255.255.255.0
neighbor 172.17.1.1 remote-as 2
___________________________________________________________________________
Router B
router eigrp 1
network 10.0.0.0
network 172.17.0.0
no auto-summary
!
router bgp 2
network 10.1.0.0 mask 255.255.255.252
network 172.17.1.0 mask 255.255.255.0
neighbor 172.17.1.2 remote-as 1
!
ip route 172.16.4.0 255.255.255.0 s2/0
___________________________________________________________________________
Router C
interface loopback 0
ip address 172.16.2.1 255.255.255.0
!
interface loopback 1
ip address 172.16.3.1 255.255.255.0
!
router eigrp 1
network 172.16.0.0
network 10.0.0.0
no auto-summary
Before proceeding with the redistribution of routes into BGP, inspect the IP and BGP routing tables on Routers A and B. Router B should be learning routes 172.16.2.0/24 and 172.16.3.0/24 from Router C via EIGRP. Because you are not redistributing routes on Router B, Router A should not be learning about the 172.16.2.0/24 or 172.16.3.0/24 routes.
rtrB#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
172.17.0.0/24 is subnetted, 1 subnets
C 172.17.1.0 is directly connected, Ethernet0/0
172.16.0.0/24 is subnetted, 3 subnets
S 172.16.4.0 is directly connected, Serial2/0
D 172.16.2.0 [90/1889792] via 10.1.1.2, 00:26:32, Serial2/0
D 172.16.3.0 [90/1889792] via 10.1.1.2, 00:26:32, Serial2/0
10.0.0.0/30 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Serial2/0
rtrB#show ip bgp
BGP table version is 3, local router ID is 172.17.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.0/30 0.0.0.0 0 32768 i
* 172.17.1.0/24 172.17.1.2 0 0 1 i
*> 0.0.0.0 0 32768 i
___________________________________________________________________________
rtrA#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
172.17.0.0/24 is subnetted, 1 subnets
C 172.17.1.0 is directly connected, FastEthernet0
172.16.0.0/24 is subnetted, 2 subnets
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
10.0.0.0/30 is subnetted, 1 subnets
B 10.1.1.0 [20/0] via 172.17.1.1, 00:25:38
rtrA#show ip bgp
BGP table version is 4, local router ID is 172.16.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.0/30 172.17.1.1 0 0 2 i
*> 172.17.1.0/24 0.0.0.0 0 32768 i
* 172.17.1.1 0 0 2 i
Notice that the metric for the EIGRP learned routes on Router B is 1889792. Because the form of the redistribute command that you will use does not contain a metric, the router uses the EIGRP metric for the BGP MED for the redistributed EIGRP routes. Now modify the BGP configuration on Router B to enable the redistribution of the EIGRP and static routes into BGP. Also modify the configuration on Router A to enable the redistribution of connected routes:
Router A
router bgp 1
network 172.17.1.0 mask 255.255.255.0
redistribute connected
neighbor 172.17.1.1 remote-as 2
___________________________________________________________________________
Router B
router bgp 1
network 10.1.0.0 mask 255.255.255.0
network 172.17.1.0 mask 255.255.255.0
redistribute static
redistribute eigrp 1
neighbor 172.17.1.2 remote-as 2
Verification
Verify that the connected routes are being redistributed in BGP on Router A and that the static and EIGRP routes are being redistributed on Router B:
rtrA#show ip bgp
BGP table version is 8, local router ID is 172.17.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0 0.0.0.0 0 32768 ?
*> 10.1.1.0/30 0.0.0.0 0 32768 i
*> 172.16.0.0 0.0.0.0 0 32768 ?
* 172.17.1.2 0 0 1 ?
*> 172.17.0.0 172.17.1.2 0 0 1 ?
*> 172.17.1.0/24 0.0.0.0 0 32768 i
* 172.17.1.2 0 0 1 i
__________________________________________________________________________
rtrB#show ip bgp
BGP table version is 19, local router ID is 172.16.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.0.0.0 172.17.1.1 0 0 2 ?
*> 10.1.1.0/30 172.17.1.1 0 0 2 i
* 172.16.0.0 172.17.1.1 0 0 2 ?
*> 0.0.0.0 0 32768 ?
*> 172.17.0.0 0.0.0.0 0 32768 ?
* 172.17.1.0/24 172.17.1.1 0 0 2 i
*> 0.0.0.0 0 32768 i
Why is the mask for the 172.16.x.x routes /16 (the entire Class B address 172.16.x.x)? By default, BGP summarizes redistributed routes on a classful boundary (see Chapter 2 , "Auto-Summary"). Routers A and B now indicate that they can reach the entire Class B address block 172.16.x.x. Typically, this is not the behavior you want. When redistributing routes into BGP, it is a good idea to turn off auto-summarization. Modify the BGP configuration on Routers A and B to do this. Notice that Router A also summarizes the 10.0.0.0 and 172.17.0.0 networks because they are also directly connected.
Router A
router bgp 1
network 172.17.1.0 mask 255.255.255.0
redistribute connected 5
neighbor 172.17.1.1 remote-as 2
no auto-summary
___________________________________________________________________________
Router B
router bgp 1
network 10.1.0.0 mask 255.255.255.252
network 172.17.1.0 mask 255.255.255.0
redistribute static 10
redistribute eigrp 15
neighbor 172.17.1.2 remote-as 2
no auto-summary
Reinspect the BGP tables on Routers A and B:
rtrA#show ip bgp
BGP table version is 8, local router ID is 172.16.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.0/30 172.17.1.1 0 0 2 i
*> 172.16.0.0/24 0.0.0.0 0 32768 ?
*> 172.16.1.0/24 0.0.0.0 0 32768 ?
*> 172.16.2.0/24 172.17.1.1 1889792 0 2 ?
*> 172.16.3.0/24 172.17.1.1 1889792 0 2 ?
*> 172.16.4.0/24 172.17.1.1 0 0 2 ?
* 172.17.1.0/24 172.17.1.1 0 0 2 i
*> 0.0.0.0 0 32768 i
___________________________________________________________________________
rtrB#show ip bgp
BGP table version is 19, local router ID is 172.17.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.0/30 0.0.0.0 0 32768 i
*> 172.16.0.0/24 172.17.1.2 0 0 1 ?
*> 172.16.1.0/24 172.17.1.2 0 0 1 ?
*> 172.16.2.0/24 10.1.1.2 1889792 32768 ?
*> 172.16.3.0/24 10.1.1.2 1889792 32768 ?
*> 172.16.4.0/24 0.0.0.0 0 32768 ?
* 172.17.1.0/24 172.17.1.2 0 0 1 i
*> 0.0.0.0 0 32768 i
The metric or MED value for the redistributed EIGRP routes is equal to the EIGRP metric for those routes. T he metric or MED value for the redistributed connected and static routes is 0.
Troubleshooting
Step 1. Verify that the BGP neighbors are in the Established state using the show ip bgp neighbors command.
If the neighbor relationship is not in the Established state, see section 8-23 .
Step 2. Verify that the protocol you are redistributing routes from is active on the router.
Step 3. When redistributing from a protocol that requires a process ID, verify that you are using the proper process ID in the redistribute command.
Step 4. Use the no auto-summary command under router BGP when redi stributing routes into BGP.
< Free Open Study >