7 mins read

OSPF Sham Link

1. Intro

We will demonstrate the Sham Link usage with the following setup. We have CE1 and CE2 router that have a backdoor link between them. The main path between CE1 and CE2 should be via the MPLS L3VPN, so we configured a high metric between CE1 and CE2, as depicted in the next figure:

Here is the configuration:

But even with that high metric, the preferred path is still using the direct backdoor link.

2. Test the MPLS path

We will disable the link between CE1 and CE2 then test MPLS path:

3. The Sham Link

As we can see in the code snippet above, the routes that are redistributed from the L3VPN BGP protocol are installed in the OSPF database as Type 3 (Summary) LSAs. Type 1 LSA (Router) are preferred over Type 3 LSA (Summary), irrespective of the metric, hence our issue.

The solution is to create a Sham Link between PE1 and PE2,

4. Final test

Now we have the Sham link between PE1 and PE2, this should solve the issue:

### First enable the link between CE1 and CE2: 

root@R4# rollback 1 
load complete

[edit]
root@R4# show | compare 
[edit interfaces ge-0/0/2]
-   disable;

[edit]
root@R4# commit 
commit complete
### The OSPF neighborship between CE1 and CE2 is back up: 

root@R4# run show ospf neighbor 
Address          Interface              State           ID               Pri  Dead
17.18.2.1        ge-0/0/1.0             Full            192.168.100.1    128    39
17.8.3.2         ge-0/0/2.0             Full            192.168.46.5     128    31

### Let's test with a ping: 

root@R4# run traceroute 192.168.45.5 
traceroute to 192.168.45.5 (192.168.45.5), 30 hops max, 52 byte packets
 1  17.18.2.1 (17.18.2.1)  3.997 ms  2.467 ms  2.341 ms
 2  * * *
 3  192.168.100.6 (192.168.100.6)  4.953 ms  4.491 ms  4.849 ms
 4  192.168.45.5 (192.168.45.5)  8.813 ms  5.807 ms  6.302 ms

root@R4# run show route 192.168.45.5 

inet.0: 22 destinations, 22 routes (22 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

192.168.45.5/32    *[OSPF/10] 00:05:55, metric 30
                    >  to 17.18.2.1 via ge-0/0/1.0

Now the setup is working as expected, it using the path via the L3VPN and the backdoor link is less preferred.


External Resources:

Leave a Reply

Your email address will not be published. Required fields are marked *