@@ -110,7 +110,7 @@ admin@R1:/>
110
110
admin@R1:/ > configure
111
111
admin@R1:/config/ > set interface lo ipv4 address 10.1.1.1 prefix-length 32
112
112
admin@R1:/config/ > set interface eth0 ipv4 address 10.1.1.1 prefix-length 32
113
- admin@R1:/config/ > set interface eth0 ipv4 forwarding true
113
+ admin@R1:/config/ > set interface eth0 ipv4 forwarding
114
114
```
115
115
116
116
To view the changes done so far, use the ` diff ` command.
@@ -127,11 +127,11 @@ interfaces {
127
127
+ }
128
128
}
129
129
interface lo {
130
- ipv4 {
130
+ ipv4 {
131
131
+ address 10.1.1.1 {
132
132
+ prefix-length 32;
133
133
+ }
134
- }
134
+ }
135
135
}
136
136
}
137
137
```
@@ -146,12 +146,11 @@ admin@R1:/>
146
146
Status of IP address assignment can be viewed using ` show interfaces ` command.
147
147
148
148
``` console
149
- admin@R1:/ >
150
149
admin@R1:/ > show interfaces
151
150
INTERFACE PROTOCOL STATE DATA
152
151
eth0 ethernet UP 0c:ec:d1:04:00:00
153
- ipv4 10.1.1.1/32 (static)
154
- ipv6 fe80::eec:d1ff:fe04:0/64 (link-layer)
152
+ ipv4 10.1.1.1/32 (static)
153
+ ipv6 fe80::eec:d1ff:fe04:0/64 (link-layer)
155
154
eth1 ethernet DOWN 0c:ec:d1:04:00:01
156
155
eth2 ethernet DOWN 0c:ec:d1:04:00:02
157
156
eth3 ethernet DOWN 0c:ec:d1:04:00:03
@@ -162,9 +161,9 @@ eth7 ethernet DOWN 0c:ec:d1:04:00:07
162
161
eth8 ethernet DOWN 0c:ec:d1:04:00:08
163
162
eth9 ethernet DOWN 0c:ec:d1:04:00:09
164
163
lo ethernet UP 00:00:00:00:00:00
165
- ipv4 127.0.0.1/8 (static)
166
- ipv4 10.1.1.1/32 (static)
167
- ipv6 ::1/128 (other)
164
+ ipv4 127.0.0.1/8 (static)
165
+ ipv4 10.1.1.1/32 (static)
166
+ ipv6 ::1/128 (other)
168
167
admin@R1:/ >
169
168
```
170
169
@@ -180,18 +179,17 @@ are done within OSPF area context (here the backbone area 0.0.0.0 is
180
179
used).
181
180
182
181
``` console
183
- admin@R1:/config/ >
184
182
admin@R1:/config/ > edit routing control-plane-protocol ospfv2 name default
185
- admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > set ospf area 0.0.0.0 interface lo enabled true
186
- admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > set ospf area 0.0.0.0 interface eth0 enabled true
183
+ admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > set ospf area 0.0.0.0 interface lo enabled
184
+ admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > set ospf area 0.0.0.0 interface eth0 enabled
187
185
admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > set ospf area 0.0.0.0 interface eth0 interface-type point-to-point
188
186
admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ >
189
187
```
190
188
191
189
Changes can be shown with the ` diff ` command.
192
190
193
191
``` diff
194
- admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/> diff
192
+ admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/> diff
195
193
+ routing {
196
194
+ control-plane-protocols {
197
195
+ control-plane-protocol ospfv2 name default {
@@ -222,52 +220,17 @@ admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/> leave
222
220
admin@R1:/ >
223
221
```
224
222
225
-
226
- ### Checking connectivity
227
-
228
- Assuming the above configuration is done on R1 and R2 (with address
229
- 10.1.1.2), we can verify connectivity, by pinging the neighbor
230
- router.
231
-
232
- ``` console
233
- admin@R1:/ >
234
- admin@R1:/ > ping 10.1.1.2
235
- PING 10.1.1.2 (10.1.1.2) 56(84) bytes of data.
236
- 64 bytes from 10.1.1.2: icmp_seq=1 ttl=64 time=1.21 ms
237
- 64 bytes from 10.1.1.2: icmp_seq=2 ttl=64 time=1.54 ms
238
- ^C
239
- --- 10.1.1.2 ping statistics ---
240
- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms
241
- rtt min/avg/max/mdev = 1.205/1.374/1.544/0.169 ms
242
- admin@R1:/ >
243
- ```
244
-
245
- We can also view the IP routing table using the ` show routes ` command
246
-
247
- ``` console
248
- admin@R1:/ >
249
- admin@R1:/ > show routes
250
- PREFIX NEXT-HOP PREF PROTOCOL
251
- 10.1.1.2/32 10.1.1.2 20 ospf
252
- admin@R1:/ >
253
- ```
254
-
255
- OSPF status can be shown with commands such as ` show ospf neighbor ` ,
256
- ` show ospf interface ` , ` show ospf routes ` , etc.
223
+ When the above configuration is done on R1, and correspondingly on R2
224
+ with address 10.1.1.2 ([ Figure 2] ( #fig2 ) ), routing information will be
225
+ exchanged using OSPF.
257
226
258
227
``` console
259
- admin@R1:/ >
260
- admin@R1:/ > show ospf neighbor
261
-
262
- Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
263
- 10.1.1.2 1 Full/- 1m01s 38.568s 10.1.1.2 eth0:10.1.1.1 0 0 0
264
-
265
228
admin@R1:/ > show ospf routes
266
229
============ OSPF network routing table ============
267
230
N 10.1.1.1/32 [0] area: 0.0.0.0
268
- directly attached to lo
231
+ directly attached to lo
269
232
N 10.1.1.2/32 [10] area: 0.0.0.0
270
- via 10.1.1.2, eth0
233
+ via 10.1.1.2, eth0
271
234
272
235
============ OSPF router routing table =============
273
236
@@ -276,92 +239,6 @@ N 10.1.1.2/32 [10] area: 0.0.0.0
276
239
admin@R1:/ >
277
240
```
278
241
279
-
280
- ## Troubleshooting
281
-
282
- If OSPF fails to setup the routes, it is usually good to start
283
- checking from bottom up. Is cable connected, are Ethernet interfaces
284
- up, etc. To troubleshoot connectivity, it can be hard to use `IPv4
285
- ping` as we have not assigned any IPv4 address to ` eth0` other than
286
- the /32 address. Pinging the neighbor relies on OSPF to work when
287
- unnumbered interfaces are used.
288
-
289
- Instead we can use * tcpdump* to listen for LLDP packets.
290
-
291
- ``` console
292
- admin@R1:/ > tcpdump eth0
293
- tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
294
- 07:22:13.051412 LLDP, length 232: R2
295
- 07:22:31.856495 LLDP, length 232: R1
296
- 07:22:43.063845 LLDP, length 232: R2
297
-
298
- 3 packets captured
299
- 3 packets received by filter
300
- 0 packets dropped by kernel
301
- ^C
302
- admin@R1:/ >
303
- ```
304
-
305
- In this case, R1 could see both its outgoing LLDP message and R2's
306
- incoming LLDP. A good sign of connectivity, but we ought to have seen
307
- some OSPF signalling too.
308
-
309
- We can also use IPv6 ping to * all-hosts* address. Below R1 sends such
310
- a ping on interface eth0.
311
-
312
- ``` console
313
- admin@R1:/ > ping interface eth0 ff02::1
314
- ping: Warning: source address might be selected on device other than: eth0
315
- PING ff02::1(ff02::1) from :: eth0: 56 data bytes
316
- 64 bytes from fe80::eec:d1ff:fe04:0%eth0: icmp_seq=1 ttl=64 time=0.022 ms
317
- 64 bytes from fe80::e47:2dff:fe15:0%eth0: icmp_seq=1 ttl=64 time=1.34 ms
318
- 64 bytes from fe80::eec:d1ff:fe04:0%eth0: icmp_seq=2 ttl=64 time=0.057 ms
319
- 64 bytes from fe80::e47:2dff:fe15:0%eth0: icmp_seq=2 ttl=64 time=2.97 ms
320
- ^C
321
- --- ff02::1 ping statistics ---
322
- 2 packets transmitted, 2 received, +2 duplicates, 0% packet loss, time 1002ms
323
- rtt min/avg/max/mdev = 0.022/1.097/2.968/1.203 ms
324
- admin@R1:/ >
325
- ```
326
-
327
- By looking at sequence numbers, we see duplicate responses for each
328
- ping; one from R1 itself and one from R2. This is also a good sign of
329
- connectivity.
330
-
331
- If neighbor connectivity work but you are unable to ping to 10.1.1.2
332
- from R1, the following hints for troubleshooting is suggested.
333
-
334
- - Check the IP address status (` show interfaces ` ) and/or IP address
335
- and forwarding configuration (` show running-config ` , look for
336
- * interface eth0* and * interface lo* )
337
- - Check OSPF status, in particular ` show ospf neighbor ` and `show ospf
338
- interfaces` for hints.
339
- - Chec OSPF configuration, either by ` show running-config ` (look for
340
- * ietf-routing: routing * ) or by entering configuration mode as shown below.
341
-
342
- ```
343
- admin@R1:/> configure
344
- admin@R1:/config/> edit routing control-plane-protocol ospfv2 name default
345
- admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/> show
346
- ospf {
347
- areas {
348
- area 0.0.0.0 {
349
- interfaces {
350
- interface eth0 {
351
- interface-type point-to-point;
352
- enabled true;
353
- }
354
- interface lo {
355
- enabled true;
356
- }
357
- }
358
- }
359
- }
360
- }
361
- admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/>
362
- ```
363
-
364
-
365
242
## Larger setup
366
243
367
244
Expanding the simple setup, depicted in [ Figure 2] ( #fig2 ) , to the larger
@@ -376,18 +253,16 @@ config as eth0 got before).
376
253
First setting IPv4 address and enable forwarding
377
254
378
255
``` console
379
- admin@R1:/ >
380
256
admin@R1:/ > configure
381
257
admin@R1:/config/ > set interface eth1 ipv4 address 10.1.1.1 prefix-length 32
382
- admin@R1:/config/ > set interface eth1 ipv4 forwarding true
258
+ admin@R1:/config/ > set interface eth1 ipv4 forwarding
383
259
```
384
260
385
261
Then OSPF configuration
386
262
387
263
``` console
388
- admin@R1:/config/ >
389
264
admin@R1:/config/ > edit routing control-plane-protocol ospfv2 name default
390
- admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > set ospf area 0.0.0.0 interface eth1 enabled true
265
+ admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > set ospf area 0.0.0.0 interface eth1 enabled
391
266
admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > set ospf area 0.0.0.0 interface eth1 interface-type point-to-point
392
267
```
393
268
@@ -397,21 +272,21 @@ OSPF configuration can be inspected
397
272
admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > show
398
273
ospf {
399
274
areas {
400
- area 0.0.0.0 {
401
- interfaces {
402
- interface eth0 {
403
- interface-type point-to-point;
404
- enabled true;
405
- }
406
- interface eth1 {
407
- interface-type point-to-point;
408
- enabled true;
409
- }
410
- interface lo {
411
- enabled true;
412
- }
413
- }
414
- }
275
+ area 0.0.0.0 {
276
+ interfaces {
277
+ interface eth0 {
278
+ interface-type point-to-point;
279
+ enabled true;
280
+ }
281
+ interface eth1 {
282
+ interface-type point-to-point;
283
+ enabled true;
284
+ }
285
+ interface lo {
286
+ enabled true;
287
+ }
288
+ }
289
+ }
415
290
}
416
291
}
417
292
admin@R1:/config/routing/control-plane-protocol/ospfv2/name/default/ > leave
@@ -426,18 +301,18 @@ routers. Here is the result at R1.
426
301
admin@R1:/ > show ospf routes
427
302
============ OSPF network routing table ============
428
303
N 10.1.1.1/32 [0] area: 0.0.0.0
429
- directly attached to lo
304
+ directly attached to lo
430
305
N 10.1.1.2/32 [10] area: 0.0.0.0
431
- via 10.1.1.2, eth0
306
+ via 10.1.1.2, eth0
432
307
N 10.1.1.3/32 [10] area: 0.0.0.0
433
- via 10.1.1.3, eth1
308
+ via 10.1.1.3, eth1
434
309
N 10.1.1.4/32 [20] area: 0.0.0.0
435
- via 10.1.1.2, eth0
310
+ via 10.1.1.2, eth0
436
311
N 10.1.1.5/32 [20] area: 0.0.0.0
437
- via 10.1.1.3, eth1
312
+ via 10.1.1.3, eth1
438
313
N 10.1.1.6/32 [30] area: 0.0.0.0
439
- via 10.1.1.2, eth0
440
- via 10.1.1.3, eth1
314
+ via 10.1.1.2, eth0
315
+ via 10.1.1.3, eth1
441
316
442
317
============ OSPF router routing table =============
443
318
@@ -464,12 +339,11 @@ router is expected on this LAN, eth2 can be configured as a passive
464
339
OSPF interface.
465
340
466
341
``` console
467
- admin@R1:/ >
468
342
admin@R1:/ > configure
469
343
admin@R1:/config/ > set interface eth2 ipv4 address 10.0.1.1 prefix-length 24
470
- admin@R1:/config/ > set interface eth2 ipv4 forwarding true
471
- admin@R1:/config/ > set routing control-plane-protocol ospfv2 name default ospf area 0.0.0.0 interface eth2 enabled true
472
- admin@R1:/config/ > set routing control-plane-protocol ospfv2 name default ospf area 0.0.0.0 interface eth2 passive true
344
+ admin@R1:/config/ > set interface eth2 ipv4 forwarding
345
+ admin@R1:/config/ > set routing control-plane-protocol ospfv2 name default ospf area 0.0.0.0 interface eth2 enabled
346
+ admin@R1:/config/ > set routing control-plane-protocol ospfv2 name default ospf area 0.0.0.0 interface eth2 passive
473
347
admin@R1:/config/ > leave
474
348
admin@R1:/ >
475
349
```
@@ -481,23 +355,23 @@ following routing table
481
355
admin@R1:/ > show ospf routes
482
356
============ OSPF network routing table ============
483
357
N 10.0.1.0/24 [10] area: 0.0.0.0
484
- directly attached to eth2
358
+ directly attached to eth2
485
359
N 10.0.6.0/24 [40] area: 0.0.0.0
486
- via 10.1.1.2, eth0
487
- via 10.1.1.3, eth1
360
+ via 10.1.1.2, eth0
361
+ via 10.1.1.3, eth1
488
362
N 10.1.1.1/32 [0] area: 0.0.0.0
489
- directly attached to lo
363
+ directly attached to lo
490
364
N 10.1.1.2/32 [10] area: 0.0.0.0
491
- via 10.1.1.2, eth0
365
+ via 10.1.1.2, eth0
492
366
N 10.1.1.3/32 [10] area: 0.0.0.0
493
- via 10.1.1.3, eth1
367
+ via 10.1.1.3, eth1
494
368
N 10.1.1.4/32 [20] area: 0.0.0.0
495
- via 10.1.1.2, eth0
369
+ via 10.1.1.2, eth0
496
370
N 10.1.1.5/32 [20] area: 0.0.0.0
497
- via 10.1.1.3, eth1
371
+ via 10.1.1.3, eth1
498
372
N 10.1.1.6/32 [30] area: 0.0.0.0
499
- via 10.1.1.2, eth0
500
- via 10.1.1.3, eth1
373
+ via 10.1.1.2, eth0
374
+ via 10.1.1.3, eth1
501
375
502
376
============ OSPF router routing table =============
503
377
@@ -507,7 +381,8 @@ N 10.1.1.6/32 [30] area: 0.0.0.0
507
381
admin@R1:/ >
508
382
```
509
383
510
- Verify be letting PC1 ping PC2
384
+ Verify by letting PC1 ping PC2, where attached to R1 and R4
385
+ respectivly, see [ Figure 3] ( #fig3 ) .
511
386
512
387
``` console
513
388
PC1> ping 10.0.6.26
0 commit comments