首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何与OSPF一起实现默认路由?

如何与OSPF一起实现默认路由?
EN

Network Engineering用户
提问于 2017-08-01 14:02:18
回答 2查看 410关注 0票数 1

我读了一些思科的东西。上面写着OSPF和默认路线,背叛网关,不是好朋友.

请参阅我的架构如下:

在这张图中,我希望PC1能够到达PC2.

为了到达任何黑色区域,我告诉R1通过C离开。

如何使A和F在没有大量静态路由的情况下进行通信?也就是说,我不想把OSFP路由浪费在中间。

例如,我现在所做的就是:

  • 要达到C,R3必须由R2的S黑色接口连接。

如果我想要PC1 (A)和PC 2 (F)通信,我会被迫使用静态路由吗?这意味着我必须静态配置所有中间路线..。因此,除了中间路由器之外,OSPF还可以使用。

更新

在下面的答案中与Ron Maupin交谈之后,我们决定更新这个问题。请点击下面的链接查看网络的完整(真实的)图表:

以下是我们的心声:

R1

代码语言:javascript
复制
hostname R1
!
no ip cef
no ipv6 cef
!
license udi pid CISCO1941/K9 sn FTX15242RKT
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 192.168.14.2 255.255.255.0
 ip ospf authentication message-digest
 ip ospf authentication-key agitel
 ip ospf message-digest-key 1 md5 agitel
 clock rate 2000000
!
interface Serial0/0/1
 ip address 192.168.15.2 255.255.255.248
 ip ospf authentication message-digest
 ip ospf authentication-key agitel
 ip ospf message-digest-key 1 md5 agitel
 clock rate 2000000
!
interface Serial0/1/0
 ip address 192.168.1.129 255.255.255.192
 clock rate 2000000
!
interface Serial0/1/1
 ip address 192.168.12.2 255.255.255.248
 ip ospf authentication message-digest
 ip ospf authentication-key agitel
 ip ospf message-digest-key 1 md5 agitel
 clock rate 2000000
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 100
 log-adjacency-changes
 area 100 authentication message-digest
 redistribute static subnets 
 network 192.168.12.0 0.0.0.7 area 100
 network 192.168.15.0 0.0.0.7 area 100
 network 192.168.14.0 0.0.0.255 area 100
 network 192.168.1.128 0.0.0.63 area 100
!
ip classless
ip route 10.10.10.0 255.255.255.0 192.168.1.130 
ip route 10.100.100.0 255.255.255.0 192.168.1.130 
!
ip flow-export version 9
!
!
!
no cdp run
!

line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

R2

代码语言:javascript
复制
hostname R2
!
!
no ip cef
no ipv6 cef
!
license udi pid CISCO1941/K9 sn FTX1524PDUV
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 192.168.2.129 255.255.255.192
 clock rate 2000000
!
interface Serial0/0/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Serial0/1/0
 ip address 192.168.12.1 255.255.255.248
 ip ospf authentication message-digest
 ip ospf authentication-key agitel
 ip ospf message-digest-key 1 md5 agitel
!
interface Serial0/1/1
 ip address 192.168.23.1 255.255.255.0
 ip ospf authentication message-digest
 ip ospf authentication-key agitel
 ip ospf message-digest-key 1 md5 agitel
 clock rate 2000000
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 100
 log-adjacency-changes
 area 100 authentication message-digest
 redistribute static subnets 
 network 192.168.23.0 0.0.0.255 area 100
 network 192.168.12.0 0.0.0.7 area 100
 network 192.168.2.128 0.0.0.63 area 100
!
router rip
!
ip classless
ip route 172.23.1.0 255.255.255.0 192.168.2.130 
!
ip flow-export version 9
!
no cdp run

!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

R3

代码语言:javascript
复制
hostname R3
!
no ip cef
no ipv6 cef
!
!
license udi pid CISCO1941/K9 sn FTX1524LCOJ
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 192.168.34.1 255.255.255.0
 ip ospf authentication message-digest
 ip ospf authentication-key agitel
 ip ospf message-digest-key 1 md5 agitel
!
interface Serial0/0/1
 ip address 192.168.3.129 255.255.255.192
 clock rate 2000000
!
interface Serial0/1/0
 ip address 192.168.23.2 255.255.255.0
 ip ospf authentication message-digest
 ip ospf authentication-key agitel
 ip ospf message-digest-key 1 md5 agitel
!
interface Serial0/1/1
 ip address 192.168.14.1 255.255.255.0
 ip ospf authentication message-digest
 ip ospf authentication-key agitel
 ip ospf message-digest-key 1 md5 agitel
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 100
 log-adjacency-changes
 area 100 authentication message-digest
 redistribute static subnets 
 network 192.168.23.0 0.0.0.255 area 100
 network 192.168.34.0 0.0.0.255 area 100
 network 192.168.14.0 0.0.0.255 area 100
 network 192.168.3.128 0.0.0.63 area 100
!
router rip
!
ip classless
ip route 172.21.1.0 255.255.255.0 192.168.3.130 
!
ip flow-export version 9
!
!
!
no cdp run
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

R4

代码语言:javascript
复制
hostname R4
!
no ip cef
no ipv6 cef
!
!
license udi pid CISCO1941/K9 sn FTX1524G5F7
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 192.168.4.129 255.255.255.192
 clock rate 2000000
!
interface Serial0/0/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Serial0/1/0
 ip address 192.168.15.1 255.255.255.248
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 agitel
!
interface Serial0/1/1
 ip address 192.168.34.2 255.255.255.0
 ip ospf authentication message-digest
 ip ospf authentication-key agitel
 ip ospf message-digest-key 1 md5 agitel
 clock rate 2000000
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 100
 log-adjacency-changes
 area 100 authentication message-digest
 redistribute static subnets 
 network 192.168.34.0 0.0.0.255 area 100
 network 192.168.15.0 0.0.0.7 area 100
 network 192.168.4.128 0.0.0.63 area 100
!
ip classless
ip route 172.18.1.0 255.255.255.0 192.168.4.130 
!
ip flow-export version 9
!
no cdp run
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

攻城

代码语言:javascript
复制
hostname SIEGE
!
no ip cef
no ipv6 cef
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.2
 encapsulation dot1Q 99
 ip address 10.10.10.3 255.255.255.0
!
interface FastEthernet0/0.3
 encapsulation dot1Q 100
 ip address 10.100.100.3 255.255.255.0
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0
 ip address 192.168.1.130 255.255.255.192
!
interface Serial0/1
 no ip address
 clock rate 2000000
 shutdown
!
ip classless
ip route 192.168.12.0 255.255.255.248 192.168.1.129 
ip route 192.168.15.0 255.255.255.248 192.168.1.129 
ip route 192.168.14.0 255.255.255.0 192.168.1.129 
ip route 192.168.23.0 255.255.255.0 192.168.1.129 
ip route 192.168.34.0 255.255.255.0 192.168.1.129 
ip route 192.168.2.128 255.255.255.192 192.168.1.129 
ip route 192.168.3.128 255.255.255.192 192.168.1.129 
ip route 192.168.4.128 255.255.255.192 192.168.1.129 
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

α

代码语言:javascript
复制
hostname ALPHA
!
no ip cef
no ipv6 cef
!
license udi pid CISCO1941/K9 sn FTX15242012
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
 ip address 172.21.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/1/0
 ip address 192.168.3.130 255.255.255.192
!
interface Serial0/1/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 192.168.23.0 255.255.255.0 192.168.3.129 
ip route 192.168.2.128 255.255.255.192 192.168.3.129 
ip route 192.168.12.0 255.255.255.248 192.168.3.129 
ip route 192.168.1.128 255.255.255.192 192.168.3.129 
ip route 192.168.14.0 255.255.255.0 192.168.3.129 
ip route 192.168.34.0 255.255.255.0 192.168.3.129 
ip route 192.168.15.0 255.255.255.248 192.168.3.129 
ip route 192.168.4.128 255.255.255.192 192.168.3.129 
!
ip flow-export version 9
!
no cdp run
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

β

代码语言:javascript
复制
hostname BETA
!
no ip cef
no ipv6 cef
!
license udi pid CISCO1941/K9 sn FTX1524U7E9
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
 ip address 172.18.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/1/0
 ip address 192.168.4.130 255.255.255.192
!
interface Serial0/1/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
ip route 192.168.34.0 255.255.255.0 192.168.4.129 
ip route 192.168.23.0 255.255.255.0 192.168.4.129 
ip route 192.168.14.0 255.255.255.0 192.168.4.129 
ip route 192.168.2.128 255.255.255.192 192.168.4.129 
ip route 192.168.3.128 255.255.255.192 192.168.4.129 
ip route 192.168.1.128 255.255.255.192 192.168.4.129 
ip route 192.168.12.0 255.255.255.248 192.168.4.129 
ip route 192.168.15.0 255.255.255.248 192.168.4.129 
!
ip flow-export version 9
!
no cdp run
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

TT

代码语言:javascript
复制
hostname TT
!
no ip cef
no ipv6 cef
!
license udi pid CISCO1941/K9 sn FTX152423MK
!
spanning-tree mode pvst
!
interface GigabitEthernet0/0
 ip address 172.23.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/1/0
 ip address 192.168.2.130 255.255.255.192
!
interface Serial0/1/1
 no ip address
 clock rate 2000000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router rip
 network 192.168.23.0
!
ip classless
ip route 192.168.12.0 255.255.255.248 192.168.2.129 
ip route 192.168.1.128 255.255.255.192 192.168.2.129 
ip route 192.168.23.0 255.255.255.0 192.168.2.129 
ip route 192.168.14.0 255.255.255.0 192.168.2.129 
ip route 192.168.34.0 255.255.255.0 192.168.2.129 
ip route 192.168.15.0 255.255.255.248 192.168.2.129 
ip route 192.168.3.128 255.255.255.192 192.168.2.129 
ip route 192.168.4.128 255.255.255.192 192.168.2.129 
!
ip flow-export version 9
!
no cdp run
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

更新2:路由表

R1 ip路由

代码语言:javascript
复制
Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
S       10.10.10.0/24 [1/0] via 192.168.1.130
S       10.100.100.0/24 [1/0] via 192.168.1.130
     172.18.0.0/24 is subnetted, 1 subnets
O E2    172.18.1.0/24 [110/20] via 192.168.15.1, 01:22:45, Serial0/0/1
     172.21.0.0/24 is subnetted, 1 subnets
O E2    172.21.1.0/24 [110/20] via 192.168.14.1, 01:09:31, Serial0/0/0
     172.23.0.0/24 is subnetted, 1 subnets
O E2    172.23.1.0/24 [110/20] via 192.168.12.1, 01:21:42, Serial0/1/1
     192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.1.128/26 is directly connected, Serial0/1/0
L       192.168.1.129/32 is directly connected, Serial0/1/0
     192.168.2.0/26 is subnetted, 1 subnets
O       192.168.2.128/26 [110/128] via 192.168.12.1, 01:32:41, Serial0/1/1
     192.168.3.0/26 is subnetted, 1 subnets
O       192.168.3.128/26 [110/128] via 192.168.14.1, 01:32:51, Serial0/0/0
     192.168.4.0/26 is subnetted, 1 subnets
O       192.168.4.128/26 [110/128] via 192.168.15.1, 01:32:51, Serial0/0/1
     192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.12.0/29 is directly connected, Serial0/1/1
L       192.168.12.2/32 is directly connected, Serial0/1/1
     192.168.14.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.14.0/24 is directly connected, Serial0/0/0
L       192.168.14.2/32 is directly connected, Serial0/0/0
     192.168.15.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.15.0/29 is directly connected, Serial0/0/1
L       192.168.15.2/32 is directly connected, Serial0/0/1
O    192.168.23.0/24 [110/128] via 192.168.12.1, 01:32:41, Serial0/1/1
                     [110/128] via 192.168.14.1, 01:32:41, Serial0/0/0
O    192.168.34.0/24 [110/128] via 192.168.14.1, 01:32:51, Serial0/0/0
                     [110/128] via 192.168.15.1, 01:32:51, Serial0/0/1
end

R2 ip路由

代码语言:javascript
复制
Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
O E2    10.10.10.0/24 [110/20] via 192.168.12.2, 01:10:19, Serial0/1/0
O E2    10.100.100.0/24 [110/20] via 192.168.12.2, 01:10:09, Serial0/1/0
     172.18.0.0/24 is subnetted, 1 subnets
O E2    172.18.1.0/24 [110/20] via 192.168.23.2, 01:24:41, Serial0/1/1
                      [110/20] via 192.168.12.2, 01:24:41, Serial0/1/0
     172.21.0.0/24 is subnetted, 1 subnets
O E2    172.21.1.0/24 [110/20] via 192.168.23.2, 01:11:27, Serial0/1/1
     172.23.0.0/24 is subnetted, 1 subnets
S       172.23.1.0/24 [1/0] via 192.168.2.130
     192.168.1.0/26 is subnetted, 1 subnets
O       192.168.1.128/26 [110/128] via 192.168.12.2, 01:34:42, Serial0/1/0
     192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.2.128/26 is directly connected, Serial0/0/0
L       192.168.2.129/32 is directly connected, Serial0/0/0
     192.168.3.0/26 is subnetted, 1 subnets
O       192.168.3.128/26 [110/128] via 192.168.23.2, 01:34:32, Serial0/1/1
     192.168.4.0/26 is subnetted, 1 subnets
O       192.168.4.128/26 [110/192] via 192.168.23.2, 01:34:32, Serial0/1/1
                         [110/192] via 192.168.12.2, 01:34:32, Serial0/1/0
     192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.12.0/29 is directly connected, Serial0/1/0
L       192.168.12.1/32 is directly connected, Serial0/1/0
O    192.168.14.0/24 [110/128] via 192.168.23.2, 01:34:32, Serial0/1/1
                     [110/128] via 192.168.12.2, 01:34:32, Serial0/1/0
     192.168.15.0/29 is subnetted, 1 subnets
O       192.168.15.0/29 [110/128] via 192.168.12.2, 01:34:42, Serial0/1/0
     192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.23.0/24 is directly connected, Serial0/1/1
L       192.168.23.1/32 is directly connected, Serial0/1/1
O    192.168.34.0/24 [110/128] via 192.168.23.2, 01:34:32, Serial0/1/1

R3 ip路由

代码语言:javascript
复制
Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
O E2    10.10.10.0/24 [110/20] via 192.168.14.2, 01:10:58, Serial0/1/1
O E2    10.100.100.0/24 [110/20] via 192.168.14.2, 01:10:48, Serial0/1/1
     172.18.0.0/24 is subnetted, 1 subnets
O E2    172.18.1.0/24 [110/20] via 192.168.34.2, 01:25:20, Serial0/0/0
     172.21.0.0/24 is subnetted, 1 subnets
S       172.21.1.0/24 [1/0] via 192.168.3.130
     172.23.0.0/24 is subnetted, 1 subnets
O E2    172.23.1.0/24 [110/20] via 192.168.23.1, 01:24:17, Serial0/1/0
     192.168.1.0/26 is subnetted, 1 subnets
O       192.168.1.128/26 [110/128] via 192.168.14.2, 01:35:21, Serial0/1/1
     192.168.2.0/26 is subnetted, 1 subnets
O       192.168.2.128/26 [110/128] via 192.168.23.1, 01:35:21, Serial0/1/0
     192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.3.128/26 is directly connected, Serial0/0/1
L       192.168.3.129/32 is directly connected, Serial0/0/1
     192.168.4.0/26 is subnetted, 1 subnets
O       192.168.4.128/26 [110/128] via 192.168.34.2, 01:35:11, Serial0/0/0
     192.168.12.0/29 is subnetted, 1 subnets
O       192.168.12.0/29 [110/128] via 192.168.23.1, 01:35:21, Serial0/1/0
                        [110/128] via 192.168.14.2, 01:35:21, Serial0/1/1
     192.168.14.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.14.0/24 is directly connected, Serial0/1/1
L       192.168.14.1/32 is directly connected, Serial0/1/1
     192.168.15.0/29 is subnetted, 1 subnets
O       192.168.15.0/29 [110/128] via 192.168.34.2, 01:35:11, Serial0/0/0
                        [110/128] via 192.168.14.2, 01:35:11, Serial0/1/1
     192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.23.0/24 is directly connected, Serial0/1/0
L       192.168.23.2/32 is directly connected, Serial0/1/0
     192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.34.0/24 is directly connected, Serial0/0/0
L       192.168.34.1/32 is directly connected, Serial0/0/0

R4 ip路由

代码语言:javascript
复制
Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
O E2    10.10.10.0/24 [110/20] via 192.168.15.2, 01:11:34, Serial0/1/0
O E2    10.100.100.0/24 [110/20] via 192.168.15.2, 01:11:24, Serial0/1/0
     172.18.0.0/24 is subnetted, 1 subnets
S       172.18.1.0/24 [1/0] via 192.168.4.130
     172.21.0.0/24 is subnetted, 1 subnets
O E2    172.21.1.0/24 [110/20] via 192.168.34.1, 01:12:43, Serial0/1/1
     172.23.0.0/24 is subnetted, 1 subnets
O E2    172.23.1.0/24 [110/20] via 192.168.34.1, 01:24:53, Serial0/1/1
                      [110/20] via 192.168.15.2, 01:24:53, Serial0/1/0
     192.168.1.0/26 is subnetted, 1 subnets
O       192.168.1.128/26 [110/128] via 192.168.15.2, 01:36:02, Serial0/1/0
     192.168.2.0/26 is subnetted, 1 subnets
O       192.168.2.128/26 [110/192] via 192.168.34.1, 01:36:02, Serial0/1/1
                         [110/192] via 192.168.15.2, 01:36:02, Serial0/1/0
     192.168.3.0/26 is subnetted, 1 subnets
O       192.168.3.128/26 [110/128] via 192.168.34.1, 01:36:02, Serial0/1/1
     192.168.4.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.4.128/26 is directly connected, Serial0/0/0
L       192.168.4.129/32 is directly connected, Serial0/0/0
     192.168.12.0/29 is subnetted, 1 subnets
O       192.168.12.0/29 [110/128] via 192.168.15.2, 01:36:02, Serial0/1/0
O    192.168.14.0/24 [110/128] via 192.168.34.1, 01:36:02, Serial0/1/1
                     [110/128] via 192.168.15.2, 01:36:02, Serial0/1/0
     192.168.15.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.15.0/29 is directly connected, Serial0/1/0
L       192.168.15.1/32 is directly connected, Serial0/1/0
O    192.168.23.0/24 [110/128] via 192.168.34.1, 01:36:02, Serial0/1/1
     192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.34.0/24 is directly connected, Serial0/1/1
L       192.168.34.2/32 is directly connected, Serial0/1/1

围城ip路由

代码语言:javascript
复制
Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
O E2    10.10.10.0/24 [110/20] via 192.168.15.2, 01:11:34, Serial0/1/0
O E2    10.100.100.0/24 [110/20] via 192.168.15.2, 01:11:24, Serial0/1/0
     172.18.0.0/24 is subnetted, 1 subnets
S       172.18.1.0/24 [1/0] via 192.168.4.130
     172.21.0.0/24 is subnetted, 1 subnets
O E2    172.21.1.0/24 [110/20] via 192.168.34.1, 01:12:43, Serial0/1/1
     172.23.0.0/24 is subnetted, 1 subnets
O E2    172.23.1.0/24 [110/20] via 192.168.34.1, 01:24:53, Serial0/1/1
                      [110/20] via 192.168.15.2, 01:24:53, Serial0/1/0
     192.168.1.0/26 is subnetted, 1 subnets
O       192.168.1.128/26 [110/128] via 192.168.15.2, 01:36:02, Serial0/1/0
     192.168.2.0/26 is subnetted, 1 subnets
O       192.168.2.128/26 [110/192] via 192.168.34.1, 01:36:02, Serial0/1/1
                         [110/192] via 192.168.15.2, 01:36:02, Serial0/1/0
     192.168.3.0/26 is subnetted, 1 subnets
O       192.168.3.128/26 [110/128] via 192.168.34.1, 01:36:02, Serial0/1/1
     192.168.4.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.4.128/26 is directly connected, Serial0/0/0
L       192.168.4.129/32 is directly connected, Serial0/0/0
     192.168.12.0/29 is subnetted, 1 subnets
O       192.168.12.0/29 [110/128] via 192.168.15.2, 01:36:02, Serial0/1/0
O    192.168.14.0/24 [110/128] via 192.168.34.1, 01:36:02, Serial0/1/1
                     [110/128] via 192.168.15.2, 01:36:02, Serial0/1/0
     192.168.15.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.15.0/29 is directly connected, Serial0/1/0
L       192.168.15.1/32 is directly connected, Serial0/1/0
O    192.168.23.0/24 [110/128] via 192.168.34.1, 01:36:02, Serial0/1/1
     192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.34.0/24 is directly connected, Serial0/1/1
L       192.168.34.2/32 is directly connected, Serial0/1/1

阿尔法ip路由

代码语言:javascript
复制
Gateway of last resort is not set

     172.21.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       172.21.1.0/24 is directly connected, GigabitEthernet0/0
L       172.21.1.1/32 is directly connected, GigabitEthernet0/0
     192.168.1.0/26 is subnetted, 1 subnets
S       192.168.1.128/26 [1/0] via 192.168.3.129
     192.168.2.0/26 is subnetted, 1 subnets
S       192.168.2.128/26 [1/0] via 192.168.3.129
     192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.3.128/26 is directly connected, Serial0/1/0
L       192.168.3.130/32 is directly connected, Serial0/1/0
     192.168.4.0/26 is subnetted, 1 subnets
S       192.168.4.128/26 [1/0] via 192.168.3.129
     192.168.12.0/29 is subnetted, 1 subnets
S       192.168.12.0/29 [1/0] via 192.168.3.129
S    192.168.14.0/24 [1/0] via 192.168.3.129
     192.168.15.0/29 is subnetted, 1 subnets
S       192.168.15.0/29 [1/0] via 192.168.3.129
S    192.168.23.0/24 [1/0] via 192.168.3.129
S    192.168.34.0/24 [1/0] via 192.168.3.129

βip路由

代码语言:javascript
复制
Gateway of last resort is not set

     172.18.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       172.18.1.0/24 is directly connected, GigabitEthernet0/0
L       172.18.1.1/32 is directly connected, GigabitEthernet0/0
     192.168.1.0/26 is subnetted, 1 subnets
S       192.168.1.128/26 [1/0] via 192.168.4.129
     192.168.2.0/26 is subnetted, 1 subnets
S       192.168.2.128/26 [1/0] via 192.168.4.129
     192.168.3.0/26 is subnetted, 1 subnets
S       192.168.3.128/26 [1/0] via 192.168.4.129
     192.168.4.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.4.128/26 is directly connected, Serial0/1/0
L       192.168.4.130/32 is directly connected, Serial0/1/0
     192.168.12.0/29 is subnetted, 1 subnets
S       192.168.12.0/29 [1/0] via 192.168.4.129
S    192.168.14.0/24 [1/0] via 192.168.4.129
     192.168.15.0/29 is subnetted, 1 subnets
S       192.168.15.0/29 [1/0] via 192.168.4.129
S    192.168.23.0/24 [1/0] via 192.168.4.129
S    192.168.34.0/24 [1/0] via 192.168.4.129

TT ip路由

代码语言:javascript
复制
Gateway of last resort is not set

     172.23.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       172.23.1.0/24 is directly connected, GigabitEthernet0/0
L       172.23.1.1/32 is directly connected, GigabitEthernet0/0
     192.168.1.0/26 is subnetted, 1 subnets
S       192.168.1.128/26 [1/0] via 192.168.2.129
     192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.2.128/26 is directly connected, Serial0/1/0
L       192.168.2.130/32 is directly connected, Serial0/1/0
     192.168.3.0/26 is subnetted, 1 subnets
S       192.168.3.128/26 [1/0] via 192.168.2.129
     192.168.4.0/26 is subnetted, 1 subnets
S       192.168.4.128/26 [1/0] via 192.168.2.129
     192.168.12.0/29 is subnetted, 1 subnets
S       192.168.12.0/29 [1/0] via 192.168.2.129
S    192.168.14.0/24 [1/0] via 192.168.2.129
     192.168.15.0/29 is subnetted, 1 subnets
S       192.168.15.0/29 [1/0] via 192.168.2.129
S    192.168.23.0/24 [1/0] via 192.168.2.129
S    192.168.34.0/24 [1/0] via 192.168.2.129
EN

回答 2

Network Engineering用户

回答已采纳

发布于 2017-08-01 14:23:08

如果在OSPF路由中包括R2 C接口和R5 D接口,则需要在R2上设置到R1 A网络的静态路由,在R5上设置到R6 F网络的静态路由,并将静态路由重新分配到OSPF。同时,可以在R1上创建指向R2的静态默认路由,在R6上创建指向R5的静态默认路由。

由于你没有包括路由器配置(当你问这样一个问题时,你真的应该这么做),我不能给你细节。

编辑:

您将无法从任何其他个人电脑到达任何个人电脑网络,因为你的路由器与个人电脑没有通往其他网络的路线。

正如我所建议的,您应该在这些路由器上使用默认路由:

TT:

代码语言:javascript
复制
no ip route 192.168.12.0 255.255.255.248 192.168.2.129 
no ip route 192.168.1.128 255.255.255.192 192.168.2.129 
no ip route 192.168.23.0 255.255.255.0 192.168.2.129 
no ip route 192.168.14.0 255.255.255.0 192.168.2.129 
no ip route 192.168.34.0 255.255.255.0 192.168.2.129 
no ip route 192.168.15.0 255.255.255.248 192.168.2.129 
no ip route 192.168.3.128 255.255.255.192 192.168.2.129 
no ip route 192.168.4.128 255.255.255.192 192.168.2.129 
ip route 0.0.0.0 0.0.0.0 192.168.2.129 
!

阿尔法:

代码语言:javascript
复制
no ip route 192.168.23.0 255.255.255.0 192.168.3.129 
no ip route 192.168.2.128 255.255.255.192 192.168.3.129 
no ip route 192.168.12.0 255.255.255.248 192.168.3.129 
no ip route 192.168.1.128 255.255.255.192 192.168.3.129 
no ip route 192.168.14.0 255.255.255.0 192.168.3.129 
no ip route 192.168.34.0 255.255.255.0 192.168.3.129 
no ip route 192.168.15.0 255.255.255.248 192.168.3.129 
no ip route 192.168.4.128 255.255.255.192 192.168.3.129 
ip route 0.0.0.0 0.0.0.0 192.168.3.129 
!

测试版:

代码语言:javascript
复制
no ip route 192.168.34.0 255.255.255.0 192.168.4.129 
no ip route 192.168.23.0 255.255.255.0 192.168.4.129 
no ip route 192.168.14.0 255.255.255.0 192.168.4.129 
no ip route 192.168.2.128 255.255.255.192 192.168.4.129 
no ip route 192.168.3.128 255.255.255.192 192.168.4.129 
no ip route 192.168.1.128 255.255.255.192 192.168.4.129 
no ip route 192.168.12.0 255.255.255.248 192.168.4.129 
no ip route 192.168.15.0 255.255.255.248 192.168.4.129 
ip route 0.0.0.0 0.0.0.0 192.168.4.129 
!
票数 0
EN

Network Engineering用户

发布于 2017-08-01 15:53:54

真正的问题是:为什么R1和R6没有在它们的接口上运行OSPF?OSPF实现具有passive-interface特性,它允许OSPF不能跨接口共享信息,同时仍然允许将该接口的子网添加到OSPF数据库中。这正是我们想要的叶子网接口,比如PC1和PC2的接口。

路由器之间的静态路由是一个糟糕的想法。与将OSPF和静态路由混合起来相比,使用OSPF的每个接口都更易于配置和操作整个网络。这是很多刚开始的网络设计者都忽略的一点,从而使他们的网络变得更加复杂,因为他们错误地认为,他们正在使网络变得更简单。

而是给出一个答案。R2具有OSPF中的B、R2-R3、R2-R4、R2-R5接口.R2's的结构看起来像router ospf 1network (subnet of B-C) area 0network (subnet of R2-R3) area 0network (subnet of R2-R4) area 0network (subnet of R2-R5) area 0。在R2上为10.0.0.0/8创建一个静态路由,下一跳是B:ip route 10.0.0.0 255.0.0.0 (address of B)的地址。然后在R2上将这个静态路由添加到OSPF中:router ospf 1redistribute static route-map A route-map A permit 10match ip address prefix-list Aip prefix-list A permit 10.0.0.0/8。该A路由地图允许网络10.0.0.0/8。

您会注意到,我们使用路径图来控制进入重新分配的每一条路径。这是因为它很容易添加静态路由,我们不希望在主OSPF路由表(例如,作为一个丢弃的目的地)。您还会注意到,我们做的前缀完全匹配,因为这是最好的行为,以防止令人讨厌的惊喜。

我们只配置静态路由,并将其重新分配到最近的OSPF路由器(S)到静态段。在这个网络中,每个静态路由精确地配置并重新分发一次(10.0.0.0/8在R2,20.0.0.0/8在R5)。一个静态路由和多个重分发的多个定义是一个常见的误解,信任OSPF来携带它所提供的路由信息。

R5类似地配置为R2。

R3和R4没有静态路径,没有再分布。你只需列出接口子网router ospf ...network ... area 0network ... area 0,.

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

https://networkengineering.stackexchange.com/questions/42932

复制
相关文章

相似问题

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