Problems announcing routes via API

220 views
Skip to first unread message

Chris Rapier

unread,
May 12, 2019, 10:28:15 AM5/12/19
to exabgp-users
Hello all,

I'm running into some problems with an interface that I'm developing for ExaBGP. In my config file I have the process defined with

process exabgp-interface {
run /usr/local/bin/exabgp_interface.pl;
encoder text;
}

I have 4 neighbors set up like the following

neighbor 10.0.0.1 {
local-address 147.xxx.xxx.xxx;
description "Walker/I2";
hold-time 180;
local-as xxxx;
peer-as xxxx;
router-id 147.xxx.xxx.xxx;
family {
ipv4 unicast;
}
api {
processes [exabgp-interface];
}
announce {
ipv4 {
###DO NOT DELETE THE EXAMPLE BELOW
unicast 147.xxx.xxx.xxx/32 next-hop 10.254.254.254 community 65535:666;
}
}
}

When I send a route to blackhole to the API I'm using the following syntax
neighbor 10.0.0.4 announce route 10.1.1.1/32 next-hop self

The log displays the following error
Thu, 09 May 2019 16:20:20 12100 process command from process exabgp-interface : "neighbor 10.0.0.4 announce route 10.1.1.1/32 next-hop self;"
Thu, 09 May 2019 16:20:20 12100 reactor async | exabgp-interface | "neighbor 10.0.0.4 announce route 10.1.1.1/32 next-hop self;"
Thu, 09 May 2019 16:20:20 12100 configuration . 10.0.0.4 | 'announce' 'route' '10.1.1.1/32' 'next-hop' 'self'
Thu, 09 May 2019 16:20:20 12100 configuration
Thu, 09 May 2019 16:20:20 12100 configuration syntax error in api command
Thu, 09 May 2019 16:20:20 12100 configuration line 1: 10.0.0.4 announce route 10.1.1.1/32 next-hop self ;
Thu, 09 May 2019 16:20:20 12100 configuration
Thu, 09 May 2019 16:20:20 12100 configuration invalid keyword "10.0.0.4"
Thu, 09 May 2019 16:20:20 12100 api command could not parse route in : "neighbor 10.0.0.4 announce route 10.1.1.1/32 next-hop self;"
Thu, 09 May 2019 16:20:20 12100 api reason: invalid keyword "10.0.0.4"
Thu, 09 May 2019 16:20:20 12100 process responding to exabgp-interface : error


The same line does work in exabgpcli.

I'm using version 4.0.10-a8462350

I'm not really sure what the problem is here. Is it formatting? Can I not pass a neighbor prefix to an announce via the API?

Thanks for any insights,

Chris Rapier

Thomas Mangin

unread,
May 12, 2019, 10:35:21 AM5/12/19
to exabgp...@googlegroups.com
Next hop self is a cludge I implemented to be nice to someone I knew. I wished it had been part of the design from day one as it is a bit hard to get right.

I will have to investigate but in the meanwhile you can limit a route to a peer and then hardcode the IP.

Thomas

--
You received this message because you are subscribed to the Google Groups "exabgp-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exabgp-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/exabgp-users/3b968177-0e80-40f6-87b4-ee45952988d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Mangin

unread,
May 12, 2019, 12:19:27 PM5/12/19
to exabgp...@googlegroups.com
Hello,

Using master (which had commit this week-end)

        process exabgp-interface {
                run ./one;
                encoder text;
        }

        neighbor 10.0.0.1 {
                local-address 127.0.0.1;
                description "Walker/I2";
                hold-time 180;
                local-as 1;
                peer-as 1;
                router-id 147.0.0.0;
                family {
                        ipv4 unicast;
                }
                api {
                        processes [exabgp-interface];
                }
                announce {
                        ipv4 {
                                unicast 147.0.0.1/32 next-hop 10.254.254.254 community 65535:666;
                        }
                }
        }

#!/bin/sh
echo "neighbor 10.0.0.1 announce route 10.1.1.1/32 next-hop self;"
sleep 3000

17:17:17 | 61444  | process       | command from process exabgp-interface : neighbor 10.0.0.1 announce route 10.1.1.1/32 next-hop self;
17:17:17 | 61444  | reactor       | async | exabgp-interface | neighbor 10.0.0.1 announce route 10.1.1.1/32 next-hop self;
17:17:17 | 61444  | configuration | . route            | '10.1.1.1/32' 'next-hop' 'self'
17:17:17 | 61444  | api           | route added to neighbor 10.0.0.1 local-ip 127.0.0.1 local-as 1 peer-as 1 router-id 147.0.0.0 family-allowed in-open : 10.1.1.1/32 next-hop self
17:17:17 | 61444  | process       | responding to exabgp-interface : done

Work for me :-( or :-) ?

Thomas

On Sun, 12 May 2019 at 15:28, Chris Rapier <rap...@psc.edu> wrote:

rapier

unread,
May 13, 2019, 10:00:16 AM5/13/19
to exabgp...@googlegroups.com
So I discovered the problem was between my keyboard and the chair.
I have a config file where I define a template used to build the
blackhole routes. I had been enclosing those strings in quotes because
of course you enclose a string in a quotes. What I was sending exabgp
was the entire string including the quotes. This caused the strangeness
described. Once I removed the enclosing quotes everything worked as
expected.

Thanks for the insight on next-hop self.

Chris

On 5/12/19 10:35 AM, Thomas Mangin wrote:
> Next hop self is a cludge I implemented to be nice to someone I knew. I
> wished it had been part of the design from day one as it is a bit hard
> to get right.
>
> I will have to investigate but in the meanwhile you can limit a route to
> a peer and then hardcode the IP.
>
> Thomas
>
> On Sun, 12 May 2019 at 15:28, Chris Rapier <rap...@psc.edu
> <mailto:rap...@psc.edu>> wrote:
>
> Hello all,
>
> I'm running into some problems with an interface that I'm developing
> for ExaBGP. In my config file I have the process defined with
>
>         process exabgp-interface {
>                 run /usr/local/bin/exabgp_interface.pl
> <http://exabgp_interface.pl>;
>                 encoder text;
>         }
>
> I have 4 neighbors set up like the following
>
>         neighbor 10.0.0.1 {
>                 local-address 147.xxx.xxx.xxx;
>                 description "Walker/I2";
>                 hold-time 180;
>                 local-as xxxx;
>                 peer-as xxxx;
>                 router-id 147.xxx.xxx.xxx;
>                 family {
>                         ipv4 unicast;
>                 }
>                 api {
>                         processes [exabgp-interface];
>                 }
>                 announce {
>                         ipv4 {
>                                 ###DO NOT DELETE THE EXAMPLE BELOW
>                                 unicast 147.xxx.xxx.xxx/32 next-hop
> 10.254.254.254 community 65535:666;
>                         }
>                 }
>         }
>
> When I send a route to blackhole to the API I'm using the following
> syntax
> neighbor 10.0.0.4 announce route 10.1.1.1/32 <http://10.1.1.1/32>
> next-hop self
>
> The log displays the following error
> Thu, 09 May 2019 16:20:20 12100  process       command from process
> exabgp-interface : "neighbor 10.0.0.4 announce route 10.1.1.1/32
> <http://10.1.1.1/32> next-hop self;"
> Thu, 09 May 2019 16:20:20 12100  reactor       async |
> exabgp-interface | "neighbor 10.0.0.4 announce route 10.1.1.1/32
> <http://10.1.1.1/32> next-hop self;"
> Thu, 09 May 2019 16:20:20 12100  configuration . 10.0.0.4         |
> 'announce' 'route' '10.1.1.1/32 <http://10.1.1.1/32>' 'next-hop' 'self'
> Thu, 09 May 2019 16:20:20 12100  configuration
> Thu, 09 May 2019 16:20:20 12100  configuration syntax error in api
> command
> Thu, 09 May 2019 16:20:20 12100  configuration line 1: 10.0.0.4
> announce route 10.1.1.1/32 <http://10.1.1.1/32> next-hop self ;
> Thu, 09 May 2019 16:20:20 12100  configuration
> Thu, 09 May 2019 16:20:20 12100  configuration invalid keyword
> "10.0.0.4"
> Thu, 09 May 2019 16:20:20 12100  api           command could not
> parse route in : "neighbor 10.0.0.4 announce route 10.1.1.1/32
> <http://10.1.1.1/32> next-hop self;"
> Thu, 09 May 2019 16:20:20 12100  api           reason: invalid
> keyword "10.0.0.4"
> Thu, 09 May 2019 16:20:20 12100  process       responding to
> exabgp-interface : error
>
>
> The same line does work in exabgpcli.
>
> I'm using version 4.0.10-a8462350
>
> I'm not really sure what the problem is here. Is it formatting? Can
> I not pass a neighbor prefix to an announce via the API?
>
> Thanks for any insights,
>
> Chris Rapier
>
> --
> You received this message because you are subscribed to the Google
> Groups "exabgp-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to exabgp-users...@googlegroups.com
> <mailto:exabgp-users%2Bunsu...@googlegroups.com>.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "exabgp-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/exabgp-users/aysFk4ujpSQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> exabgp-users...@googlegroups.com
> <mailto:exabgp-users...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/exabgp-users/CAMC66U3C3nbEFSCq2JhWa6gBySX-AMaN4dSShdiRMwZYSGXZcQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/exabgp-users/CAMC66U3C3nbEFSCq2JhWa6gBySX-AMaN4dSShdiRMwZYSGXZcQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages