Kernel protocol and multiple routes

Magnus Löfqvist ml at vmi.se
Sat Jul 4 13:17:54 CEST 2020


Hi,

Im running bird 1.6.6 on a openwrt device, having two internet connections (one over 4G and one over ethernet).

The main routing table :

default via 10.70.69.193 dev wwan0 proto static src 10.70.69.192
default via 10.3.5.1 dev eth1 proto static src 10.3.5.129 metric 10
10.3.5.0/24 dev eth1 proto static scope link metric 10
10.3.5.1 dev eth1 proto static scope link src 10.3.5.129 metric 10
10.70.69.128/25 dev wwan0 proto kernel scope link src 10.70.69.192
10.70.69.193 dev wwan0 proto static scope link src 10.70.69.192

As you see I get the default gateway over 4G as primary (lowest metric), and that are by design.

I want to use bird to import the default gateways and pipe them to two different tables.

Relevant Config:

filter export_wan {
    if proto = "krn_main" then {
        if ifname = "wwan0" then {
            if (net = 0.0.0.0/0) then {
                accept;
            }
        }
    }

    reject;
}

filter export_wan2 {
    if proto = "krn_main" then {
        if ifname = "eth1" then {
            if (net = 0.0.0.0/0) then {
                accept;
            }
        }
    }

    reject;
}

protocol kernel krn_main {
    learn;
    import all;
    scan time 5;
    kernel table 254;
    merge path yes;
}

protocol kernel krn_wan {
    learn;
    import none;
    export all;
    kernel table 200;
    scan time 5;
    table wan;
}

protocol kernel krn_wan2 {
    learn;
    import none;
    export all;
    kernel table 200;
    scan time 5;
    table wan2;
}

protocol pipe pipe_wan {
    peer table wan;
    export filter export_wan;
    import all;
}

protocol pipe pipe_wan2 {
    peer table wan2;
    export filter export_wan2;
    import all;
}

# birdc4 show route 0.0.0.0/0 all protocol krn_main
BIRD 1.6.6 ready.
0.0.0.0/0 via 10.70.69.193 on wwan0 [krn_main 2020-07-03] (10)
 Type: inherit unicast univ
 Kernel.source: 4
 Kernel.metric: 0
 Kernel.prefsrc: 10.70.69.192

As you see Im only get the route for 4G interface (wwan0) and not for the ethernet (eth1). Why is that, and what can be done to fix it?

/ Magnus

Sent from Nine<http://www.9folders.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20200704/3b0d2b99/attachment.htm>


More information about the Bird-users mailing list