OSPF Sham Link

Few Points on Sham Link;

Why we need a sham link;

In MPLS-VPN, there might be 2 link connecting two sites of a same customer;

1) Via MPLS core network

2) Direct Backdoor link.

If  OSPF is used in the customer environment and and both the sites have same process ID (Domain ID), then the Site1 routes will be distributed as inter-area (Lype-3,summary LSA) into site2 via MPLS network and as intraarea routes via backdoor link. So, the traffic from site1 to 2 passes via backdoor link and not via MPLS as OSPF process prefers intraarea routes rather than inter-area.

To override, above condition, a sham link is configured between 2 PE routers (connecting to site1 and site2) which act as a intra-area link., so that site1 routes will be flooded as type-1/type-2 LSAs.

If there is no backdoor link, sham link is not necessary.

Steps:

1) configure a loopback interface with vrf enabled. assign a /32 ip address.

2) This route should not be advertise via OSPF. Advertise via MP-iBGP.

3) Configure “area x sham-link <src-ip> <des-ip> cost  <>” where ‘x’ is the area on both side of PE-routers. (site ospf area)

Here is the configurations snap;

R0—– R2(PE)——–MPLS—–R5(PE)——R6

R0 and R6 routers have links in area-0. when a backdoor link is connected between R0 and R6, the routers are learned via backdoor.

R0#show ip route 6.6.6.6
Routing entry for 6.6.6.6/32
Known via “ospf 1”, distance 110, metric 3, type inter area
Last update from 12.1.1.1 on FastEthernet0/1, 00:01:05 ago
Routing Descriptor Blocks:
* 12.1.1.1, from 12.12.12.12, 00:01:05 ago, via FastEthernet0/1
Route metric is 3, traffic share count is 1
R0#
R0#
*Mar  1 00:23:10.367: %OSPF-5-ADJCHG: Process 1, Nbr 6.6.6.6 on FastEthernet1/0 from LOADING to FULL, Loading Done <<Backdoor neighborship
R0#
R0#show run int fa 1/0
ip address 12.1.3.1 255.255.255.0
duplex auto
speed auto
end
R0#
R0#
R0#show ip route 6.6.6.6  <<< backdoor route is preferred.
Routing entry for 6.6.6.6/32
Known via “ospf 1”, distance 110, metric 2, type intra area
Last update from 12.1.3.2 on FastEthernet1/0, 00:00:02 ago
Routing Descriptor Blocks:
* 12.1.3.2, from 6.6.6.6, 00:00:02 ago, via FastEthernet1/0
Route metric is 2, traffic share count is 1
R0#
Configuring Sham-link on PE routers:
R2(config)#
R2(config)#int lo 5
R2(config-if)#no ip address
R2(config-if)#ip vrf forwarding one
R2(config-if)# ip address 50.50.50.50 255.255.255.255    <<<< step-1
R2(config)#router bgp 1
R2(config-router)#address-family ipv4 vrf one
R2(config-router-af)#
R2(config-router-af)#network 50.50.50.50 m  255.255.255.255 <<<< step-2

R2(config)#router ospf 2 vrf one
R2(config-router)#area 0 sham-link 50.50.50.50 51.51.51.51 cost 1  <<<< step-3
similary on R5;

R5(config)#
R5(config)#int lo 5
R5(config-if)#no ip address
R5(config-if)#ip vrf forwarding one
R5(config-if)# ip address 51.51.51.51 255.255.255.255    <<<< step-1
R5(config)#router bgp 1
R5(config-router)#address-family ipv4 vrf one
R5(config-router-af)#
R5(config-router-af)#network 51.51.51.51 m  255.255.255.255  <<<< step-2

R5(config)#router ospf 2 vrf one
R5(config-router)#area 0 sham-link 51.51.51.51 50.50.50.50 cost 1  <<<< step-3

R5#

*Mar  1 02:54:56.963: %OSPF-5-ADJCHG: Process 2, Nbr 12.12.12.12 on OSPF_SL1 from LOADING to FULL, Loading Done
R5#show ip ospf sham-links
Sham Link OSPF_SL1 to address 50.50.50.50 is up
Area 0 source address 51.51.51.51
Run as demand circuit
DoNotAge LSA allowed. Cost of using 1 State POINT_TO_POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40,
Hello due in 00:00:05
Adjacency State FULL (Hello suppressed)
Index 2/2, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0) Next 0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
R5#
Now on,
Even after configuring Sham link, R0 shows the backdoor as best path. This is due to lowest metric. (metric count =2)

R0#show ip route 6.6.6.6
Routing entry for 6.6.6.6/32
Known via “ospf 1”, distance 110, metric 2, type intra area
Last update from 12.1.3.2 on FastEthernet1/0, 00:00:25 ago
Routing Descriptor Blocks:
* 12.1.3.2, from 6.6.6.6, 00:00:25 ago, via FastEthernet1/0
Route metric is 2, traffic share count is 1
Lets increase the backdoor link cost;

R0(config)#int fa 1/0
R0(config-if)#ip ospf cost 200
R0(config-if)#

R0#show ip route 6.6.6.6
Routing entry for 6.6.6.6/32
Known via “ospf 1”, distance 110, metric 4, type intra area
Last update from 12.1.1.1 on FastEthernet0/1, 00:00:15 ago
Routing Descriptor Blocks:
* 12.1.1.1, from 6.6.6.6, 00:00:15 ago, via FastEthernet0/1
Route metric is 4, traffic share count is 1
R0#
Now R0 is not pointed to backdoor interface for R6s’ loopback IP and takes MPLS path.
Good reference @ Cisco

Advertisements
This entry was posted in mpls and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s