English version


BGPQ - программа для построения access и prefix-list'ов (для оборудования Cisco и фильтров для GateD'а. Программа не призвана служить заменой RaToolSet'у, в связи с ее гораздо большей тупизной :)
Compatibility: писано под FreeBSD, проверенно и надежно работает под OpenBSD работает под Linux, собирается, но не работает под Solaris.
Availablilty: доступно с ftp://ftp.lexa.ru/pub/domestic/snar
Документация: при запуске без параметров пишет о себе:
Usage: bgpq [-l name] [-h host] [-p port] [-d] [-Piosge]|[-f number]|[-F format] [-aq] [-S src] [-H] [-c] [-R masklen] objects [EXCEPT objects]
	bgpq -r filename
	-A - try to aggregate routes
	-a - print all routes uncommented
	-c - include commandline in output
	-d - debugging
	-e - generate standard access-list
	-f - generate as-path access-list (number used as starting)
	-F - generate output in given format
	-g - generate GateD network filter
	-H - do not print headers
	-h - host with irrd (can be set with IRRD_HOST also)
	-i - generate input packet filter
	-l - name of generated access/prefixlist
	-o - generate output packet filter
	-P - generate prefixlist (access-list extended by default)
	-p - irrd port (43 by default)
	-q - print only aggreagated routes
	-R - allow more specific routes up to masklen
	-r - recreate file
	-s - print statistics about
	-S - use only specified source (can be set with IRRD_SOURCE)

"objects" means for networks (in prefix aka a.a.a.a/b format,
autonomous systems (in ASnnn format), as-macros (AS-xxxx format)
or rpsl filter (see RFC2622 or bgpq manpage for definition)
что, по моему скромному мению, понятно без дополнительных комментариев :) Кроме того, в дистрибуте есть man-page, написанный на плохом английском.

Примеры

Простейшая генерация access-list'а:
snar@kaya:~/compile/bgpq>./bgpq -h sivka AS3319
!generated with bgpq
no ip access-list extended UNKNOWN
ip access-list extended UNKNOWN
 permit ip host 194.44.31.0 host 255.255.255.0
 permit ip host 194.44.158.0 host 255.255.255.0
 permit ip host 194.44.162.0 host 255.255.255.0
 permit ip host 194.44.164.0 host 255.255.255.0
 permit ip host 194.44.170.0 host 255.255.255.0
 permit ip host 194.44.192.0 host 255.255.255.0
 permit ip host 194.44.193.0 host 255.255.255.0
 permit ip host 194.44.194.0 host 255.255.255.0
 permit ip host 194.44.195.0 host 255.255.255.0
 permit ip host 194.44.196.0 host 255.255.255.0
 permit ip host 194.44.197.0 host 255.255.255.0
 permit ip host 194.44.216.0 host 255.255.255.0
 permit ip host 195.178.128.0 host 255.255.224.0
! overlayed by 195.178.128.0/19 in the same AS3319
! -  permit ip host 195.178.136.0 host 255.255.254.0
! overlayed by 195.178.128.0/19 in the same AS3319
! -  permit ip host 195.178.150.0 host 255.255.255.0
! overlayed by 195.178.128.0/19 in the same AS3319
! -  permit ip host 195.178.128.0 host 255.255.255.0
! overlayed by 195.178.128.0/19 in the same AS3319
! -  permit ip host 195.178.130.0 host 255.255.254.0
! overlayed by 195.178.128.0/19 in the same AS3319
! -  permit ip host 195.178.132.0 host 255.255.255.0
 deny ip any any
Попытка сделать access-list гораздо более компактным: - включаем аггрегацию и quiet-mode:
snar@kaya:~/compile/bgpq>./bgpq -h sivka -Aq AS3319
!generated with bgpq
no ip access-list extended UNKNOWN
ip access-list extended UNKNOWN
 permit ip host 194.44.31.0 host 255.255.255.0
 permit ip host 194.44.158.0 host 255.255.255.0
 permit ip host 194.44.162.0 host 255.255.255.0
 permit ip host 194.44.164.0 host 255.255.255.0
 permit ip host 194.44.170.0 host 255.255.255.0
 permit ip 194.44.192.0 0.0.3.0 host 255.255.255.0 
 permit ip 194.44.196.0 0.0.1.0 host 255.255.255.0 
 permit ip host 194.44.216.0 host 255.255.255.0
 permit ip host 195.178.128.0 host 255.255.224.0
 deny ip any any

Author: Alexandre Snarskii, <snar@paranoia.ru>