File: mrtd.8

package info (click to toggle)
mrt 2.2.2a-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,140 kB
  • ctags: 4,853
  • sloc: ansic: 56,465; sh: 2,801; perl: 1,065; makefile: 321
file content (596 lines) | stat: -rw-r--r-- 16,265 bytes parent folder | download | duplicates (2)
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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
.TH MRTD 8 "October 2002" "Debian/GNU Linux"
.SH NAME
mrtd \- multi-threaded routing daemon
.SH DESCRIPTION
Usage: mrtd [-f config_file] [-p uii_port ] [-v] [-n]

3. MRTd

   MRTd is a multi-threaded routing daemon with support for BGP4, RIP1/2,
   RIPng, and BGP4+ (for IPv6) and multiple RIBs (i.e. route server).
   MRTd reads Cisco Systems-like router configuration files and includes
   a Cisco Systems router-like interactive telnet interface.

   At the moment, BGP, RIPng, and BGP4+ are completely supported. RIP1/2
   and its interaction with other protocols are not supported.
   Development of OSPF and PIM-DM is currently underway.

  Synopsis

    mrtd [-v] [-n] [-f configuration file] [-l rib file] [-r] [-m]

  Options

   -f configuration_file
          Read the specified configuration file. By default, MRT tries to
          read /etc/mrtd.conf.

   -v
          Turn on verbose logging to standard output. This is useful to
          turn on logging before the debug commands are read in the
          configuration file.

   -n
          Specify that MRT will not modify the kernel routing table.
          (This option is used to test MRT configurations with actual
          routing data.)

   -r
          Don't install routes in the RIB.

   -l routing database
          Load routes from a routing table dump and use these prefixes in
          the simulation. The routing database file must be in MRT
          message format. The programs included in the route_atob
          directory will convert GateD, RSd and Cisco Systems routing
          table dumps to MRT RIB format.

   -m
          Use a new dump format.


  Description

   MRT first reads its configuration file (by default /etc/mrtd.conf) to
   configure routing protocols, route peerings, and routing policy. The
   configuration file closely resembles those used by Cisco Systems
   routers.

   After reading the configuration file, MRT scans the kernel for
   existing routes, scans the kernel interface list, and then initiates
   routing protocol communications. MRT also begins listening on the mrt
   service port, "mrtd," (specified in /etc/services) for user telnet
   connections.



  Sample Configuration Files

   A sample IPv4 MRT configuration file is shown below:

   Line vty
       password
       my_password login
!
debug norm stdout
!
access-list 1 deny 0.0.0.0/0
access-list 1 permit all
access-list 2 permit 192.168.0.0/16
!
router bgp 185
neighbor 192.168.10.2 remote-as 65
neighbor 192.168.10.2 distribute-list 1 in
neighbor 192.168.10.2 distribute-list 2 out
neighbor 198.108.60.244 remote-as 185
redistribute static
redistribute rip
!
router rip
network 192.168.10.0/24
network 198.108.60.0/24
redistribute static
redistribute bgp
!
ip route 192.168.100.0/24 192.168.10.100
ip route 192.168.150.0/23 192.168.10.100
ip route 192.168.190.1/24 192.168.10.100
ip route 10.0.0.0/8 192.168.10.100

   Following is a sample IPv6 configuration file:

   Line vty
       password my_passwordhttp://pythia.uoregon.edu/~llynch/nanog16.html
       port 5674 login
       !
       dump bgp view 1 /susr/masaki/tmp/ipv6/bgp.routes.%y%m%d.%H:%M 60m
       dump bgp updates /susr/masaki/tmp/ipv6/bgp.updates.%y%m%d.%H:%M
       15m
       debug all /tmp/MRTd.log 1000000
       redirect /tmp
       !
       access-list 1 deny 3ffe:1c00::/24 refine !merit internal
       access-list 1 permit all
       !
       access-list 99 deny all
       !
       as-path access-list 1 permit ^1673 ! just an example, it's always
       true
       !
       router bgp 237 ! define own AS number
       aggregate-address 3ffe:1c00::/24 summary-only as-set
       neighbor 3ffe:0dfe:fffe::9 remote-as 1673 ! eBGP
       neighbor 3ffe:0dfe:fffe::9 description ANS
       neighbor 3ffe:0dfe:fffe::9 distribute-list 1 out ! drop specific
       neighbor 3ffe:0dfe:fffe::9 filter-list 1 in ! as path filter
       neighbor 3ffe:1c00::3 remote-as 237 ! iBGP
       neighbor 3ffe:1c00::3 description CC
       neighbor 3ffe:1c00::3 bgp4+ 1 ! use RFC version of BGP4 MP
       neighbor 3ffe:1c00:0:60::112 remote-as 112 ! for test
       neighbor 3ffe:1c00:0:60::112 remote-as 112 description MRT
       neighbor 3ffe:1c00:0:60::112 distribute-list 99 in ! drop
       everything
       neighbor 3ffe:1c00:0:60::112 bgp4+ 1 ! ! use RFC version of BGP4
       MP
       redistribute static ! inject static routes
       redistribute direct ! inject connected routes
       !
       router ripng
       network 3ffe:1c00:0:60::/64
       network 3ffe:1c00:0:12::/64
       network cti1
       network cti2
       redistribute static
       redistribute direct
       redistribute bgp
       distribute-list 99 in cti2
       distribute-list 99 out cti2
       !
       ip route 0.0.0.0/0 198.108.60.1 ! default route
       ip route 3ffe:1c00::/24 ::1 ! merit pTLA

  Configuration Guide

   This section introduces the command sets for:
     * Configuring MRTd and BGPsim
     * Using MRT's interactive interface to monitor the status of MRTd
       and BGPsim.

   For information about the uii, debug, and access-list configuration
   commands, see Chapter 2, "Getting Started."

    Configuration Commands

   As mentioned in Chapter 2, all of the below options may be configured
   directly through the UII telnet interface. Administrators may also
   choose to edit the configuration file directly on disk. In this case,
   MRTd must be rebooted before the changes will take affect.

      Configuring Routes and Policy

   MRTd supports most of the common Cisco Systems routing policy
   commands, including access lists, as-path access lists and route maps.


   route--
   defines a static route

   route []

   Establishes a static route to a destination via . may be an IPv4 or
       IPv6 address and must be consistent with . To use a specific
       interface, specify .

   as-path access-list
   --defines an as-path access-list

   as-path access-list <number> {permit|deny} <as-regular-expression>

   Defines an as-path access-list <number>, which permits or denies
       access if <as-regular-expression> is matched.
       Matches are performed in the order in which they appear. At the
       end of a list with the same number, deny .* is assumed.
       The as regular expressions are as follows:
       <number> an as number (1 through 65535)
       . Matches any single as number
       * Matches 0 or more sequences of the pattern
       + Matches 1 or more sequences of the pattern
       ? Matches 0 or 1 occurrences of the pattern
       ^ Matches the beginning of the as path
       $ Matches the end of the as path
       | Matches one of the alternatives
       () Encloses a pattern
       For example:
       .* any AS path, including null
       237$ originated from AS 237
       237 via AS 237
       ^(237|10) from AS 237 or AS 10
       ^$ originated from this AS

   network <prefix>

   Configure routes originating in BGP.

   route-map--
   define a route-map

   route-map

   Defines the conditions to modify attributes of any updates.

   route-map
   sub commands

   set as-path [prepend]

   Sets or prepends to the as-path of the route. Note that there is no
       matching function implemented.
 ... ...    a sequence of AS numbers

        [ ... ]  a set of AS numbers


   set community [additive] (|no-export|no-advertise)

   Sets community attribute to the route, or appends if additive is
       specified.
       values are 1 to 4294967200.

   set origin (igp|egp |incomplete)

   Sets the origin code.

   set next-hop <address>

   Sets the nexthop attribute. If the address is an IPv6 global address,
       it is set as BGP4+ next hop. In addition, If the address is an
       IPv6 link-local address, it is set as BGP4+ next hop link local
       address.

   set metric

   Sets the metric value (MED).

   set local-preference

   Sets the local preference value.

   set dpa as

   Sets the DPA values.

   set atomic-aggregate

   Sets automatic aggregate attribute.

   set aggregator as
   <address>

       Sets aggregator information. <address> should be IPv4.

      Configuring Routing Protocols

   MRTd supports BGP4, BGP4+, RIP2, and RIPng. This version includes
   partial support for OSPF, and a PIM-DM implementation is underway.

   router--configures routing protocol

   router bgp
   <as number>

       Enables assignment of the BGP (or BGP4+ if IPv6 is available)
       routing protocol to the routing process.

   router ripng

       Enables RIPng routing protocol.

   router rip

       Enables RIP routing protocol.

   The following commands are available for the router bgp command.

   neighbor remote-as
   <peer's as number>

       Adds an entry of BGP neighbor with .
       <peer's as number> should be an AS number to which the peer
       belongs.
       Must precede other neighbor commands for .

   neighbor update-source

   Specifies the addresses for outgoing BGP connections and at which
       incoming BGP connections are accepted.

   neighbor next-hop-self

   Forces the next hop in the AS path to be the host itself.

   neighbor
   <peer address> (transparent-as|transparent-nexthop)

       Set transparent option for neighbor, as in use as a route server.

   neighbor
   <peer address> passive

       Does not initiate BGP connections--only accepts them.

   neighbor maximum-prefix

   Sets the maximum number of prefixes incuded in a BGP update.

   neighbor distribute-list {in|out}

   Applies access-list to incoming (in) or outgoing (out) route updates
       for a peer with .

   neighbor
   <peer address> filter-list <number> {in|out}

       Applies as-path access-list <number> to incoming (in) or outgoing
       (out) route updates for a peer with <peer address>.

   neighbor <
   peer address> weight <num>

       Set a weight associated with a peer.

   neighbor
   <peer address> trace

       Enable tracing of a BGP peer.

   neighbor route-map {in|out}

   Applies a route-map to incoming (in) or outgoing (out) route updates
       for a peer with .

   neighbor route-reflector-client

   Sends routes to an internal peer even if learned from another internal
       peer (route reflection.)

   neighbor description
   <string>

       Attaches <string> to the neighbor as a description.

   neighbor (holdtime|keepalive|connectretry|starttime) <num>

   Set the timer for a neighbor.

   neighbor
   <name> neighbor-list <num>

       Allows anonymous neighbor peers.

   neighbor bgp4+ (0|1|old|new|rfc|auto)

   Specifies BGP4+ packet format. The default is 0.

   redistribute

   Redistributes routes from such as rip to BGP.

   aggregate-address [summary-only] [as-set]

   Creates an aggregate entry to . summary-only suppresses all more
       specific routes from updates. as-set merges as paths to generate
       as-set path attribute.

   bgp router <id>

   Defines the router ID used in BGP. The router ID should be an IPv4
       address assigned to the host. The default is one of the addresses
       available on the host; which is picked up by MRT automatically.

   bgp cluster-id <id>

   Defines the cluster ID used in the BGP reflector. The default is the
       same as the router ID.

   router rip/ripng
   --RIP/RIPng routing

   The following commands are available for the router RIP/RIPng command.

   network {|}

   Specifies interface(s) by or by name. to turn on RIP/RIPng. All
       interfaces included under will be enabled.

   distribute-list {in|out}

   Applies access-list to incoming (in) or outgoing (out) route updates
       on .

   redistribute

   Redistributes routes from to RIP/RIPng.

      Statistics Collection

   MRTd can log both routing table dumps and binary traces of all BGP
   events in a format parseable by other MRT (and soon Zebra) tools. So,
   for example, BGP updates can be recorded via MRTd and later replayed
   to test peers through bgpsim or sbgp. The MRT Programmer's Manual
   includes a description of the MRT packet formats.

   dump bgp--
   dump BGP updates, state changes, and routes

   dump-binary [{ip|ipv6}] bgp routes []

   Dump BGP routing table in binary MRT format. can be in strftime()
       format. If is specified, the file will be reopened every ,
       re-evaluating the filename. If ip or ipv6 is specified, only the
       routes of the address will be dumped.

   dump [{ip|ipv6}] bgp {routes|updates|all} []

   Dumps BGP/BGP4+ routes, updates, or all into the file .
       can be in strftime() format. If is specified, the file will be
       reopened every , re-evaluating the filename. If ip or ipv6 is
       specified, only the routes of the address will be dumped.

   dump bgp view <view number> []

   Dump routing table for specified view.


  Interactive Interface Commands

   MRTd and BGPsim provide an interactive user interface for management
   (e.g., viewing the routing table) and configuration.

   The following commands are specific to MRTd and BGPSim. Additional
   commands are described in Chapter 2, "Getting Started."

    clear bgp * <name> - Close/reset BGP peering session with this peer *

    config * - Enter configuration mode

    quit - Exit mode, or exit UII interface

    show - show system information

   show [{ip|ipv6}] bgp

   show [{ip|ipv6}] bgp summary

   Show BGP peers summary

   show [{ip|ipv6}] bgp neighbors

   Show BGP peers and their status

   show bgp neighbors
   (<peer address>|<name>|*) errors

       Show recent BGP errors/notifications with this peer.

   show bgp neighbors
   (<peer address>|<name>|*) routes

       Show BGP routes sent to this peer

   show [{ip|ipv6}] bgp routes

   Show BGP routing table

   show [{ip|ipv6}] bgp regexp
   <as-regular expression>

       Show BGP routes matching the as-path regular expression.

   show [{ip|ipv6}] bgp prefix
   <prefix>

       Show BGP routes matching this prefix.

   show config

   Show the current configuration

   show interfaces

   Show all interfaces available

   show ip

   Show IPv4 routing table

   show ipv6

   Show IPv6 routing table

   show rib

   Show the central routing table

   show rip

   Show RIP status

   show rip routes

   Show RIP routing table

   show ripng

   Show RIPng status

   show ripng routes

   Show RIPng routing table

   show view
   <view number>

   Show the BGP routing table for this view.

    dump & load - dump and load bgp binary routing table dump to/from disk

   dump [{ip|ipv6}] bgp routes <filename>

   Dumps bgp routes into the file <filename>.

   load [{ip|ipv6}] bgp routes <filename>

   Loads bgp routes from the file <filename>. Note that this will
       introduce inconsistency into the routing table.

    trace - log protocol information to disk or UII

   trace [{ip|ipv6}] bgp
   *

       Enable tracing of BGP protocol.

   trace bgp neighbor
   (<peer address>|<peer name>) *

       Enable tracing on the peer. (The "terminal monitor" command is
       required to watch this at the UII.)

   trace bgp view (*|inet|inet6|<num>)
   *

       Enable tracing of view routing table changes.

    quit--quit the mode or disconnect

       *
       Note that if you set `enable password' in your configuration, the
       enable command is required in order to execute some potentially
       dangerous commands, such as clear bgp, config, and trace bgp
       (marked with an asterisk* above.)



   Following are examples of the interactive interface commands:
       [21] MRTd> show ip
       4 prefixes
       P Pref Time Destination Next Hop If
       *S 1 74:42:37 0.0.0.0/0 198.108.60.1 ep0
       *C 0 74:42:37 127.0.0.0/8 0.0.0.0 lo0
       *C 0 74:42:37 192.168.12.0/24 0.0.0.0 lo0
       *C 0 74:42:37 198.108.60.0/24 0.0.0.0 lo0
       [17] MRTd> show ripng

       Routing Protocol is "ripng" (Using IPV6)
       Listening on port 521 (socket 10)
       Sending updates every 30 seconds +/- 15, next due in 29 seconds
       Triggered update and split horizon (no poisoned reverse)
       implemented
       Invalid after 180 seconds, hold down 180, flushed after 120

       106 ripng routes and 107 ripng attributes active
       106 hash entries



You can find more documentation in /usr/share/doc/mrt/html/