首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OSPF -默认信息来源:多个路由器

OSPF -默认信息来源:多个路由器
EN

Server Fault用户
提问于 2018-09-19 08:20:03
回答 1查看 1.2K关注 0票数 0

我从iBGP接收来自R1的默认路由。在R2和R3上,我都配置了默认信息。在R4上,我只看到OSPF数据库中的一条默认路由: R2或R3。当我关闭从R2 / R3到R1的一个链接时,我会看到另一个默认路由出现在OSPF数据库中。

我的真实拓扑稍微复杂一些,那么是否有可能在没有默认信息的情况下在R4上同时出现这两条默认路由?我希望在R2 / R3上公布的默认路由依赖于肋骨中存在的R1的默认路由。

谢谢

编辑:添加信任和输出

R1

代码语言:javascript
复制
set interfaces ge-0/0/0 unit 0 family inet address 10.0.1.1/30
set interfaces ge-0/0/1 unit 0 family inet address 10.0.1.5/30
set interfaces ge-0/0/2 unit 0 family inet address 10.1.1.1/30
set interfaces lo0 unit 0 family inet address 192.168.1.3/32
...
set routing-options static route 0.0.0.0/0 discard
set routing-options autonomous-system 65535
set protocols bgp group internal type internal
set protocols bgp group internal bfd-liveness-detection minimum-interval 300
set protocols bgp group internal bfd-liveness-detection multiplier 3
set protocols bgp group internal neighbor 10.0.1.2 export default-originate
set protocols bgp group internal neighbor 10.0.1.6 export default-originate
set protocols ospf export ospf-default
set protocols ospf area 0.0.0.0 interface ge-0/0/2.0
set protocols bfd traceoptions file bfd-trace
set protocols bfd traceoptions flag all

R2

代码语言:javascript
复制
redundancy
 bfd-template single-hop BGP-BFD
 interval min-tx 300 min-rx 300 multiplier 3
 dampening 2 1000 3000 8
!
interface Loopback0
 ip address 192.168.1.1 255.255.255.255
!
interface GigabitEthernet1
 ip address 10.0.1.2 255.255.255.252
 negotiation auto
 bfd template BGP-BFD
!
interface GigabitEthernet2
 ip address 10.0.1.9 255.255.255.252
 negotiation auto
 bfd template BGP-BFD
!
interface GigabitEthernet3
 no ip address
 negotiation auto
!
interface GigabitEthernet3.100
 encapsulation dot1Q 100
 ip address 10.0.1.13 255.255.255.252
!
interface GigabitEthernet3.300
 encapsulation dot1Q 300
 ip address 10.0.1.21 255.255.255.252
!
router ospf 110
 network 10.0.1.9 0.0.0.0 area 0
 network 10.0.1.13 0.0.0.0 area 0
 network 10.0.1.21 0.0.0.0 area 0
 network 192.168.1.1 0.0.0.0 area 0
 default-information originate
!
router bgp 65535
 bgp log-neighbor-changes
 bgp redistribute-internal
 redistribute ospf 110
 neighbor 10.0.1.1 remote-as 65535
 neighbor 10.0.1.1 fall-over bfd
 neighbor 10.0.1.10 remote-as 65535
 neighbor 10.0.1.10 fall-over bfd
!

R3

代码语言:javascript
复制
redundancy
bfd-template single-hop BGP-BFD
 interval min-tx 300 min-rx 300 multiplier 3
 dampening 2 1000 3000 8
!
interface Loopback0
 ip address 192.168.1.2 255.255.255.255
!
interface GigabitEthernet1
 ip address 10.0.1.6 255.255.255.252
 negotiation auto
 bfd template BGP-BFD
!         
interface GigabitEthernet2
 ip address 10.0.1.10 255.255.255.252
 negotiation auto
 bfd template BGP-BFD
!         
interface GigabitEthernet3
 no ip address
 negotiation auto
!         
interface GigabitEthernet3.200
 encapsulation dot1Q 200
 ip address 10.0.1.17 255.255.255.252
!         
interface GigabitEthernet3.400
 encapsulation dot1Q 400
 ip address 10.0.1.25 255.255.255.252
!         
router ospf 110
 network 10.0.1.10 0.0.0.0 area 0
 network 10.0.1.17 0.0.0.0 area 0
 network 10.0.1.25 0.0.0.0 area 0
 network 192.168.1.2 0.0.0.0 area 0
 default-information originate
!         
router bgp 65535
 bgp log-neighbor-changes
 bgp redistribute-internal
 redistribute ospf 110
 neighbor 10.0.1.5 remote-as 65535
 neighbor 10.0.1.5 fall-over bfd
 neighbor 10.0.1.9 remote-as 65535
 neighbor 10.0.1.9 fall-over bfd
!

R4

代码语言:javascript
复制
interface Loopback0
 ip address 192.168.1.4 255.255.255.255
!
interface GigabitEthernet1
 no ip address
 negotiation auto
!
interface GigabitEthernet1.100
 encapsulation dot1Q 100
 ip address 10.0.1.14 255.255.255.252
!
interface GigabitEthernet1.200
 encapsulation dot1Q 200
 ip address 10.0.1.18 255.255.255.252
!
interface GigabitEthernet2
 no ip address
 negotiation auto
!
interface GigabitEthernet3
 ip address 172.16.0.1 255.255.0.0
 negotiation auto
!
router ospf 110
 network 10.0.1.14 0.0.0.0 area 0
 network 10.0.1.18 0.0.0.0 area 0
 network 172.16.0.1 0.0.0.0 area 0
 network 192.168.1.4 0.0.0.0 area 0
!

R5

代码语言:javascript
复制
interface Loopback0
 ip address 192.168.1.5 255.255.255.255
!
interface GigabitEthernet1
 no ip address
 negotiation auto
!
interface GigabitEthernet1.300
 encapsulation dot1Q 300
 ip address 10.0.1.22 255.255.255.252
!
interface GigabitEthernet1.400
 encapsulation dot1Q 400
 ip address 10.0.1.26 255.255.255.252
!
interface GigabitEthernet2
 no ip address
 shutdown
 negotiation auto
!
interface GigabitEthernet3
 no ip address
 shutdown
 negotiation auto
!
router ospf 110
 network 10.0.1.22 0.0.0.0 area 0
 network 10.0.1.26 0.0.0.0 area 0
 network 192.168.1.5 0.0.0.0 area 0
!

R4 -输出

代码语言:javascript
复制
R4# sho ip ospf database 

            OSPF Router with ID (192.168.1.4) (Process ID 110)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.1.1     192.168.1.1     1219        0x80000005 0x007AA3 4
192.168.1.2     192.168.1.2     1218        0x80000005 0x008881 4
192.168.1.4     192.168.1.4     1223        0x80000003 0x00B0D9 4
192.168.1.5     192.168.1.5     1219        0x80000003 0x0071C3 3

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.10       192.168.1.2     1230        0x80000001 0x006F74
10.0.1.14       192.168.1.4     1223        0x80000001 0x004F8C
10.0.1.18       192.168.1.4     1223        0x80000001 0x0035A1
10.0.1.22       192.168.1.5     1219        0x80000001 0x0003CE
10.0.1.26       192.168.1.5     1219        0x80000001 0x00E8E3

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         192.168.1.2     1217        0x80000001 0x00CD0B 110

R5 -输出

代码语言:javascript
复制
R5#sho ip ospf database 

            OSPF Router with ID (192.168.1.5) (Process ID 110)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.1.1     192.168.1.1     473         0x80000006 0x0078A4 4
192.168.1.2     192.168.1.2     503         0x80000006 0x008682 4
192.168.1.4     192.168.1.4     451         0x80000004 0x00AEDA 4
192.168.1.5     192.168.1.5     471         0x80000004 0x006FC4 3

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.10       192.168.1.2     503         0x80000002 0x006D75
10.0.1.14       192.168.1.4     451         0x80000002 0x004D8D
10.0.1.18       192.168.1.4     451         0x80000002 0x0033A2
10.0.1.22       192.168.1.5     471         0x80000002 0x0001CF
10.0.1.26       192.168.1.5     471         0x80000002 0x00E6E4

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         192.168.1.2     503         0x80000002 0x00CB0C 110

R2 BGP / OSPF

代码语言:javascript
复制
BGP table version is 15, local router ID is 192.168.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 r>i 0.0.0.0          10.0.1.1                      100      0 i
 * i 10.0.1.8/30      10.0.1.10                0    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 * i 10.0.1.12/30     10.0.1.18                2    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 *>  10.0.1.16/30     10.0.1.14                2         32768 ?
 * i                  10.0.1.10                0    100      0 ?
 * i 10.0.1.20/30     10.0.1.26                2    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 *>  10.0.1.24/30     10.0.1.22                2         32768 ?
 * i                  10.0.1.10                0    100      0 ?
 * i 172.16.0.0       10.0.1.18                2    100      0 ?
 *>                   10.0.1.14                2         32768 ?
 *>  192.168.1.1/32   0.0.0.0                  0         32768 ?
     Network          Next Hop            Metric LocPrf Weight Path
 * i 192.168.1.2/32   10.0.1.10                0    100      0 ?
*>                   10.0.1.10                2         32768 ?
 * i 192.168.1.4/32   10.0.1.18                2    100      0 ?
 *>                   10.0.1.14                2         32768 ?
 * i 192.168.1.5/32   10.0.1.26                2    100      0 ?
 *>                   10.0.1.22                2         32768 ?

  Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.1.1     192.168.1.1     736         0x8000002D 0x002ACB 4
192.168.1.2     192.168.1.2     923         0x8000002D 0x0038A9 4
192.168.1.4     192.168.1.4     1263        0x8000002B 0x006002 4
192.168.1.5     192.168.1.5     912         0x8000002B 0x0021EB 3

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.10       192.168.1.2     923         0x80000029 0x001F9C
10.0.1.14       192.168.1.4     1263        0x80000029 0x00FEB4
10.0.1.18       192.168.1.4     1263        0x80000029 0x00E4C9
10.0.1.22       192.168.1.5     912         0x80000029 0x00B2F6
10.0.1.26       192.168.1.5     912         0x80000029 0x00980C

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         192.168.1.2     178         0x80000001 0x00CD0B 110

R3 BGP / OSPF

代码语言:javascript
复制
BGP table version is 17, local router ID is 192.168.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
              x best-external, a additional-path, c RIB-compressed, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 0.0.0.0          10.0.1.5                      100      0 i
 * i 10.0.1.8/30      10.0.1.9                 0    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 *>  10.0.1.12/30     10.0.1.18                2         32768 ?
 * i                  10.0.1.9                 0    100      0 ?
 * i 10.0.1.16/30     10.0.1.14                2    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 *>  10.0.1.20/30     10.0.1.26                2         32768 ?
 * i                  10.0.1.9                 0    100      0 ?
 * i 10.0.1.24/30     10.0.1.22                2    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 * i 172.16.0.0       10.0.1.14                2    100      0 ?
 *>                   10.0.1.18                2         32768 ?
 * i 192.168.1.1/32   10.0.1.9                 0    100      0 ?
     Network          Next Hop            Metric LocPrf Weight Path
 *>                   10.0.1.9                 2         32768 ?
 * i 192.168.1.2/32   10.0.1.9                 2    100      0 ?
 *>                   0.0.0.0                  0         32768 ?
 * i 192.168.1.4/32   10.0.1.14                2    100      0 ?
 *>                   10.0.1.18                2         32768 ?
 * i 192.168.1.5/32   10.0.1.22                2    100      0 ?
 *>                   10.0.1.26                2         32768 ?

OSPF Router with ID (192.168.1.2) (Process ID 110)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
192.168.1.1     192.168.1.1     944         0x8000002D 0x002ACB 4
192.168.1.2     192.168.1.2     1129        0x8000002D 0x0038A9 4
192.168.1.4     192.168.1.4     1470        0x8000002B 0x006002 4
192.168.1.5     192.168.1.5     1119        0x8000002B 0x0021EB 3

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.10       192.168.1.2     1129        0x80000029 0x001F9C
10.0.1.14       192.168.1.4     1470        0x80000029 0x00FEB4
10.0.1.18       192.168.1.4     1470        0x80000029 0x00E4C9
10.0.1.22       192.168.1.5     1119        0x80000029 0x00B2F6
10.0.1.26       192.168.1.5     1119        0x80000029 0x00980C

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
0.0.0.0         192.168.1.2     384         0x80000001 0x00CD0B 110
EN

回答 1

Server Fault用户

发布于 2018-09-20 09:06:25

似乎第一个将默认路由从R2 /R3重新分发到OSPF的路由器(在iBGP /R3之外)将是OSPF放入数据库的唯一默认路由。我注意到,任何第二个尝试将默认路由重新分发到OSPF的路由器都会遇到BGP肋骨故障,因为来自另一个路由器的默认路由已经被OSPF安装到肋骨中,并指向另一个路由器。我已经读过,如果路由不在路由表中,来自BGP的路由将不会被重新分配到另一个协议中。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/931636

复制
相关文章

相似问题

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