0

I am migrating an anycast OSPF routing BIND redundant setup from Quagga to BIRD.

One of my difficulties is getting several routes with different costs with BIRD, in the same way as I am doing it in quagga.

As in Quagga I am doing in /etc/quagga/ospfd.conf:

interface dummy0
 ip ospf cost 100
!
interface dummy1
 ip ospf cost 500
!
interface dummy2
 ip ospf cost 1000
!
interface dummy3
 ip ospf cost 900
!

I can see in birdc using the command show ospf state that my configuration is not giving weights, despite having defined the cost in the interfaces in /etc/bird.conf. What to do?

protocol ospf {
        tick 2;
        rfc1583compat yes;

        area 0.0.0.0 {

        networks {
            1.1.1.0/22;
            2.2.2.2/32;
            3.3.3.3/32;
            4.4.4.4/32;
            5.5.5.5/32;
        };

                interface "eth0" {

                        cost 1000;
                        password "xxxxxxxxxx" {
                            id 5;
                        };
                        authentication cryptographic; 
                };

                interface "dummy0" {
                        stub;
                        cost 100;
                };
                interface "dummy1" {
                        stub;
                        cost 500;
                };
                interface "dummy2" {
                        stub;
                        cost 1000;
                };
                interface "dummy3" {
                        stub;
                        cost 900;
                };

        };
}
2

I ended up learning from the output of show ospf state I was referring to stubnet in BIRD parlance, and find out in an obscure question, and in the BIRD grammar definition the right syntax and place.

So at the end the configuration for giving costs to specific routes announced by OSPF on this case is done defining a stubnet announcing the network in the OSPF area definition, as in:

protocol ospf {
     tick 2;
        rfc1583compat yes;

        area 0.0.0.0 {
        #stub;
        networks {
            1.1.1.0/22;
        };
                stubnet 2.2.2.2/32 {
                    cost 100;
                };
                stubnet 3.3.3.3/32 {
                cost 500;   
        };
                stubnet 4.4.4.4/32 {
            cost 1000;
        };
                stubnet 5.5.5.5/32 {
            cost 900;
        };
                interface "eth0" {

                        cost 1000;
                        password "xxxxxxxxxxxxxxxxxxxx" {
                           id 5;
                        };
                        authentication cryptographic; 
                };

                interface "dummy0" {
                        stub;
                };
                interface "dummy1" {
                        stub;
                };
                interface "dummy2" {
                        stub;
                };
                interface "dummy3" {
                        stub;
                };

        };
}

As it can be seen by using birdc, it worked:

dns:/etc/bird# birdc
BIRD 1.6.3 ready.
bird> show ospf state
bird> 
area 0.0.0.0
.....................

    router 1.1.1.1
        distance 1000
        network 1.1.1.0/22 metric 1000
        stubnet 4.4.4.4/32 metric 1000
        stubnet 5.5.5.5/32 metric 900
        stubnet 3.3.3.3/32 metric 500
        stubnet 2.2.2.2/32 metric 100

.................

dns:/etc/bird# exit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.