BGP and OSPF Routing Redistribution Lab – default-information originate

Redistribute BGP and ospf

BGP and OSPF redistribution network lab fully configured in GNS3 in order to explains the behavior of Open Shortest Path First (OSPF) to Border Gateway Protocol (BGP) redistribution on Cisco routers.

Goal -: in this network Lab, we have achieved network redundancy, Routing engineering, default route advertisement by using BGP and OSPF.by reference this network lab you can learn BGP, OSPF and route redistribute between BGP and OSPF and will learn to advertise default into OSPF area from ABR.




GNS3 LAB Description-

Network Design component-:

  • Cisco Router – GNS3 Router (Cisco 3660)
  • Cisco Switch – (Cisco 3745)

Routing Gears in Lab-:

  • BGP – EBGP between Edge Router and ISP
  • IBGP – IBGP between R1 and R2
  • OSPF – LAN Routing
  • Redistribution – OSPF Redistribution BGP
  • Default Route – OSPF default-information originate
  • Metric – Best Path Selection

Network Design Brief-:

  • This network design alone with two BGP AS (autonomous system) with single-homed BGP environment. LAN routing with OSPF and WAN routing with BGP.
  • Two VALN configured on LAN core switch. (Vlan10 and Vlan2)
  • Vlan10 – Users Lan (192.168.1.0/24)
  • Vlan2 – Outside to edge Routers (172.16.1.0/24)
  • AS1000 – Core-switch, R1 and R2 (Edge Router)
  • AS2000 – ISP Router.

Routing Brief-:

  • EBGP routing between R1 and R3 ,  R2 and R3
  • IBGP Routing Between R1 and R2
  • OSPF Routing between R1 and Core-Switch, R2 and Core-switch
  • Routing Redistribution (OSPF and BGP) is happing on Edge Router (R1 and R2)
  • Edge routers (R1 and R2) advertisement default route (default-information originate always) in OSPF toward inside on Core-switch along with Metric weight.
  • Core-switch containing only default router receiving via OSPF. Hence, Core-switch only holding default -route to reach external network route pointing by R1 and R2.
  • Core-switch receiving default router with lower administrative distance (Metric) AD 100 from R1 and receiving default router with AD 200 from R2.
  • Core-switch excepting route from R1 as primary route, Since AD 100. Backup route as R2 with AD 200
  • iBGP (between R1 and R1) will take care the Network redundancy in case primary link goes down.

🔔default-information originate

default-information originate always under OSPF routing to automatically generate a default route pointing to that Router, which then will be advertised downstream device.

BGP and OSPF redistribution Lab – Default route originate into OSPF




Let’s Start to Build Basic Config -:

ESW1#

interface Vlan2
ip address 172.16.1.1 255.255.255.0
!
interface Vlan10
ip address 192.168.1.1 255.255.255.0
!

VLAN Name                           Status    Ports

---- ----------------------------- --------- -------------------------------

1    default                       active    Fa1/2, Fa1/3, Fa1/4, Fa1/5, Fa1/6, 
                                             Fa1/7, Fa1/8, Fa1/9,Fa1/11, Fa1/12, 
                                             Fa1/13, Fa1/14, Fa1/15

2    outside-vlan                  active    Fa1/0, Fa1/1

10   data                          active    Fa1/10
R1#

!
interface FastEthernet0/0
ip address 172.16.1.2 255.255.255.0
duplex auto
speed auto
!
interface Ethernet1/0
ip address 172.16.2.1 255.255.255.252
half-duplex
!
R2#

!
interface FastEthernet0/0
ip address 172.16.1.3 255.255.255.0
duplex auto
speed auto
!
interface Ethernet1/0
ip address 172.16.3.1 255.255.255.252
half-duplex
!
R3#

interface Loopback0
ip address 10.1.1.1 255.255.255.0
!
!
interface Ethernet1/0
ip address 172.16.2.2 255.255.255.252
half-duplex
!
interface Ethernet1/1
ip address 172.16.3.2 255.255.255.252
half-duplex
!

All Four devices (ESW1, R1 ,R2 and R3) Basic Vlan and Interface Configuration Completed. Please continue follow the next Steps of Config.


Routing Configuration -: 

ESW1#

!
router ospf 10
log-adjacency-changes
network 172.16.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
!

ESW1# configured ospf with Area 0 and defined the connected network that need to advertise.

R1#
!
router ospf 10
log-adjacency-changes
network 172.16.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
!
router bgp 1000
no synchronization
bgp log-neighbor-changes
neighbor 172.16.1.3 remote-as 1000
neighbor 172.16.1.3 next-hop-self
neighbor 172.16.2.2 remote-as 2000
no auto-summary
!
R2#
!
router ospf 10
log-adjacency-changes
network 172.16.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
!
router bgp 1000
no synchronization
bgp log-neighbor-changes
neighbor 172.16.1.2 remote-as 1000
neighbor 172.16.1.2 next-hop-self
neighbor 172.16.3.2 remote-as 2000
no auto-summary
!
R3#
!
router bgp 2000
no synchronization
bgp log-neighbor-changes
network 10.1.1.0 mask 255.255.255.0
neighbor 172.16.2.1 remote-as 1000
neighbor 172.16.3.1 remote-as 1000
no auto-summary
!
  • R1 and R2 configured BGP and ospf routing.
  • Both Router are part of AS 1000
  • OSPF Routing has been established between R1 ,R2 and ESW1#
  • EBGP peering between R1 , R2 and R3 has been established.
  • IBGP peering between R1 and R2  has been established.

Redistribute Route OSPF and BGP-

R1#
!
router ospf 10
log-adjacency-changes
redistribute bgp 1000
network 172.16.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
!
router bgp 1000
no synchronization
bgp log-neighbor-changes
redistribute ospf 10
neighbor 172.16.1.3 remote-as 1000
neighbor 172.16.1.3 next-hop-self
neighbor 172.16.2.2 remote-as 2000
no auto-summary
!
R2#
!
router ospf 10
log-adjacency-changes
redistribute bgp 1000
network 172.16.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0

!
router bgp 1000
no synchronization
bgp log-neighbor-changes
redistribute ospf 10
neighbor 172.16.1.2 remote-as 1000
neighbor 172.16.1.2 next-hop-self
neighbor 172.16.3.2 remote-as 2000
no auto-summary
!

On both Edge Routers (R1 and R2) have configured BGP and OSPF routes redistribution completed.

The following command used for redistribution between BGP and OSPF Routing domains.

redistribute bgp (AS) – This command redistributes only OSPF intra- and inter-area routes into BGP

redistribute ospf (Process-ID) – Redistribute  OSPF routes into BGP.


Default Route into OSPF-

default-information originate always – command used to automatically generate a default route pointing to that Router, which then will be advertised downstream to OSPF running Devices.

OSPF does’t take the default router in database unless you configure default-information originate always within the router ospf configuration.

R1#
!
router ospf 10
log-adjacency-changes
redistribute bgp 1000
network 172.16.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
default-information originate always metric 100
!
R2#
!
router ospf 10
log-adjacency-changes
redistribute bgp 1000
network 172.16.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
default-information originate always metric 200
!

default-information originate always used to inject default route into OSPF routing domain.

Metric used to manipulate the path that route coming from upstream routers.

R1 – default-information originate always metric 100 (AD -100)

R2 – default-information originate always metric 200 (AD -200)

R1 will be select primary path, Since R1 come with AD value 100.


Route Verification -:

ESW1#

ESW1#sh ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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 172.16.1.2 to network 0.0.0.0

172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Vlan2
C 192.168.1.0/24 is directly connected, Vlan10
O*E2 0.0.0.0/0 [110/100] via 172.16.1.2, 02:44:45, Vlan2
ESW1#

On Switch – Traffic Exit from Lan switch (ESW1#) via R1 

Default route shows AD – 100 – [110/100]

Only Default Route is being advertised by R1 via OSPF – O*E2 0.0.0.0/0 [110/100]

 

Author: Ronnie Singh

Your Feedback is Valuable for us. Pls do comments.