route withdrawals are not sent upon protocol removal

Jan Maria Matejka jan.matejka at nic.cz
Tue Jun 5 15:13:12 CEST 2018


Hello!

>     Do you mean route withdrawals for routes received from that removed protocol?
>     Send to other peers? This should not be an issue - when a protocol is removed
>     or disabled, all its routes are removed and withdrawals should be sent to
>     other protocols.
> 
>  
> Yes, I mean withdrawals for routes received by the router from the peer running bird. The peer is directly connected with the router with a bgp session.
> 
> I am removing some static protocols and doing "birdc configure soft" but no route withdrawals are being sent for the removed prefixes. Even if I try to run "birdc reload out all", the withdrawals are still not sent since bird forgot about the prefixes already when I did the "configure soft":
> 
> bird[28196]: Removing protocol e_010_cidrs
> bird[28196]: Reconfigured
> 
> If I disable the protocol with "birdc disable e_010_cidrs" without removing it from the config files, I see the esame "Remoing protocol e_010_cidrs" message in the logs and the withdrawals are sent as expected, but I expect bird to also send withdrawals when a protocol is removed from the configs without being explicitly disabled.
> 
> Do you also think this is a bug?

I don't know whether I correctly understand what you are trying to do. Anyway, please
look at the attached script (for Linux). It creates two virtual routers CA and CB,
a BGP link between them and sends a route defined in protocol static {} on CA.

Then it reconfigures CA to remove the static protocol and it correctly shows that
the route is withdrawn, at least for me at v1.6.4.

Note that the script creates temporarily two network namespaces (ca and cb) and
leaves behind two configs and two log files.

Could you please try the attached script or try to create some reproducer for me
to see the bug clearly?

Thanks!
Maria
-------------- next part --------------
#!/bin/sh

# Create network namespaces
ip netns add ca
ip netns add cb
ip netns exec ca ip link set lo up
ip netns exec cb ip link set lo up

# Link between them
ip netns exec ca ip link add name xxx type veth peer name xxx netns cb
ip netns exec ca ip link set xxx up
ip netns exec cb ip link set xxx up
ip netns exec ca ip a add 10.0.0.1/24 dev xxx
ip netns exec cb ip a add 10.0.0.2/24 dev xxx

# Test a ping
ip netns exec ca ping -c 1 10.0.0.2

# Create configs
cat >ca.conf <<EOF
log "ca.log" all;
debug protocols all;

router id 10.0.0.1;

protocol device {}

protocol direct {
  interface "yyy";
}

protocol static {
  import all;
  route 10.20.0.0/16 via 10.0.10.10;
}

protocol bgp {
  import all;
  export all;
  neighbor 10.0.0.2 as 65533;
  local 10.0.0.1 as 65533;
}
EOF

cat >cb.conf <<EOF
log "cb.log" all;
debug protocols all;

router id 10.0.0.2;

protocol device {}

protocol bgp {
  import all;
  export all;
  neighbor 10.0.0.1 as 65533;
  local 10.0.0.2 as 65533;
}
EOF

# Run BIRD
ip netns exec ca bird -c ca.conf -s ca.sock
ip netns exec cb bird -c cb.conf -s cb.sock

# Dummy link on ca
ip netns exec ca ip link add yyy type dummy
ip netns exec ca ip link set yyy up
ip netns exec ca ip a add 10.0.10.20/24 dev yyy

showroute() {
  # Show route on ca
  echo "Routes on CA"
  sudo ip netns exec ca birdc -s ca.sock show route

  # Show route on cb
  echo "Routes on CB"
  sudo ip netns exec cb birdc -s cb.sock show route
}

echo "Show routes before reconfig"
showroute

# Reconfigure
cat >ca.conf <<EOF
debug protocols all;

router id 10.0.0.1;

protocol device {}

protocol direct {
  interface "yyy";
}

protocol bgp {
  import all;
  export all;
  neighbor 10.0.0.2 as 65533;
  local 10.0.0.1 as 65533;
}
EOF

birdc -s ca.sock configure soft

# Does it withdraw?
echo "Show routes after reconfig"
showroute

# Cleanup
birdc -s ca.sock down
birdc -s cb.sock down

ip netns del ca
ip netns del cb


More information about the Bird-users mailing list