Beginner Tips

mk16.de

I was asked for tips in an email. Well why not share them now? These tips are for “newbies” in dn42. I am happy to receive suggestions and ideas for improvement: m.k@mk16.de

(The order is based on what came to my mind first)

Tips

bird2 configuration

template bgp dnpeers {
    local as OWNAS;

    enable extended messages on;
    graceful restart on;
    long lived graceful restart on;
    interpret communities on;
    prefer older on;

    ipv4 {
        extended next hop on;
        
        import where some_stuff();
        export where some_stuff();
        
        import limit 1000 action block;
        import table on;
    };

    ipv6 {   
        import where some_stuff();
        export where some_stuff();
        
        import limit 1000 action block;
        import table on;
    };
}

This is a kind of improved version for bird2. I have omitted the import/export filters.

enable extended messages on;

Enables the extended messages extension. This causes that 65535 bytes can be transmitted in a BGP packet instead of 4096 bytes. This can be handy for many routes.

graceful restart on;
long lived graceful restart on;

I can explain this only conditionally well. Roughly it causes that routes are not deleted immediately in case of a BGP session went down. Thus a “peaceful” transition is possible. Existing connections can still be handled via this peering before the route is completely deleted. If the administrator of the peer has restarted the BGP daemon, it ensures that there is no interruption in the forwarding table. I also recommend to implement BGP Filter Guide / BGP Graceful Shutdown. This ensures that if a graceful shutdown is detected by the peer, it will try to install another route in the forwarding table. This also gives a “peaceful” transition.

interpret communities on;

This option is on by default. But I like to write it down again to be sure. It makes bird automatically support 65535:65281 (no-export), 65535:65282 (no-advertise) and 65535:65283 (no-export-subconfed) without having to implement them manually.

prefer older on;

If two routes are equally good, the router ID is used in the decision process. The route of which the router has the smallest ID is preferred. Personally, I find this decision criterion objectionable. With this option the oldest route is used instead of the lowest router ID. Just because this option is on, bird does not skip the other criteria (bgp_local_pref, bgp_med, AS path length, …).

extended next hop on;

This is an extension that allows an IPv6 address to be used as a nexthop for an IPv4 route. If this option is active, no IPv4 addresses have to be negotiated in the tunnel (e.g. WireGuard). This “saves” IPv4 addresses in the tunnel.

import limit 1000 action block;

This ensures that a maximum of 1000 prefixes may be imported. All after that will be rejected. In dn42 there are about 500-700 prefixes. 1000 are therefore more than enough. It is recommended to enable this option. If the peer has misconfigured something, you can protect yourself with it. This option does not protect against route flapping. Route updates are not affected by the limit.

import table on;

This will also save discarded routes (not import them). If the filter is updated, the routes can be loaded without the peer having to resend them. For example, if you do ROA filtering and the peer exports a new route that is not yet in your ROA filter, the route remains “saved”. If you now update your ROA filter, bird can import the new route without the need for the peer to resend the route.