Configuring OSPF sham links

OSPF can be used to propagate links between a Customer Edge device (CE) and a Provider Edge device (PE). Normal operation of this type of network assumes that the only connections between CEs pass through the provider network. However, when other links or routes between the CEs exist within the same area, problems can arise due to the OSPF preference for Intra-area links over Inter-area links.

Problems can be avoided by creating a virtual intra-area OSPF link between two PEs. This virtual link is called a sham link. When the OSPF instances exist in the same area, a sham link causes OSPF to treat the route through the service provider network as an intra-area link instead of an inter-area link.

Note

Note

When no backdoor link exists, no purpose exists for creating a sham link.

A cost is assigned to the sham link to help the OSPF network determine when to route over the sham link and when to route over the backdoor link. Because this virtual link (sham-link) appears as an intra-area link, the OSPF areas in which each of the PEs reside must be the same.

To configure an OSPF sham link, use the command for creating a sham link on both the local device and the remote PE device. Before attempting to create a sham link, note the following important information:

The first example that follows illustrates the command for creating an OSPF sham link between PE devices. The command shows the command entry on one device with a source IP address of 10.2.2.1 and destination address of 10.2.2.2. The second example shows the complete configuration sequence (from both PE devices) and uses the show ip route vrf command that is used for viewing the sham link.

Use this command in the OSPF VRF configuration level.

(config-ospf-router)# area 1 sham-link 10.2.2.1 10.2.2.2 cost 10

Syntax: [no] area area_id sham-link source_address /destination_address cost cost_value

Possible values :

The area_id variable is the ID number of the OSPF area assigned to the sham ink being defined in this command.

The source_address variable is the IP address of the source PE device.

The destination_address variable is the IP address of the destination PE device.

The cost_value variable sets the OSPF cost for sending packets over the sham link. This parameter can be a numeric value in the range 1 - 65535.

Sham link configuration on PE1

The following illustrates the configuration for PE1:

router ospf vrf CustomerA
area 1
area 1 sham-link 172.31.255.1 172.31.255.2 cost 1
redistribution bgp 

interface loopback 2
vrf forwarding CustomerA
ip address 172.31.255.1/32
!
 

Sham link configuration on PE2

The following illustrates the configuration for PE2:

router ospf vrf CustomerA
area 1 
area 1 sham-link 172.31.255.2 172.31.255.1 cost 1
redistribution bgp 

interface loopback 2
vrf forwarding CustomerA
ip address 172.31.255.2/32
!