A network likely uses several routing protocols, requiring redistribution to exchange routing information between them. With Border Gateway Protocol (BGP), route advertisement can also be done between different Autonomous Systems.
For the configuration example, Router1 is a BGP router. Router3 is configured with OSPF, Router4 with EIGRP, and Router5 can be reached using a static route. Router2 will learn these multiple routes.
Router Configuration
First, configure all of the routers’ physical and loopback interfaces. For the routing protocols, the configuration will be as follows, using the ‘network’ command to advertise routes:
Router1(config)#router bgp 100 Router1(config-router)#neighbor 172.16.1.2 remote-as 200 Router1(config-router)#network 172.16.1.0 mask 255.255.255.0 Router1(config-router)#network 1.1.1.1 mask 255.255.255.255
The ‘neighbor 172.16.1.2 remote-as 200’ command specifies the BGP neighbor router’s IP address and AS number.
Router3(config)#router ospf 200 Router3(config-router)#network 3.3.3.3 0.0.0.0 area 0 Router3(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router4(config)#router eigrp 200 Router4(config-router)#network 4.0.0.0 Router4(config-router)#network 192.168.4.0
Router2(config)#router eigrp 200 Router2(config-router)#network 192.168.4.0 Router2(config-router)#exit Router2(config)#router ospf 200 Router2(config-router)#network 192.168.3.0 0.0.0.255 area 0 Router2(config-router)#exit Router2(config)#router bgp 200 Router2(config-router)#neighbor 172.16.1.1 remote-as 100 Router2(config-router)#network 172.16.1.0 mask 255.255.255.0 Router2(config-router)#network 2.2.2.2 mask 255.255.255.255 Router2(config-router)#exit Router2(config)#ip route 5.5.5.5 255.255.255.255 192.168.5.2
Router2 learned the following routes:
Router2#show ip route ! Output Omitted for Brevity 1.0.0.0/32 is subnetted, 1 subnets B 1.1.1.1/32 [20/0] via 172.16.1.1, 00:00:00 2.0.0.0/32 is subnetted, 1 subnets C 2.2.2.2/32 is directly connected, Loopback0 3.0.0.0/32 is subnetted, 1 subnets O 3.3.3.3/32 [110/2] via 192.168.3.2, 00:39:13, GigabitEthernet0/0 4.0.0.0/32 is subnetted, 1 subnets D 4.4.4.4/32 [90/130816] via 192.168.4.2, 00:42:30, GigabitEthernet0/1 5.0.0.0/32 is subnetted, 1 subnets S 5.5.5.5/32 [1/0] via 192.168.5.2 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks ! Output Omitted for Brevity
Redistribution Configuration
First, let’s check Router1’s routing table:
Router1#show ip route ! Output Omitted for Brevity 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1/32 is directly connected, Loopback0 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.1.0/24 is directly connected, Serial0/0/0 L 172.16.1.1/32 is directly connected, Serial0/0/0
Now, let’s redistribute Router2’s learned routes into BGP using the ‘redistribute’ command under the router configuration mode:
Router2(config)#router bgp 200 Router2(config-router)#redistribute eigrp 200 Router2(config-router)#redistribute ospf 200 Router2(config-router)#redistribute static
Again, check Router1’s routes since it is the BGP peer.
Router1#show ip route ! Output Omitted for Brevity 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1/32 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnets B 2.2.2.2/32 [20/0] via 172.16.1.2, 00:00:00 3.0.0.0/32 is subnetted, 1 subnets B 3.3.3.3/32 [20/2] via 172.16.1.2, 00:00:00 4.0.0.0/32 is subnetted, 1 subnets B 4.4.4.4/32 [20/130816] via 172.16.1.2, 00:00:00 5.0.0.0/32 is subnetted, 1 subnets B 5.5.5.5/32 [20/0] via 172.16.1.2, 00:00:00 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.1.0/24 is directly connected, Serial0/0/0 L 172.16.1.1/32 is directly connected, Serial0/0/0 B 192.168.3.0/24 [20/1] via 172.16.1.2, 00:00:00 B 192.168.4.0/24 [20/2816] via 172.16.1.2, 00:00:00
The routes are now redistributed to Router1. The ‘show ip bgp’ or ‘show bgp ipv4 unicast’ commands can be used as well:
Router1#show ip bgp BGP table version is 10, local router ID is 1.1.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 1.1.1.1/32 0.0.0.0 0 0 32768 i *> 2.2.2.2/32 172.16.1.2 0 0 0 200 i *> 3.3.3.3/32 172.16.1.2 0 0 0 200 ? *> 4.4.4.4/32 172.16.1.2 0 0 0 200 ? *> 5.5.5.5/32 172.16.1.2 0 0 0 200 ? *> 172.16.1.0/24 0.0.0.0 0 0 32768 i * 172.16.1.2 0 0 0 200 i *> 192.168.3.0/24 172.16.1.2 0 0 0 200 ? *> 192.168.4.0/24 172.16.1.2 0 0 0 200 ?
The origin code ‘i’ stands for IGP, which are the routes learned from the network statement, and ‘?’ stands for incomplete or redistributed. The BGP route advertisements can also be redistributed to IGPs. For example, let’s redistribute the BGP routes to EIGRP:
Router2(config)#router eigrp 200 Router2(config-router)#redistribute bgp 200 metric 1500 1 255 1 1500
For EIGRP, the K-values can be specified. Here, the bandwidth is 1500, the delay is 1, the reliability is 255, the load is 1, and MTU is 1500. Let’s check Router4’s IP routing table:
Router4#show ip route ! Output Omitted for Brevity 1.0.0.0/32 is subnetted, 1 subnets D EX 1.1.1.1/32 [170/25602816] via 192.168.4.1, 00:59:52, GigabitEthernet0/1 2.0.0.0/32 is subnetted, 1 subnets D EX 2.2.2.2/32 [170/25602816] via 192.168.4.1, 00:59:58, GigabitEthernet0/1 4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4/32 is directly connected, Loopback0 172.16.0.0/24 is subnetted, 1 subnets D EX 172.16.1.0/24 [170/25602816] via 192.168.4.1, 00:59:53, GigabitEthernet0/1 192.168.4.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.4.0/24 is directly connected, GigabitEthernet0/1 L 192.168.4.2/32 is directly connected, GigabitEthernet0/1
EX stands for EIGRP external, which are routes learned via redistribution. Redistributing routes learned by BGP should be done carefully since the BGP table could have hundreds of thousands of routes.
Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.
We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: