首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OSPF航路费用

OSPF航路费用
EN

Unix & Linux用户
提问于 2017-07-26 13:38:50
回答 1查看 2.4K关注 0票数 0

我正在迁移一个任播OSPF路由绑定冗余设置从Quagga到鸟。

我的困难之一是用鸟来获得不同成本的几条路线,就像我在quagga做的一样。

正如我在/etc/quagga/ospfd.conf中所做的那样:

代码语言:javascript
复制
interface dummy0
 ip ospf cost 100
!
interface dummy1
 ip ospf cost 500
!
interface dummy2
 ip ospf cost 1000
!
interface dummy3
 ip ospf cost 900
!

我可以在birdc中使用show ospf state命令看到,尽管在/etc/bird.conf中定义了接口中的成本,但配置并没有赋予权重。该怎么办呢?

代码语言:javascript
复制
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;
                };

        };
}
EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2017-07-26 13:38:50

最后,我从show ospf state的输出中学习--我指的是鸟语中的stubnet,在一个模糊的问题中找到了答案,在鸟语法定义中找到了正确的语法和位置。

因此,在本例中为OSPF宣布的特定路由提供成本的配置在最后定义了一个在OSPF区域定义中宣布网络的固执,如下所示:

代码语言:javascript
复制
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;
                };

        };
}

从使用birdc可以看出,它起了作用:

代码语言:javascript
复制
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
票数 2
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/381905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档