OSPF export/import default route filter problem

LU zyash911 at gmail.com
Sat Sep 19 21:09:54 CEST 2015


Hi,

I have 4 routers connected like this.

(10.4.4.1/24)        (10.4.4.4.2/24)
       R1           R2
         \            /
          \          /
          SWITCH
         /          \
        /            \
      R3            R4
(10.4.4.3/24)       (10.4.4.4/24)


I export a default route (0.0.0.0/0) from R1 and R2 with an ospf_metric1 =
100..

At R3, in an import filter I set the ospf_metric1 of R1's default route to
10.

At R4, in an import filter I set the ospf_metric1 of R2's default route to
10.

What I expect is that R3's routing table is going to contain 0.0.0.0/0 via
R1.
and likewise R4's routing table is going to contain 0.0.0.0/0 via R2.

Unfortunately it doesn't happen and both R3's and R4's routing table has
0.0.0.0/0 via R2.

Here's a config for router R1 (R2 is identical except for router id).

router id 10.4.4.1

protocol kernel {
        export all;
}

protocol direct {
}

protocol device {
        scan time 10;
}

protocol static {
        route 0.0.0.0/0 via 123.123.123.1; #vtnet0
}

protocol ospf {
        tick 2;
        rfc1583compat yes;
        export filter {
                if net = 0.0.0.0/0 then {
                        ospf_metric1 = 100;
                        accept;
                }
                reject;
        }
        area 0.0.0.0 {
                interface "vtnet1" {
                        dead count 4;
                        type broadcast;
                }
        }
}

Here's a config  for router R3 (R4 is identical except for router id and if
statement's ospf_router_id)

router id 10.4.4.3

protocol kernel {
        export all;
}

protocol direct {
}

protocol device {
        scan time 10;
}

protocol static {
}

protocol ospf {
        tick 2;
        rfc1583compat yes;
        import filter {

                if ospf_router_id = 10.4.4.1 then {
                        if net = 0.0.0.0/0 then {
                                ospf_metric1 = 10;
                        }
                }

                accept;
        }
        area 0.0.0.0 {
                interface "vtnet0" {
                        dead count 4;
                        type broadcast;
                }

                interface "ng*" {
                        stub yes;
                }
        }
}

When I place a print statement in the import filter at the very top:

        import filter {
                print "router_id: ", ospf_router_id, " net: ", net;
                if ospf_router_id = 10.4.4.1 then {
                        if net = 0.0.0.0/0 then {
                                ospf_metric1 = 10;
                        }
                }

For R3 I see:
router_id: 10.4.4.3 net: 10.4.4.0/24
router_id: 10.4.4.2 net: 0.0.0.0/0
router_id: 10.4.4.2 net: 10.4.4.0/24

For R4 I see:
router_id: 10.4.4.4 net: 10.4.4.0/24
router_id: 10.4.4.2 net: 0.0.0.0/0
router_id: 10.4.4.2 net: 10.4.4.0/24


So router R1 (10.4.4.1) is not seen by the import filters, as such R2 is
selected as the default route for both R3 and R4.

How could i fix it?

Thank you..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20150919/2c514d39/attachment.html>


More information about the Bird-users mailing list