Hello,

On the dn42 network (http://www.dn42.net) we have been seeing quite a few BGP ghost routes lately. After some research, it turns out that bird may not correctly handle received AS-paths containing the own AS number. Bird ignores incoming BGP routes containing the local AS number - completely. This may result in an older, now invalid, route not getting removed.

I've reproduced this behaviour by sending fake BGP packets from AS1113 to AS1111. AS1111 is running bird, AS1113 is running a custom 'BGP speaker' which will send fake route updates. See below.

Now I don't know whether it is appropriate to send routes with AS paths containing your peer's AS number (is it?), but it seems to happen in reality and bird does not handle this correctly, resulting in routing loops.

I'm running bird version 1.2.5, the debian package.

Reproducing the problem:

-- Initially there is no such route
bird> show route all for 1.3.3.99
1.3.3.0/24         unreachable [static1 17:36] * (200)
    Type: static unicast univ

-- After sending a route for 1.3.3.99/32 via ASes 1113, 9992, 9991, 9993:
bird> show route all for 1.3.3.99
1.3.3.99/32 via 10.11.1.7 on tap.ufonet [btest1 17:45 from 10.11.5.36] * (100) [AS9993i]
    Type: BGP unicast univ
    BGP.origin: IGP
    BGP.as_path: 1113 9992 9991 9993
    BGP.next_hop: 0.0.0.0
    BGP.local_pref: 100

-- After sending a route for 1.3.3.99/32 via ASes 1113, 9991, 1111, 9993
bird> show route all for 1.3.3.99
1.3.3.99/32 via 10.11.1.7 on tap.ufonet [btest1 17:45 from 10.11.5.36] * (100) [AS9993i]
    Type: BGP unicast univ
    BGP.origin: IGP
    BGP.as_path: 1113 9992 9991 9993
    BGP.next_hop: 0.0.0.0
    BGP.local_pref: 100

-- The route has not changed, but it should at least have been removed
-- After sending an update marking the route unfeasible:
bird> show route all for 1.3.3.99

-- Perhaps also interestingly, only after the BGP connection has been closed, bird contains to the earlier state:
bird> show route all for 1.3.3.99
1.3.3.0/24         unreachable [static1 17:36] * (200)
    Type: static unicast univ

Reply via email to