> Hi,
Hello.
You have changed import filter of direct1 protocol, thus direct1 gets
> The problem I am facing is that when I adjust a filter in order to
> withdraw the route, all routes are withdrawn and the remaining are
> announced again. According to the doc if a reload on bird brings a new
> configuration for a protocol, that protocol will be restarted. So, it is
> expected behavior.
>
reconfigured (on HUP or birdc configure). However this protocol does not
perform "soft" reconfiguration on filter changes thus direct1 restarts
unconditionally to apply your filter changes (IP removal/addition).
All routes flushed out from the table (causing BGP withdrawal) and
fetched from the protocol (direct) again to the table (causing BGP update).
This seems normal behavior.
You could simply attach your loopback_ACL filter to the BGP_PEERS template
export (which any needed adjustments, or just make loopback_ACL to work as
function returning false/true and use it in anycast_range) to solve your case.
Also I suggest you to use global prefix set definition, as local variable
(in filter/function) is created/assigned each time function is called.
For example:
------------
# It is probably good idea to have such protocol configred in most cases.
# It fetches list of the interfaces in system and provides them to the other
# protocols (except OSPF, it has it's own mechanisms).
## This set should be modified only when new frontend subnet is added.
protocol device {
scan time 10;
}
# direct1 would restart on protocol filter change.
#
define ACAST_PS_DIRECT1 =
[
192.168.200.0/24{32,32}
];
protocol direct {
# Import directly connected routes from "lo" interface.
interface "lo";
# This may be is needed to properly resolve nexthops from upstream routes.
interface "<interface_to_your_routers>";
# Do not import from other sources.
interface "-*";
# Import only allowed IPs from the "lo" and route from the upstream
# interface.
import where net ~ ACAST_PS_DIRECT1 || ifname
="<interface_to_your_routers>";
# No export to the protocol, not necessary
export none;
}
# This is global constant for your prefix set (PS) 192.168.200.0/24.
#
# Place this definition into external file and source it with include
# directive from the global configuration file if you wish to modify
# this PS from the outside (e.g. by some HA script).
#
define ACAST_PS_ADVERTISE =
[
192.168.200.1/32, # Frontend 1
192.168.200.2/32 # Frontend 2
];
function acast_advertise()
{
return net ~ ACAST_PS_ADVERTISE;
}
filter anycast_range
{
if acase_advertise() then
accept;
reject;
}
Tested similar config with BIRD 1.3.11 and seems no unwanted
withdrawals spot.