OSPF sham link

I wanna set up from 0 the ospf sham link to simulate here in my network, see debugs, etc.

I have the following scenario:

CE1-------BACKDOOR LINK---------------CE2

  |                                                           |

  |                                                           |

  |                                                            |

VRF VPN-1                                             VRF VPN-2

PE1                                                            PE2


                     MP-BGP between PE's

I could set up the OSPF between PE1 -CE1 on VPN-1 and PE2-CE2 on VPN-2 , also I could set up the MP BGP between PE's.

The Backdoor link is using OSPF AREA 0, as well the links to PE's.

Between the PE's I am running OSPF, BGP, mpls.

What do I need to do now to simulate a sham-link ? 

thanks a lot.


  • Hi Renato,

         You need now to create 2 loopback interfaces and assign them to the VRF in question. I believe although you use different names you have the same RD, right?

         Advertise those loopbacks in BGP but not in OSPF.

         After that, you only need to go into ospf process and configure the sham-link (area x sham-link source destination), remember to make the cost of this link smaller than the cost through backdor link.

  • I wanna set up from 0 the ospf sham link to simulate here in my network, see debugs, etc.


    Please go through the link and refer to the sham-link configuration example. I think you need very basic understanding on this topic. 



  • Create 2 new loopback interfaces - one on each PE router - they must reside in the respective VRFs. For example:

    • Loopback_A in VRF VPN-1 on PE1
    • Loopback_B in VRF VPN-2 on PE2
    Next you need to ensure that these loopbacks are advertised between the VRFs on the PE routers using MP-BGP. The loopbacks must be advertised using BGP and not OSPF, this is very important else the sham link will not work. If they are advertised via OSPF then they will be installed in the routing table as OSPF routes because the administrative distance of OSPF is 110 whereas for iBGP it is 200. For the sham-link to work the endpoints must be learned via BGP.

    Finally, you need to configure the sham link under the VRF OSPF routing process on the PE routers.

    For example, on PE1:

    conf t

     router ospf <process-id> vrf VPN-1

      area 0 sham-link <Loopback_A> <Loopback_B> cost <cost>


    On PE2:

    conf t

     router ospf <process-id> vrf VPN-2

      area 0 sham-link <Loopback_B> <Loopback_A> cost <cost>


    Hope that helps.
Sign In or Register to comment.