Exa-Networks / exabgp

The BGP swiss army knife of networking
Other
2.06k stars 441 forks source link

exabgp 4.2.21: no neighbor matching the command : announce route 6.6.6.0/24 next-hop 185.228.172.78 #1132

Closed pguibert6WIND closed 1 year ago

pguibert6WIND commented 1 year ago

on an ubuntu-20.04 distribution, I install fresh exabgp: pip3 install exabgp I use the below configuration:

process advertise-route {
        run /usr/bin/python3 /tmp/route.py;
        encoder text;
}

neighbor 185.228.172.66 {
        router-id 185.228.172.78;
        local-address 185.228.172.78;
        local-as 33932;
        peer-as 33932;
        flow {
                route {
                        match {
                                source 185.228.172.73/32;
                                destination 0.0.0.0/0;
                                source-port >=49156&<=49159;
                        }
                        then {
                                redirect 213.242.114.113;
                        }
                }   
                route {
                        match {
                                source 185.228.172.72/32;
                                destination 0.0.0.0/0;
                                source-port >=49160&<=49163;
                        }
                        then {                                redirect 213.242.114.113;
                        }
                }   
                route {
                        match {
                                source 185.228.172.72/32;
                                destination 0.0.0.0/0;
                                source-port >=49160&<=49163;
                        }
                        then {
                                redirect 149.6.131.161;
                        }
                }   
        }
}

and the below exabgp.env

[exabgp.api]
encoder = text
pipename = 'exabgp'
respawn = false
terminate = true   
ack = false

[exabgp.bgp]
openwait = 60
[exabgp.daemon]
daemonize = false  

[exabgp.log]
all = false
configuration = true
daemon = false
destination = '/tmp/exabgp.log'
enable = true
level = WARNING
message = false
network = false
packets = false
parser = false
processes = false  
reactor = true
rib = false
routes = false
short = false
timers = false

[exabgp.pdb]
enable = false

[exabgp.profile]
enable = false

[exabgp.reactor]
speed = 1.0

[exabgp.tcp]
acl = false
bind = ''
delay = 0
once = false
port = 179

and the below route.py file:

#!/usr/bin/env python3
#pylint: skip-file

import sys
import time

messages = [
    'announce route 6.6.6.0/24 next-hop 185.228.172.78',
]

time.sleep(2)

while messages:
    message = messages.pop(0)
    sys.stdout.write(message + '\n')
    sys.stdout.flush()
    time.sleep(1)

while True:
    time.sleep(1)

I do the following:

mkfifo /run/exabgp.{in,out}
chmod 777 /run/exabgp*
chmod 777 /run
/usr/bin/python3 /usr/local/bin/exabgp --env /tmp/exabgp.env /tmp/exabgp.cfg
17:01:13 | 5913   | configuration | rate-limiting flow under 9600 bytes per seconds may not work
17:01:13 | 5913   | configuration | rate-limiting flow under 9600 bytes per seconds may not work

I look at traces collected:

Mon, 12 Dec 2022 17:02:03 5928   api           no neighbor matching the command : announce route 6.6.6.0/24 next-hop 185.228.172.78
thomas-mangin commented 1 year ago

This configuration should have never worked according to the examples.

I am sorry that it was not correctly documented. I failed to notice this non-backward compatible behaviour on the 4.xx release.

The process section should always have been linked to the relevant neighbors. It was working previously "by luck", and this is not the case anymore as we had to fix issues related to that bad behaviour.

This change makes it work as it should.

--- route-before.conf   2022-12-13 14:38:40
+++ route.conf  2022-12-13 14:37:40
@@ -8,6 +8,9 @@
         local-address 127.0.0.2;
         local-as 33932;
         peer-as 33932;
+        api {
+       processes [ advertise-route ];
+   }
         flow {
                 route {
                         match {
pguibert6WIND commented 1 year ago

thanks for feedback. it works. unfortunately, I did not get those recent updates. closing ticket.

thomas-mangin commented 1 year ago

Once again, sorry for introducing a fix which was not backward compatible without a work-around ..