Dear Colleagues, Is there a way to export (extract) routes from BIRD as a list of prefixes in text format, to a text file or pipe? I can perhaps write an expect script to communicate with birdc, but such kind of screenscraping is always the last resort. Or should I communicate through the /var/run/bird.ctl socket? What's the set of commands I can send to the socket to extract some routes with a filter? I can do: $ echo help | nc -U /var/run/bird.ctl 0001 BIRD 1.5.0 ready. 9001 syntax error Thank in advance for any input. Maybe there are sample scripts? -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN sip:sudakov@sibptus.tomsk.ru
Is there a way to export (extract) routes from BIRD as a list of prefixes in text format, to a text file or pipe?
Hi Victor, You can run bird tool with the -x option to list accepted routes, one per line. This can be combined with other options such as -a to limit to a specific peer. Download and more info from here: https://github.com/dowlingw/bird-tool <https://github.com/dowlingw/bird-tool> Hope this helps. - Will
On Wed, Feb 17, 2016 at 09:29:14AM +0600, Victor Sudakov wrote:
Dear Colleagues,
Is there a way to export (extract) routes from BIRD as a list of prefixes in text format, to a text file or pipe?
Hi IMHO the simplest way is just: birdc show route > file You just have to cut out the first line (greeting). -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Ondrej Zajicek wrote:
Is there a way to export (extract) routes from BIRD as a list of prefixes in text format, to a text file or pipe?
IMHO the simplest way is just:
birdc show route > file
Indeed. Thank you, Ondrej. I have outwitted myself with all that "nc -w1 -U /var/run/bird.ctl" stuff. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN sip:sudakov@sibptus.tomsk.ru
participants (3)
-
Ondrej Zajicek -
Victor Sudakov -
Will Dowling