[quagga-users 14592] Re: Scripted input of several thousand blackhole routes into bgp

Stephan von Krawczynski <[email protected]>
Newsgroups gmane.network.quagga.user
Organization ith Kommunikationstechnik GmbH
Message-ID <[email protected]>
On Sat, 21 Jan 2017 07:36:47 -0500
David Bond <dbond-w4K3LfPhrzOYoAmmQSGB5AC/[email protected]> wrote:

> In testing I've used something like this bash function before:
> 
> function add_routes_to_quagga {
>   local max=${1:-100}
> 
>   for i in $(seq 1 $max) ; do
>     sudo vtysh -c "conf t" -c "ip route 1.1.$i.0/24 blackhole"
>   done
> }
> 
> sudo vtysh -c is the key.
> 
> Not sure if that is helpful.
> 
> -David

Hi David,

but that does not yet redistribute the routes, does it?

--
Regards,
Stephan


> 
> On Sat, Jan 21, 2017 at 7:22 AM, Stephan von Krawczynski <[email protected]>
> wrote:
> 
> >
> > On Sat, 21 Jan 2017 11:50:43 +0000
> > Paul Thornton <[email protected]> wrote:
> >
> > > Hi
> > >
> > > On 21/01/2017 09:36, Stephan von Krawczynski wrote:
> > > > I want to enter around several thousand mainly host blackhole routes
> > into bgp
> > > > for redistribution. The IPs are coming dynamically from a failban
> > setup. Does
> > > > anyone have an easy way to implement that?
> > >
> > > The 'usual' way to do something like this would be to set up a single
> > > static route as a blackhole (eg: 192.0.2.1/32 -> blackhole) on your
> > > router(s) and then use BGP on another machine to actually inject the
> > > routes into your network with a next-hop of 192.0.2.1.
> > >
> > > Something like exabgp can be used as part of the tool on the non-router
> > > machine to get your list of hosts into BGP - I've not looked, but
> > > something to do what you want may already exist somewhere.
> > >
> > > Paul.
> >
> > Hi Paul,
> >
> > thanks for your input. I would like to come out with a solution that
> > injects a
> > "real" blackhole route (linux), just like "ip ro add blackhole <IP>" does.
> > Simply because this is the option with the lowest cpu impact on the router.
> > For exactly the same reason I don't want to use an iptables-solution.
> > So my basic idea was to use some tool (or script) to inject this type of
> > route
> > into bgpd which in turn should configure the route via netlink on the local
> > host and redistribute it to other bgp-connected boxes.
> > If you read the google hits regarding blackhole bgp and the like you always
> > end up on pages where the blackhole route is typed into the bgpd vty by
> > hand.
> > This is obviously impossible and no option for several hundred or thousand
> > routes and a dynamic, automated setup.
> >
> > --
> > Regards,
> > Stephan
> >
> > _______________________________________________
> > Quagga-users mailing list
> > Quagga-users-UOy77sIEA+cAd7ICUelF/[email protected]
> > https://lists.quagga.net/mailman/listinfo/quagga-users
> >
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.