This document shows how to redistribute Internal BGP routes into OSPF process. Like in other
IGP to IGP redistribution the behavior is different when redistributing IBGP into OSPF.
IBGP learned routes are not forwarded to an IGP routing protocol through the redistribute command.
Use command “bgp redistribute-internal” under the BGP process on the redistributing router.
In the scenario depicted here, router R1 and R2 are running IBGP and router R2/R3 running
OSPF Area 0. R1 is advertising two routes (1.1.1.1 /32 and 172.16.0.0 /16) through network command.
R2 is redistributing BGP into OSPF area 0. It is required to redistribute selected internal routes
(172.16.0.0 /16). The task is achieved by making use of prefix-list and route-map.
A prefix-list, named B2O, is configured on R2 to match the prefix 172.16.0.0
ip prefix-list B2O seq 5 permit 172.16.0.0/16
A route-map, named BGP-To_OSPF, is configured on R2
route-map BGP-To_OSPF permit 10
match ip address prefix-list B2O
In the vrification section, please check the output of “show ip route” command on R3.
Router R1
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Loopback1
ip address 172.16.1.1 255.255.0.0
!
interface Serial1/0
ip address 192.12.12.1 255.255.255.0
serial restart-delay 0
!
router bgp 100
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
network 172.16.0.0
neighbor 192.12.12.2 remote-as 100
no auto-summary
Router R2
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface Serial1/0
ip address 192.12.12.2 255.255.255.0
serial restart-delay 0
!
interface FastEthernet2/0
ip address 192.23.23.2 255.255.255.0
duplex auto
speed auto
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
redistribute bgp 100 metric 100 metric-type 1 subnets route-map BGP-To_OSPF
network 192.23.23.2 0.0.0.0 area 0
!
router bgp 100
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
bgp redistribute-internal
neighbor 192.12.12.1 remote-as 100
no auto-summary
!
ip prefix-list B2O seq 5 permit 172.16.0.0/16
!
route-map BGP-To_OSPF permit 10
match ip address prefix-list B2O
Router R3
interface FastEthernet1/0
ip address 192.23.23.3 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 192.23.23.3 0.0.0.0 area 0
‘show ip route’ on R3 :
O E1 172.16.0.0/16 [110/101] via 192.23.23.2, 00:57:55, FastEthernet1/0
192.23.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.23.23.0/24 is directly connected, FastEthernet1/0
Comments
(There are currently no comments for this post.)