Trouble with IPv6 and VRFs: Cannot assign requested address

Ralf Jung post at ralfj.de
Fri Dec 28 15:10:28 CET 2018


Hi all,

I am playing around with VRFs in our network, and I am having trouble getting
bird6 to establish its BGP sessions inside a VRF.  Strangely, bird for IPv4
works with pretty much the same configuration.

I have attached the full configuration.  The (I think) interesting bits are

> template bgp ffrl_uplink {
>     table ffrl;
>     vrf "vrf_freifunk";
>     local as 64899;
>     import keep filtered;
>     import filter ebgp_ffrl_import_filter;
>     export filter ebgp_ffrl_export_filter;
>     next hop self;
>     direct;
> };
>
> protocol bgp ffrl_b_ak from ffrl_uplink {
>     source address 2a03:2260:0:195::2;
>     neighbor 2a03:2260:0:195::1 as 201701;
> };

In the logs, all I get (with `debug all;` added) is

> Dez 28 13:05:25 gw1.saar.freifunk.net bird6[24900]: ffrl_b_ak: Connecting to 2a03:2260:0:195::1 from local address 2a03:2260:0:195::2
> Dez 28 13:05:25 gw1.saar.freifunk.net bird6[24900]: ffrl_b_ak: Socket error: bind: Cannot assign requested address
> Dez 28 13:05:25 gw1.saar.freifunk.net bird6[24900]: ffrl_b_ak: Connection closed
> Dez 28 13:05:26 gw1.saar.freifunk.net bird6[24900]: ffrl_b_ak: Connect delayed by 5 seconds

I tried adding `interface "tun-up-ffrl_b_ak";` (that's the interface which has
the address 2a03:2260:0:194::2), to no avail.  I also tried adding `interface
"vrf_freifunk";`, which made the error messages go away but still no peer is
listed in `birdc6 show route table ffrl`.
My IPv4 configuration is almost the same, and yet there finding peers works.
(Actually routing traffic doesn't work yet, but that may also be a problem with
our NAT setup.)

Note that I have very little experience with BGP, we use it only in an internal
instance for peering with our uplink.

>From some googling I found
<https://bird.network.cz/pipermail/bird-users/2017-August/011440.html> which
recommends adding `direct;`, but I already have that set.

This is using bird 1.6.4, Linux 4.18, Debian stable.

Any help would be greatly appreciated.

Kind regards,
Ralf
-------------- next part --------------
log syslog all;
router id 82.165.162.239;

# interne BIRD Routing-Tabelle
table ffrl;

# freifunk ip ranges in general
function is_freifunk() {
    return net ~ [
        fc00::/7{48,64}, # unique local addresses
        2001:bf7::/32+,
        2a03:2260:3009::/48+
    ];
}

function is_ffrl_export() {
    return net ~ [
        2a03:2260:3009:100::/56,
        2a03:2260:3009::/56,
        2a03:2260:3009:f00::/56
    ];
}

function is_default() {
    return net ~ [
        ::/0
    ];
}

# BGP Import Filter für Rheinland
filter ebgp_ffrl_import_filter {
    if is_default() then accept;
    reject;
}

# BGP Export Filter für Rheinland
filter ebgp_ffrl_export_filter {
    if is_ffrl_export() then accept;
    reject;
}

# Dies lädt die Devices in die Tabelle. Die meisten anderen Protokolle brauchen das.
protocol device {
    table ffrl;
    vrf "vrf_freifunk";
    scan time 30;
    primary 2a03:2260::/48;
}

# Statische Routen für unsere Netze
protocol static local_routes {
    table ffrl;
    vrf "vrf_freifunk";
    # FFRL-assigned space: Gateway subspaces
    # we are all in the same layer 2 segment, so we can take all this
    route 2a03:2260:3009:100::/56 via "saarBR";
    route 2a03:2260:3009:200::/56 via "saarBR";
    route 2a03:2260:3009:300::/56 via "saarBR";
    route 2a03:2260:3009:400::/56 via "saarBR";
    # FFRL-assigned space: subet for admin & user services
    route 2a03:2260:3009::/56 via "saarBR";
    route 2a03:2260:3009:f00::/56 via "saarBR";
    # FFRL-assigned space: blackhole the rest
    route 2a03:2260:3009::/48 unreachable;
    # Intranet space
    route fd4e:f2d7:88d2:ffff::/64 via "saarBR";
}

# Wir exportieren über Rheinland gelernte Routen in die Kernel Table 1042 (freifunk)
protocol kernel kernel_ffrl {
    scan time 30;
    import none;
    export filter {
        # Advise the kernel about which address to use as the source
        krt_prefsrc = 2a03:2260:3009::2;
        accept;
    };
    device routes;
    table ffrl;
    vrf "vrf_freifunk";
    kernel table 1042;
};



# BGP Template für Rheinland Peerings
template bgp ffrl_uplink {
    table ffrl;
    vrf "vrf_freifunk";
    local as 64899;
    import keep filtered;
    import filter ebgp_ffrl_import_filter;
    export filter ebgp_ffrl_export_filter;
    next hop self;
    direct;
};

# P E E R I N G S

protocol bgp ffrl_a_ak from ffrl_uplink {
    source address 2a03:2260:0:194::2;
    neighbor 2a03:2260:0:194::1 as 201701;

};

protocol bgp ffrl_b_ak from ffrl_uplink {
    source address 2a03:2260:0:195::2;
    neighbor 2a03:2260:0:195::1 as 201701;

};

protocol bgp ffrl_a_ix from ffrl_uplink {
    source address 2a03:2260:0:196::2;
    neighbor 2a03:2260:0:196::1 as 201701;

};

protocol bgp ffrl_b_ix from ffrl_uplink {
    source address 2a03:2260:0:197::2;
    neighbor 2a03:2260:0:197::1 as 201701;

};

protocol bgp ffrl_a_fra from ffrl_uplink {
    source address 2a03:2260:0:1e9::2;
    neighbor 2a03:2260:0:1e9::1 as 201701;

};

protocol bgp ffrl_b_fra from ffrl_uplink {
    source address 2a03:2260:0:1ea::2;
    neighbor 2a03:2260:0:1ea::1 as 201701;

};


More information about the Bird-users mailing list