Bird OSPF. Mask for advertised prefixes.

Пьянков Алексей apyankov at rutube.ru
Thu Jun 11 12:27:17 CEST 2015


Hello.
We have bird 1.4.5 on servers with CentOS 6.5.
We use it for advertise loopback sub-interfaces by OSPF. All subifs with /32 mask.
We use IPVS+keepalived to bring up and down loopback subifs.

Ifconfig:
# ifconfig
eth0.79   Link encap:Ethernet  HWaddr 00:50:56:BA:37:70
          inet addr:10.1.79.2  Bcast:10.1.79.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:feba:3770/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:34948906 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34154161 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3954197378 (3.6 GiB)  TX bytes:3820153316 (3.5 GiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:19544 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19544 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:977404 (954.4 KiB)  TX bytes:977404 (954.4 KiB)

lo:34     Link encap:Local Loopback
          inet addr:10.9.200.100  Mask:255.255.255.255
          UP LOOPBACK RUNNING  MTU:65536  Metric:1

OSPF works on eth0.79 interface.

Problem - when IPVS+keepalived brings up any loopback subif - Bird additionally accept same network but with /8 mask and advertise it to the network.

>From Bird log:
Jun 11 10:36:23 bird: net accepted:10.0.0.0/8
2015-06-11 10:36:22 <INFO> net accepted:10.9.200.100/32

So in network I see:
10.0.0.0/8, ubest/mbest: 1/0
    *via 10.1.79.2, Vlan79, [110/10], 00:02:06, ospf-0, type-2
and
10.9.200.100/32, ubest/mbest: 1/0
    *via 10.1.79.2, Vlan79, [110/10], 02:12:08, ospf-0, type-2

Filter for the Bird to advertise loopbacks:
protocol direct {
        interface "lo*";        # Restrict network interfaces it works with
}
filter connected_OSPF {
# redistribute connected
    if ( source = RTS_DEVICE ) then {
        print "net accepted:", net;
        ospf_metric2 = 10;
        accept;
    }
}


As workaround we configure another filter that accept only /32 nets:
filter connected_OSPF
# redistribute connected
prefix set DEVICE_NETWORKS;
{
        DEVICE_NETWORKS = [ 0.0.0.0/0{32,32} ];
    if ( source = RTS_DEVICE && net ~ DEVICE_NETWORKS ) then {
        print "net accepted:", net;
        ospf_metric2 = 10;
        accept;
    }
        reject;
}

Is it expected behavior of Bird to advertise prefixes like this or I missed something?

Alexey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20150611/2c93907e/attachment.html>


More information about the Bird-users mailing list