1
0
mirror of https://github.com/bgp/bgpq4.git synced 2024-05-11 05:55:05 +00:00

update CHANGES, README, .spec...

This commit is contained in:
Alexandre Snarskii
2015-06-23 15:30:57 +03:00
parent 9eb665209b
commit c32b569437
6 changed files with 191 additions and 189 deletions

View File

@ -1,3 +1,10 @@
0.1.31 (2015-06-23)
- pipelining mode now counts buffered requests and issues dequeue
when new request can overflow allocated buffer. So, bgpq3 shall no
more require TCP tuning (it is still recomended, though).
- tcp tuning parameters decreased in README (sx_maxsockbuf will not
allow to grow buffer over 2Mb anyway).
0.1.30 (2015-06-16)
- bugfix: private asns with number > 2^31 were printed as negative integers.
Thanks to Henrik Thostrup Jensen.

View File

@ -250,19 +250,20 @@ program exits with non-zero status.
NOTES ON ULTRA-LARGE PREFIX-LISTS
---------------------------------
When using `bgpq3` to expand extra-large AS-SETs, `bgpq3` may stuck
due to lacking tcp buffer size. To avoid this, tune your OS.
To improve `bgpq3` performance when expanding extra-large AS-SETs you
shall tune OS settings to enlarge TCP send buffer.
FreeBSD can be tuned in the following way:
sysctl -w net.inet.tcp.sendbuf_max=16777216
sysctl -w net.inet.tcp.sendbuf_max=2097152
Linux can be tuned in the following way:
sysctl -w net.ipv4.tcp_window_scaling=1
sysctl -w net.core.rmem_max=33554432
sysctl -w net.core.wmem_max=33554432
sysctl -w net.ipv4.tcp_rmem="4096 87380 33554432"
sysctl -w net.ipv4.tcp_wmem="4096 65536 33554432"
sysctl -w net.core.rmem_max=2097152
sysctl -w net.core.wmem_max=2097152
sysctl -w net.ipv4.tcp_rmem="4096 87380 2097152"
sysctl -w net.ipv4.tcp_wmem="4096 65536 2097152"
Please note that generated prefix-lists may not fit your router's
limitations. For example, JunOS supports only 85,325 prefixes in

View File

@ -1,5 +1,5 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd">
<p><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> <br />
<html><head><style type='text/css'>
h1 { color: #3c78b5; border-bottom: 3px solid #3c78b5; font-size: 180%; }
h2 { color: #3c78b5; border-bottom: 2px solid #3c78b5; font-size: 140%; }
@ -9,175 +9,136 @@ code { font-size:12px; background-color:#f8f8ff; border:1px; }
pre { border: 1px dotted #3c78b5; background-color: #f8f8ff; margin: 1em 1em;}
body { width: 80%; margin: 0 3em; }
ul { list-style: none; }
</style></head><body>
</style></head><body> </p>
<h2>NAME</h2>
<p><code>bgpq3</code> - bgp filtering automation for Cisco and Juniper routers</p>
<h2>SYNOPSIS</h2>
<pre><code>bgpq3 [-h host] [-S sources] [-EP] [-f asn | -G asn] [-346AbDdJjX] [-r len] [-R len] [-m max] OBJECTS [...]
</code></pre>
<p><code>
bgpq3 [-h host] [-S sources] [-EP] [-f asn | -G asn] [-2346AbDdJjpX] [-r len] [-R len] [-m max] [-W len] OBJECTS [...]
</code></p>
<h2>DESCRIPTION</h2>
<p>The bgpq3 utility used to generate Cisco and Juniper prefix-lists,
extended access-lists, policy-statement terms and as-path lists based on
RADB data.</p>
<p>The options are as follows:</p>
<ul>
<li>
<p>-3 <br />
</p>
<blockquote>
<p>assume that your device is asn32-capable.</p>
</blockquote>
</li>
<li>
<p>-4 </p>
<blockquote>
<p>generate IPv4 prefix/access-lists (default).</p>
</blockquote>
</li>
<li>
<p>-6 <br />
</p>
<blockquote>
<p>generate IPv6 prefix/access-lists (IPv4 by default).</p>
</blockquote>
</li>
<li>
<p>-A <br />
</p>
<blockquote>
<p>try to aggregate generated filters as much as possible (not all
output formats supported).</p>
</blockquote>
</li>
<li>
<p>-b</p>
<blockquote>
<p>generate output in BIRD format (default: Cisco).</p>
</blockquote>
</li>
<li>
<p>-d <br />
</p>
<blockquote>
<p>enable some debugging output.</p>
</blockquote>
</li>
<li>
<p>-D <br />
</p>
<blockquote>
<p>use asdot notation for Cisco as-path access-lists.</p>
</blockquote>
</li>
<li>
<p>-E <br />
</p>
<blockquote>
<p>generate extended access-list (Cisco) or policy-statement term using
<h4>-3</h4>
<p>Assume that your device is asn32-capable.</p>
<h4>-4</h4>
<p>Generate IPv4 prefix/access-lists (default).</p>
<h4>-6</h4>
<p>Generate IPv6 prefix/access-lists (IPv4 by default).</p>
<h4>-A</h4>
<p>Try to aggregate generated filters as much as possible (not all output formats
supported).</p>
<h4>-b</h4>
<p>Generate output in BIRD format (default: Cisco).</p>
<h4>-d</h4>
<p>Enable some debugging output.</p>
<h4>-D</h4>
<p>Use asdot notation for Cisco as-path access-lists.</p>
<h4>-E</h4>
<p>Generate extended access-list (Cisco) or policy-statement term using
route-filters (Juniper).</p>
</blockquote>
</li>
<li>
<p>-f number</p>
<blockquote>
<p>generate input as-path access-list.</p>
</blockquote>
</li>
<li>
<p>-G number</p>
<blockquote>
<p>generate output as-path access-list.</p>
</blockquote>
</li>
<li>
<p>-h host</p>
<blockquote>
<p>host running IRRD database (default: whois.radb.net).</p>
</blockquote>
</li>
<li>
<p>-J <br />
</p>
<blockquote>
<p>generate config for Juniper (default: Cisco).</p>
</blockquote>
</li>
<li>
<p>-j <br />
</p>
<blockquote>
<p>generate output in JSON format (default: Cisco).</p>
</blockquote>
</li>
<li>
<p>-m len<br />
</p>
<blockquote>
<p>maximum length of accepted prefixes (default: 32 for IPv4, 128 for IPv6).</p>
</blockquote>
</li>
<li>
<p>-M match </p>
<blockquote>
<p>extra match conditions for Juniper route-filters.</p>
</blockquote>
</li>
<li>
<p>-l name </p>
<blockquote>
<p>name of generated entry.</p>
</blockquote>
</li>
<li>
<p>-P <br />
</p>
<blockquote>
<p>generate prefix-list (default behaviour, flag added for backward
compatibility only).</p>
</blockquote>
</li>
<li>
<p>-r len </p>
<blockquote>
<p>allow more-specific routes with masklen starting with specified
length.</p>
</blockquote>
</li>
<li>
<p>-R len<br />
</p>
<blockquote>
<p>allow more-specific routes up to specified masklen too.
(Please, note: objects with prefix-length greater than specified length
will be always allowed.)</p>
</blockquote>
</li>
<li>
<p>-S sources </p>
<blockquote>
<p>use specified sources only (default: RADB,RIPE,APNIC).</p>
</blockquote>
</li>
<li>
<p>-T <br />
</p>
<blockquote>
<p>disable pipelining.</p>
</blockquote>
</li>
<li>
<p>-X <br />
</p>
<blockquote>
<p>generate config for Cisco IOS XR devices (plain IOS by default).</p>
</blockquote>
</li>
</ul>
<p><code>OBJECTS</code> means networks (in prefix format), autonomous systems, as-sets
and route-sets. </p>
<h4>-f <code>AS number</code></h4>
<p>Generate input as-path access-list for adjacent as <code>AS number</code>.</p>
<h4>-G <code>number</code></h4>
<p>Generate output as-path access-list.</p>
<h4>-h <code>host</code></h4>
<p>Host running IRRD database (default: <code>whois.radb.net</code>).</p>
<h4>-J</h4>
<p>Generate config for Juniper (default: Cisco).</p>
<h4>-j</h4>
<p>Generate output in JSON format (default: Cisco).</p>
<h4>-m <code>length</code></h4>
<p>Maximum length of accepted prefixes (default: <code>32</code> for IPv4, <code>128</code> for IPv6).</p>
<h4>-M <code>match</code></h4>
<p>Extra match conditions for Juniper route-filters. See the examples section.</p>
<h4>-l <code>name</code></h4>
<p><code>Name</code> of generated configuration stanza.</p>
<h4>-p</h4>
<p>Enable use of private ASNs and ASNs used for documentation purpose only
(default: disabled).</p>
<h4>-P</h4>
<p>Generate prefix-list (default behaviour, flag added for backward compatibility
only).</p>
<h4>-r <code>length</code></h4>
<p>Allow more-specific routes with masklen starting with specified length.</p>
<h4>-R <code>length</code></h4>
<p>Allow more-specific routes up to specified masklen too. (Please, note: objects
with prefix-length greater than specified length will be always allowed.)</p>
<h4>-S <code>sources</code></h4>
<p>Use specified sources only (default: RADB,RIPE,APNIC).</p>
<h4>-T</h4>
<p>Disable pipelining. (not recommended)</p>
<h4>-W <code>length</code></h4>
<p>Generate as-path strings of a given length maximum (0 for infinity).</p>
<h4>-X</h4>
<p>Generate config for Cisco IOS XR devices (plain IOS by default).</p>
<h4><code>OBJECTS</code></h4>
<p><code>OBJECTS</code> means networks (in prefix format), autonomous systems, as-sets and
route-sets. If multiple objects are specified they will be merged.</p>
<h2>EXAMPLES</h2>
<p>Generating named Juniper prefix-filter for <code>AS20597</code>:</p>
<pre><code> user@host:~&gt;bgpq3 -Jl eltel AS20597
policy-options {
replace:
@ -198,8 +159,10 @@ and route-sets. </p>
}
}
</code></pre>
<p>For Cisco we can use aggregation (-A) flag to make this prefix-filter
more compact:</p>
<pre><code> user@host:~&gt;bgpq3 -Al eltel AS20597
no ip prefix-list eltel
ip prefix-list eltel permit 81.9.0.0/20
@ -214,13 +177,17 @@ more compact:</p>
ip prefix-list eltel permit 89.112.64.0/19
ip prefix-list eltel permit 217.170.64.0/19 ge 20 le 20
</code></pre>
<p>and, as you see, prefixes <code>89.112.0.0/19</code> and <code>89.112.32.0/19</code> now aggregated
into single entry </p>
<pre><code>ip prefix-list eltel permit 89.112.0.0/18 ge 19 le 19.
</code></pre>
<p>Well, for Juniper we can generate even more interesting policy-statement,
using <code>-M &lt;extra match conditions&gt;</code>, <code>-r &lt;len&gt;</code>, <code>-R &lt;len&gt;</code> and hierarchical
names:</p>
<pre><code> user@host:~&gt;bgpq3 -AJEl eltel/specifics -r 29 -R 32 -M "community blackhole" AS20597
policy-options {
policy-statement eltel {
@ -242,17 +209,22 @@ replace:
}
}
</code></pre>
<p>generated policy-option term now allows more-specific routes in range
/29 - /32 for eltel networks if they marked with community 'blackhole'
(defined elsewhere in configuration).</p>
<p>Of course, <code>bgpq3</code> supports IPv6 (-6):</p>
<pre><code> user@host:~&gt;bgpq3 -6l as-retn-6 AS-RETN6
no ipv6 prefix-list as-retn-6
ipv6 prefix-list as-retn-6 permit 2001:7fb:fe00::/48
ipv6 prefix-list as-retn-6 permit 2001:7fb:fe01::/48
[....]
</code></pre>
<p>and ASN32</p>
<pre><code> user@host:~&gt;bgpq3 -J3f 112 AS-SPACENET
policy-options {
replace:
@ -264,9 +236,12 @@ replace:
}
}
</code></pre>
<p>see <code>AS196611</code> in the end of the list ? That's <code>AS3.3</code> in 'asplain' notation.</p>
<p>If your router does not support ASN32 (yet) you should not use switch -3,
and the result will be next:</p>
<pre><code> user@host:~&gt;bgpq3 -f 112 AS-SPACENET
no ip as-path access-list NN
ip as-path access-list NN permit ^112( 112)*$
@ -276,38 +251,54 @@ and the result will be next:</p>
ip as-path access-list NN permit ^112( [0-9]+)* (25152|31529|34127|34906)$
ip as-path access-list NN permit ^112( [0-9]+)* (35052|41720|43628|44450)$
</code></pre>
<p><code>AS196611</code> is no more in the list, however, <code>AS23456</code> (transition AS) would
have been added to list if it were not present.</p>
<h2>DIAGNOSTICS</h2>
<p>When everything is OK, <code>bgpq3</code> generates result to standard output and
exits with status == 0. In case of errors they are printed to stderr and
program exits with non-zero status.</p>
<h2>NOTES ON ULTRA-LARGE PREFIX-LISTS</h2>
<p>When using <code>bgpq3</code> to expand extra-large AS-SETs, <code>bgpq3</code> may stuck
due to lacking tcp buffer size. To avoid this, tune your OS.
FreeBSD can be tuned in the following way:</p>
<pre><code>sysctl -w net.inet.tcp.sendbuf_max=16777216
<p>To improve <code>bgpq3</code> performance when expanding extra-large AS-SETs you
shall tune OS settings to enlarge TCP send buffer.</p>
<p>FreeBSD can be tuned in the following way:</p>
<pre><code>sysctl -w net.inet.tcp.sendbuf_max=2097152
</code></pre>
<p>Linux can be tuned in the following way:</p>
<pre><code>sysctl -w net.ipv4.tcp_window_scaling=1
sysctl -w net.core.rmem_max=16777216
sysctl -w net.core.wmem_max=16777216
sysctl -w net.ipv4.tcp_rmem="4096 87380 16777216"
sysctl -w net.ipv4.tcp_wmem="4096 65536 16777216"
sysctl -w net.core.rmem_max=2097152
sysctl -w net.core.wmem_max=2097152
sysctl -w net.ipv4.tcp_rmem="4096 87380 2097152"
sysctl -w net.ipv4.tcp_wmem="4096 65536 2097152"
</code></pre>
<p>Please note that generated prefix-lists may not fit your router's
limitations. For example, JunOS supports only 85,325 prefixes in
each prefix-list <a href="http://www.juniper.net/techpubs/en_US/junos11.4/topics/reference/configuration-statement/prefix-list-edit-policy-options.html">4</a>. </p>
<h2>SEE ALSO</h2>
<ol>
<li><a href="http://www.radb.net/">Routing Arbiter</a></li>
<li><a href="http://www.ietf.org/internet-drafts/draft-michaelson-4byte-as-representation-05.txt">draft-michaelson-4byte-as-representation-05.txt</a>
for information on 'asdot' and 'asplain' notations.</li>
for information on 'asdot' and 'asplain' notations.</li>
<li><a href="http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6554/ps6599/data_sheet_C78-521821.html">Cisco documentation</a>
for information on Cisco implementation of ASN32.</li>
for information on Cisco implementation of ASN32.</li>
<li><a href="http://www.juniper.net/techpubs/en_US/junos11.4/topics/reference/configuration-statement/prefix-list-edit-policy-options.html">JunOS prefix-lists limitation</a></li>
</ol>
<h2>AUTHOR</h2>
<p>Alexandre Snarskii <a href="mailto:snar@snar.spb.ru">snar@snar.spb.ru</a></p>
<h2>Program Homepage</h2>
<p><a href="http://snar.spb.ru/prog/bgpq3/">http://snar.spb.ru/prog/bgpq3/</a></p>
<p><a href="http://snar.spb.ru/prog/bgpq3/">http://snar.spb.ru/prog/bgpq3/</a></p>

View File

@ -1,12 +1,12 @@
Name: bgpq3
Version: 0.1.28
Version: 0.1.31
Release: 0%{?dist}
Group: System/Utilities
Summary: Automate BGP filter generation based on routing database information
URL: http://snar.spb.ru/prog/bgpq3/
License: BSD
Source0: http://snar.spb.ru/prog/bgpq3/bgpq3-0.1.28.tgz
Source0: http://snar.spb.ru/prog/bgpq3/bgpq3-0.1.31.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
@ -35,6 +35,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Tue Jun 23 Alexandre Snarskii <snar@snar.spb.ru> 0.1.31
- Version updated
* Tue Mar 10 Alexandre Snarskii <snar@snar.spb.ru> 0.1.28
- Version updated

18
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bgpq3 0.1.30.
# Generated by GNU Autoconf 2.69 for bgpq3 0.1.31.
#
# Report bugs to <snar@snar.spb.ru>.
#
@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bgpq3'
PACKAGE_TARNAME='bgpq3'
PACKAGE_VERSION='0.1.30'
PACKAGE_STRING='bgpq3 0.1.30'
PACKAGE_VERSION='0.1.31'
PACKAGE_STRING='bgpq3 0.1.31'
PACKAGE_BUGREPORT='snar@snar.spb.ru'
PACKAGE_URL=''
@ -1187,7 +1187,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures bgpq3 0.1.30 to adapt to many kinds of systems.
\`configure' configures bgpq3 0.1.31 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1248,7 +1248,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of bgpq3 0.1.30:";;
short | recursive ) echo "Configuration of bgpq3 0.1.31:";;
esac
cat <<\_ACEOF
@ -1327,7 +1327,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
bgpq3 configure 0.1.30
bgpq3 configure 0.1.31
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -1495,7 +1495,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by bgpq3 $as_me 0.1.30, which was
It was created by bgpq3 $as_me 0.1.31, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -3413,7 +3413,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by bgpq3 $as_me 0.1.30, which was
This file was extended by bgpq3 $as_me 0.1.31, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -3475,7 +3475,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
bgpq3 config.status 0.1.30
bgpq3 config.status 0.1.31
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -1,4 +1,4 @@
AC_INIT(bgpq3,0.1.30,snar@snar.spb.ru)
AC_INIT(bgpq3,0.1.31,snar@snar.spb.ru)
AC_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_INSTALL