BGP <--> OSPF sample config

Unanswered Question
Nov 11th, 2009
User Badges:


Later today I need to configure an MPLS router running BGP to send advertisements to my LAN switch running OSPF and I need my LAN switch to send the LAN subnets into BGP.

Can anyone provide a sample config please? I'm assuming this can all be done on the BGP router and nothing would be needed on my LAN switch, but please advise.

Example network info:



Inside networks: and exists in another MPLS site so I can't collapse the network at this time.



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Giuseppe Larosa Wed, 11/11/2009 - 05:17
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

Hello Jeff,

in BGP you can advertise a prefix known in the IP routing table by any means with:

router bgp xx

network mask

network mask

network mask

network mask

if the MPLS link is the exit point towards everything you can have the router running BGP and OSPF to inject a default route in OSPF

router ospf 10

default-information originate

without always option the default route is injected only if a default route is present in the router IP routing table by any means, static route or BGP route.

if only some prefixes have to learned you need to redistribute BGP into OSPF

router ospf 10

red bgp xx subnets

! the subnets keyword is very important to correctly inject routes into OSPF

Hope to help



This Discussion