背景:BGP 功能齐全,按预期工作,因此无需担心,问题是 HK_Office <> HK2 和 LON1 <> LON_Office 之间的路由注入,正如您在下面 HK_Office 和 LON_Office 的“显示 ip route”部分中看到的那样,它看不到中间的路由,例如在 HK_Office 中,它不包含到 10.10.20.0/24 或 192.168.20.0/24 的路由......反之亦然,我应该如何正确地将这些子网注入HK_Office 和 LON_Office 是否正确,所以两端可以看到彼此的子网?
备注:这实际上是在我的实验室内运行的,因为我们必须在上线前对其进行测试;我正在采取捷径使用环回接口IP来模仿将来应该注入OSPF / BGP的子网,在生产环境中不应使用环回接口。由于流量工程,我们在中间使用 BGP,请不要尝试提出其他建议,因为它不在我的控制范围内。
=========================
配置部分,
HK_办公室:
interface Loopback0
ip address 10.10.0.1 255.255.255.0
interface Loopback1
ip address 192.168.10.1 255.255.255.0
interface FastEthernet1/0
ip address 172.16.0.1 255.255.255.0
duplex auto
speed auto
router ospf 10
log-adjacency-changes
redistribute connected
passive-interface default
no passive-interface FastEthernet1/0
network 10.10.0.0 0.0.0.255 area 0
network 172.16.0.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0
香港2:
interface FastEthernet0/0
description VIP Network
ip address 10.0.0.1 255.255.255.0
duplex auto
speed auto
interface FastEthernet0/1
description General network
ip address 192.168.0.1 255.255.255.0
duplex auto
speed auto
interface FastEthernet1/0
ip address 172.16.0.2 255.255.255.0
duplex auto
speed auto
router ospf 10
log-adjacency-changes
redistribute connected subnets
redistribute bgp 64512 metric-type 1 subnets
passive-interface default
no passive-interface FastEthernet1/0
network 172.16.0.0 0.0.0.255 area 0
redistribute ospf 10
router bgp 64512
bgp log-neighbor-changes
neighbor 10.0.0.2 remote-as 64512
neighbor 192.168.0.2 remote-as 64512
address-family ipv4
redistribute connected
redistribute ospf 10
neighbor 10.0.0.2 activate
neighbor 10.0.0.2 next-hop-self
neighbor 10.0.0.2 route-map VIP_NET out
neighbor 192.168.0.2 activate
neighbor 192.168.0.2 next-hop-self
neighbor 192.168.0.2 route-map General_NET out
no auto-summary
no synchronization
network 10.0.0.0
network 172.16.0.0
network 192.168.0.0
exit-address-family
route-map VIP_NET permit 10
match ip address prefix-list PREFIX-TO-HK-VIP-NETWORK
set local-preference 50
route-map VIP_NET permit 20
match ip address prefix-list PREFIX-TO-HK-GENERAL-NETWORK
set local-preference 5000
route-map VIP_NET permit 10
match ip address prefix-list PREFIX-TO-HK-VIP-NETWORK
set local-preference 5000
route-map VIP_NET permit 20
match ip address prefix-list PREFIX-TO-HK-GENERAL-NETWORK
set local-preference 50
LON1:
interface FastEthernet0/0
description VIP Network
ip address 10.0.0.2 255.255.255.0
duplex auto
speed auto
interface FastEthernet0/1
description General network
ip address 192.168.0.2 255.255.255.0
duplex auto
speed auto
interface FastEthernet1/0
ip address 172.16.20.2 255.255.255.0
duplex auto
speed auto
router ospf 10
log-adjacency-changes
redistribute connected subnets
redistribute bgp 64512 metric-type 1 subnets
passive-interface default
no passive-interface FastEthernet1/0
network 172.16.20.0 0.0.0.255 area 0
redistribute ospf 10
router bgp 64512
bgp log-neighbor-changes
neighbor 10.0.0.1 remote-as 64512
neighbor 192.168.0.1 remote-as 64512
address-family ipv4
redistribute connected
redistribute ospf 10
neighbor 10.0.0.1 activate
neighbor 10.0.0.1 next-hop-self
neighbor 10.0.0.1 route-map VIP_NET out
neighbor 192.168.0.1 activate
neighbor 192.168.0.1 next-hop-self
neighbor 192.168.0.1 route-map General_NET out
no auto-summary
no synchronization
network 10.0.0.0
network 192.168.0.0
exit-address-family
route-map GENERALNET permit 20
match ip address prefix-list PREFIX-TO-LON-OFFICE-GENERAL-NETWORK
set local-preference 5000
!
route-map VIP_NET permit 10
match ip address prefix-list PREFIX-TO-LON-OFFICE-VIP-NETWORK
set local-preference 5000
!
route-map VIP_NET permit 20
match ip address prefix-list PREFIX-TO-LON-OFFICE-GENERAL-NETWORK
set local-preference 50
LON_办公室:
interface Loopback0
ip address 10.10.20.1 255.255.255.0
interface Loopback1
ip address 192.168.20.1 255.255.255.0
interface FastEthernet1/0
ip address 172.16.20.1 255.255.255.0
duplex auto
speed auto
router ospf 10
log-adjacency-changes
redistribute connected
passive-interface default
no passive-interface FastEthernet1/0
network 10.10.20.0 0.0.0.255 area 0
network 172.16.20.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0
=========================
“显示 IP 路由”部分,
HK_办公室:
C 192.168.10.0/24 is directly connected, Loopback1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, FastEthernet1/0
10.0.0.0/24 is subnetted, 2 subnets
C 10.10.0.0 is directly connected, Loopback0
O E2 10.0.0.0 [110/20] via 172.16.0.2, 2d00h, FastEthernet1/0
O E2 192.168.0.0/24 [110/20] via 172.16.0.2, 2d00h, FastEthernet1/0
香港2:
192.168.10.0/32 is subnetted, 1 subnets
O 192.168.10.1 [110/2] via 172.16.0.1, 2d00h, FastEthernet1/0
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, FastEthernet1/0
192.168.20.0/32 is subnetted, 1 subnets
B 192.168.20.1 [200/2] via 192.168.0.2, 00:33:23
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 10.10.0.1/32 [110/2] via 172.16.0.1, 2d00h, FastEthernet1/0
C 10.0.0.0/24 is directly connected, FastEthernet0/0
B 10.10.20.1/32 [200/2] via 10.0.0.2, 00:33:24
C 192.168.0.0/24 is directly connected, FastEthernet0/1
LON1:
192.168.10.0/32 is subnetted, 1 subnets
B 192.168.10.1 [200/2] via 192.168.0.1, 00:29:20
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.20.0 is directly connected, FastEthernet1/0
192.168.20.0/32 is subnetted, 1 subnets
O 192.168.20.1 [110/2] via 172.16.20.1, 01:28:43, FastEthernet1/0
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
B 10.10.0.1/32 [200/2] via 10.0.0.1, 00:29:20
C 10.0.0.0/24 is directly connected, FastEthernet0/0
O 10.10.20.1/32 [110/2] via 172.16.20.1, 01:28:44, FastEthernet1/0
C 192.168.0.0/24 is directly connected, FastEthernet0/1
LON_办公室:
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.20.0 is directly connected, FastEthernet1/0
C 192.168.20.0/24 is directly connected, Loopback1
10.0.0.0/24 is subnetted, 2 subnets
O E2 10.0.0.0 [110/20] via 172.16.20.2, 00:42:44, FastEthernet1/0
C 10.10.20.0 is directly connected, Loopback0
O E2 192.168.0.0/24 [110/20] via 172.16.20.2, 00:42:44, FastEthernet1/0
====================================================
更新:在我对 LON1 和 HK2 路由器进行了一些配置更改后,最后两个办公室都可以看到来自“show ip route”的路由,但是!路由仍然有问题,让我们看看下面......
HK_Office“显示IP路由”:
C 192.168.10.0/24 is directly connected, Loopback1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, FastEthernet1/0
192.168.20.0/32 is subnetted, 1 subnets
O E2 192.168.20.1 [110/1] via 172.16.0.2, 00:39:33, FastEthernet1/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.0.0/24 is directly connected, Loopback0
O E2 10.10.20.1/32 [110/1] via 172.16.0.2, 00:39:33, FastEthernet1/0
O E2 192.168.0.0/24 [110/1] via 172.16.0.2, 01:43:34, FastEthernet1/0
LON_Office “显示 ip 路由”:
192.168.10.0/32 is subnetted, 1 subnets
O E2 192.168.10.1 [110/1] via 172.16.20.2, 00:42:52, FastEthernet1/0
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.20.0 is directly connected, FastEthernet1/0
C 192.168.20.0/24 is directly connected, Loopback1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O E2 10.10.0.1/32 [110/1] via 172.16.20.2, 00:42:52, FastEthernet1/0
C 10.10.20.0/24 is directly connected, Loopback0
O E2 192.168.0.0/24 [110/1] via 172.16.20.2, 00:45:09, FastEthernet1/0
LON_Office 跟踪路由到 HK_Office:
1 172.16.20.2 8 msec 12 msec 8 msec
2 * * *
3 * * *
HK_Office 跟踪路由到 LON_Office:
1 172.16.0.2 8 msec 8 msec 12 msec
2 * * *
3 * * *
LON1 配置:
router ospf 10
log-adjacency-changes
redistribute bgp 64512 subnets
passive-interface default
no passive-interface FastEthernet1/0
network 172.16.20.0 0.0.0.255 area 0
redistribute ospf 10
router bgp 64512
bgp log-neighbor-changes
neighbor 10.0.0.1 remote-as 64512
neighbor 192.168.0.1 remote-as 64512
address-family ipv4
redistribute ospf 10
neighbor 10.0.0.1 activate
neighbor 10.0.0.1 next-hop-self
neighbor 10.0.0.1 route-map VIP_NET out
neighbor 192.168.0.1 activate
neighbor 192.168.0.1 next-hop-self
neighbor 192.168.0.1 route-map General_NET out
no auto-summary
no synchronization
bgp redistribute-internal
network 10.0.0.0
network 172.16.20.0
network 192.168.0.0
exit-address-family
HK2配置:
router ospf 10
log-adjacency-changes
redistribute bgp 64512 subnets
passive-interface default
no passive-interface FastEthernet1/0
network 172.16.0.0 0.0.0.255 area 0
redistribute ospf 10
router bgp 64512
bgp log-neighbor-changes
neighbor 10.0.0.2 remote-as 64512
neighbor 192.168.0.2 remote-as 64512
address-family ipv4
redistribute ospf 10
neighbor 10.0.0.2 activate
neighbor 10.0.0.2 next-hop-self
neighbor 10.0.0.2 route-map VIP_NET out
neighbor 192.168.0.2 activate
neighbor 192.168.0.2 next-hop-self
neighbor 192.168.0.2 route-map General_NET out
no auto-summary
no synchronization
bgp redistribute-internal
network 10.0.0.0
network 172.16.0.0
network 192.168.0.0
exit-address-family
====================================================
更新:我得到它的工作,请检查我的答案
