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

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

基础网络

我通过 iBGP 从 R1 收到一条默认路由。在 R2 和 R3 上,我都配置了默认信息来源。在 R4 上,我只在 OSPF 数据库中看到一条默认路由;要么到 R2,要么到 R3。当我关闭从 R2/R3 到 R1 的一条链路时,我看到 OSPF 数据库中出现了另一条默认路由。

我的实际拓扑稍微复杂一些,那么是否有可能在 R4 上出现两个默认路由,而无需始终产生默认信息?我希望在 R2/R3 上通告的默认路由依赖于 RIB 中存在的 R1 默认路由。

谢谢

编辑:添加配置和输出

R1

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

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

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

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

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-输出

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——输出

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

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

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

答案1

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

相关内容