github.com/osrg/gobgp/v3@v3.30.0/docs/sources/mrt.md (about) 1 # MRT 2 3 This page explains how to play with GoBGP's MRT feature. 4 5 ## Prerequisites 6 7 Assume you finished [Getting Started](getting-started.md). 8 9 ## Contents 10 11 - [Inject routes from MRT table v2 records](#inject-routes-from-mrt-table-v2-records) 12 - [Dump updates in MRT BGP4MP format](#dump-updates-in-mrt-bgp4mp-format) 13 - [Dump the RIB in MRT TABLE_DUMPv2 format](#dump-the-rib-in-mrt-table_dumpv2-format) 14 15 ## Inject routes from MRT table v2 records 16 17 Route injection can be done by 18 19 ```bash 20 $ gobgp mrt inject global <dumpfile> [<number of prefix to inject>] 21 ``` 22 23 ## Dump updates in MRT BGP4MP format 24 25 ### Configuration 26 27 With the following configuration, gobgpd continuously dumps BGP update 28 messages to `/tmp/updates.dump` file in the BGP4MP format. 29 30 ```toml 31 [[mrt-dump]] 32 [mrt-dump.config] 33 dump-type = "updates" 34 file-name = "/tmp/updates.dump" 35 ``` 36 37 Also gobgpd supports log rotation; a new dump file is created 38 periodically, and the old file is renamed to a different name. With 39 the following configuration, gobgpd creates a new dump file every 180 40 seconds such as `/tmp/20160510.1546.dump`. The format of a name can be 41 specified in golang's 42 [time](https://golang.org/pkg/time/#pkg-constants) package's format. 43 44 ```toml 45 [[mrt-dump]] 46 [mrt-dump.config] 47 dump-type = "updates" 48 file-name = "/tmp/log/20060102.1504.dump" 49 rotation-interval = 180 50 ``` 51 52 ## Dump the RIB in MRT TABLE_DUMPv2 format 53 54 ### Configuration 55 56 With the following configuration, gobgpd continuously dumps routes in 57 the global rib to `/tmp/table.dump` file in the TABLE_DUMPv2 format 58 every 60 seconds. 59 60 ```toml 61 [[mrt-dump]] 62 [mrt-dump.config] 63 dump-type = "table" 64 file-name = "/tmp/table.dump" 65 dump-interval = 60 66 ``` 67 68 With a route server configuration, gobgpd can dump routes in each 69 peer's RIB. 70 71 ```toml 72 [[neighbors]] 73 [neighbors.config] 74 neighbor-address = "10.0.255.1" 75 # ...(snip)... 76 [neighbors.route-server.config] 77 route-server-client = true 78 79 [[neighbors]] 80 [neighbors.config] 81 neighbor-address = "10.0.255.2" 82 # ...(snip)... 83 [neighbors.route-server.config] 84 route-server-client = true 85 86 [[mrt-dump]] 87 [mrt-dump.config] 88 dump-type = "table" 89 file-name = "/tmp/table-1.dump" 90 table-name = "10.0.255.1" 91 dump-interval = 60 92 93 [[mrt-dump]] 94 [mrt-dump.config] 95 dump-type = "table" 96 file-name = "/tmp/table-2.dump" 97 table-name = "10.0.255.2" 98 dump-interval = 60 99 ```