ads2

Thursday, 27 November 2014

MPLS: OSPF sham-links

Introduction
The provider’s MPLS cloud has three routers namely – R1 (P-router), R2 (PE-R2) and R3 (PE-R3). These routers formed OSPF adjacency with one another. R2 and R3 are iBGP neighbors peering with each other’s loopback address.
The TTL propagation within the MPLS cloud was suppressed with no mpls ip propagate-ttl command. This is to “hide” the number of mpls routers that exist within the provider’s MPLS core.
Reason to use ospf sham link
It is possible that customer’s network has an OSPF backdoor link to each other despite subscribing MPLS service which links customer’s edge routers.
R4 and R5 has OSPF backdoor link between them.
The OSPF link through the MPLS cloud would be an inter-area link despite both site-a and site-b links are in OSPF area 0, this poses a problem if customer wants traffic to traverse from site-a to site-b or vice versa through the MPLS core. OSPF will prefer the intra-area route, in this case is the backdoor link which resides in the same OSPF area, to reach the destination.
To solve this problem, OSPF sham link is used.

Steps to configure OSPF sham link
The OSPF sham link is only created at the PE-routers, the operation is transparent to customer.
1. Create a loopback address, assign a VRF instance and assign a /32 mask IP address.
1
2
3
4
5
!
interface Loopback20
 ip vrf forwarding site-a
 ip address 20.20.20.20 255.255.255.255
!
Step 2: Advertise the vrf loopback address into BGP vrf instance.
1
2
3
4
5
6
7
8
9
10
router bgp 65000
......
!
 address-family ipv4 vrf site-a
  redistribute ospf 2 vrf site-a
  no synchronization
  network 20.20.20.20 mask 255.255.255.255
 exit-address-family
!
......
Step 3: Create another OSPF process, attached to a VRF instance and insert the area x sham-link command.
1
2
3
4
5
6
7
!
router ospf 2 vrf site-a
 log-adjacency-changes
 area 0 sham-link 20.20.20.20 30.30.30.30
 redistribute bgp 65000 subnets
 network 192.168.0.13 0.0.0.0 area 0
!
Verify OSPF sham-link
If OSPF sham-link is successful you will see this syslog message:
*Mar 1 00:01:16.643: %OSPF-5-ADJCHG: Process 2, Nbr 30.30.30.30 on OSPF_SL0 from LOADING to FULL, Loading Done
You can see OSPF adjacency is formed between the OSPF sham-link by using show ip ospf neighbor command.
1
2
3
4
5
6
7
8
R2#show ip ospf neighbor
 
Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           0   FULL/  -        00:00:32    192.168.0.10    Serial0/1
1.1.1.1           0   FULL/  -        00:00:30    192.168.0.1     Serial0/0
192.168.0.21      1   FULL/DR         00:00:30    192.168.0.14    FastEthernet1/0
30.30.30.30       0   FULL/  -           -        30.30.30.30     OSPF_SL0
R2#
You can verify sham-link status by using show ip ospf sham-links command.
1
2
3
4
5
6
7
8
9
10
11
12
13
R2#show ip ospf sham-links
Sham Link OSPF_SL0 to address 30.30.30.30 is up
Area 0 source address 20.20.20.20
  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:06
    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
R2#
the flow of the command is area area number sham-links source ip address destination ip address
The CE router will prefer the route towards the PE-router.
1
2
3
4
5
6
7
8
9
10
11
12
R4#sh ip route | beg Gate
Gateway of last resort is not set
 
     20.0.0.0/32 is subnetted, 1 subnets
O E2    20.20.20.20 [110/1] via 192.168.0.13, 00:02:40, FastEthernet1/0
     192.168.0.0/30 is subnetted, 3 subnets
C       192.168.0.12 is directly connected, FastEthernet1/0
O       192.168.0.16 [110/3] via 192.168.0.13, 00:02:30, FastEthernet1/0
C       192.168.0.20 is directly connected, FastEthernet2/0
     30.0.0.0/32 is subnetted, 1 subnets
O E2    30.30.30.30 [110/1] via 192.168.0.13, 00:02:37, FastEthernet1/0
R4#
As seen from CE router’s routing table to reach site-b from site-a, CE site-a router prefers the route via the PE-router (192.168.0.13).
The E2 routes are vrf loopback interfaces of PE-routers use for sham-links, these routes are E2 because they are redistributed in OSPF vrf instance.
1
2
3
4
5
6
7
!
router ospf 2 vrf site-b
 log-adjacency-changes
 area 0 sham-link 30.30.30.30 20.20.20.20
 redistribute bgp 65000 subnets
 network 192.168.0.17 0.0.0.0 area 0
!
From CE site-a traceroute:
1
2
3
4
5
6
7
8
9
R4#traceroute 192.168.0.18
 
Type escape sequence to abort.
Tracing the route to 192.168.0.18
 
  1 192.168.0.13 116 msec 56 msec 20 msec
  2 192.168.0.17 92 msec 48 msec 20 msec
  3 192.168.0.18 104 msec *  132 msec
R4#
192.168.0.13 is the PE-R2 router, 192.168.0.17 is the PE-R3 router and finally the 192.168.0.18 is the destination CE site-b router.
Entire lab configurations
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
################
R1 is P router #
################
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
 log config
  hidekeys
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 11.11.11.11 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/0
 bandwidth 2000
 ip address 192.168.0.1 255.255.255.252
 mpls ip
 clock rate 2000000
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/1
 bandwidth 2000
 ip address 192.168.0.5 255.255.255.252
 mpls ip
 clock rate 2000000
!
interface Serial0/2
 no ip address
 shutdown
 clock rate 2000000
!
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 passive-interface default
 no passive-interface Serial0/0
 no passive-interface Serial0/1
 network 11.11.11.11 0.0.0.0 area 0
 network 192.168.0.1 0.0.0.0 area 0
 network 192.168.0.5 0.0.0.0 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end
 
############
R2 is PE-R2#
############
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
ip vrf site-a
 rd 2.2.2.2:2
 route-target export 2:2
 route-target import 3:3
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
 log config
  hidekeys
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 22.22.22.22 255.255.255.255
!
interface Loopback20
 ip vrf forwarding site-a
 ip address 20.20.20.20 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/0
 bandwidth 2000
 ip address 192.168.0.2 255.255.255.252
 mpls ip
 clock rate 2000000
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/1
 bandwidth 2000
 ip address 192.168.0.9 255.255.255.252
 mpls ip
 clock rate 2000000
!
interface Serial0/2
 no ip address
 shutdown
 clock rate 2000000
!
interface FastEthernet1/0
 ip vrf forwarding site-a
 ip address 192.168.0.13 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet2/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
router ospf 2 vrf site-a
 log-adjacency-changes
 area 0 sham-link 20.20.20.20 30.30.30.30
 redistribute bgp 65000 subnets
 network 192.168.0.13 0.0.0.0 area 0
!
router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 passive-interface default
 no passive-interface Serial0/0
 no passive-interface Serial0/1
 no passive-interface Loopback0
 network 22.22.22.22 0.0.0.0 area 0
 network 192.168.0.2 0.0.0.0 area 0
 network 192.168.0.9 0.0.0.0 area 0
!
router bgp 65000
 no synchronization
 bgp log-neighbor-changes
 neighbor 33.33.33.33 remote-as 65000
 neighbor 33.33.33.33 update-source Loopback0
 no auto-summary
 !
 address-family vpnv4
  neighbor 33.33.33.33 activate
  neighbor 33.33.33.33 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf site-a
  redistribute ospf 2 vrf site-a
  no synchronization
  network 20.20.20.20 mask 255.255.255.255
 exit-address-family
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end
 
############
R3 is PE-R3#
############
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
ip vrf site-b
 rd 3.3.3.3:3
 route-target export 3:3
 route-target import 2:2
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
 log config
  hidekeys
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 33.33.33.33 255.255.255.255
!
interface Loopback30
 ip vrf forwarding site-b
 ip address 30.30.30.30 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/0
 bandwidth 2000
 ip address 192.168.0.6 255.255.255.252
 mpls ip
 clock rate 2000000
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/1
 bandwidth 2000
 ip address 192.168.0.10 255.255.255.252
 mpls ip
 clock rate 2000000
!
interface Serial0/2
 no ip address
 shutdown
 clock rate 2000000
!
interface FastEthernet1/0
 ip vrf forwarding site-b
 ip address 192.168.0.17 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet2/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
router ospf 2 vrf site-b
 log-adjacency-changes
 area 0 sham-link 30.30.30.30 20.20.20.20
 redistribute bgp 65000 subnets
 network 192.168.0.17 0.0.0.0 area 0
!
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 network 33.33.33.33 0.0.0.0 area 0
 network 192.168.0.6 0.0.0.0 area 0
 network 192.168.0.10 0.0.0.0 area 0
!
router bgp 65000
 no synchronization
 bgp log-neighbor-changes
 neighbor 22.22.22.22 remote-as 65000
 neighbor 22.22.22.22 update-source Loopback0
 no auto-summary
 !
 address-family vpnv4
  neighbor 22.22.22.22 activate
  neighbor 22.22.22.22 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf site-b
  redistribute ospf 2 vrf site-b
  no synchronization
  network 30.30.30.30 mask 255.255.255.255
 exit-address-family
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end
 
#################
R4 is CE site-a #
#################
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
 log config
  hidekeys
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/0
 no ip address
 shutdown
 clock rate 2000000
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/1
 no ip address
 shutdown
 clock rate 2000000
!
interface Serial0/2
 no ip address
 shutdown
 clock rate 2000000
!
interface FastEthernet1/0
 ip address 192.168.0.14 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet2/0
 ip address 192.168.0.21 255.255.255.252
 ip ospf cost 100
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.14 0.0.0.0 area 0
 network 192.168.0.21 0.0.0.0 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end
 
################
R5 is CE site-b#
################
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
 log config
  hidekeys
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/0
 no ip address
 shutdown
 clock rate 2000000
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/1
 no ip address
 shutdown
 clock rate 2000000
!
interface Serial0/2
 no ip address
 shutdown
 clock rate 2000000
!
interface FastEthernet1/0
 ip address 192.168.0.18 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet2/0
 ip address 192.168.0.22 255.255.255.252
 ip ospf cost 100
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.18 0.0.0.0 area 0
 network 192.168.0.22 0.0.0.0 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end

1 comment: