0

enter image description here

Background: BGP is fully functional and works as expected so nothing need to worry about, the problem is the route injection between HK_Office <> HK2 and LON1 <> LON_Office, as you could see on "show ip route" section below in HK_Office and LON_Office, it can't see routes in-between, for example in HK_Office, it doesn't contain routes to either 10.10.20.0/24 or 192.168.20.0/24...vice versa, how exactly should I correctly inject those subnets in HK_Office and LON_Office properly so both ends could see each other subnets?

Remark: This is actually running inside my lab, as we have to test it before live; I am taking shortcuts to use loopback interface IP to mimick the subnet that supposed to inject into OSPF/BGP in the future, loopback interface shall not be used in the production environment. We are using BGP in-between because of traffic engineering, please don't try to propose something else as it's not within my control.

========================

Config section,

HK_Office:

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

HK2:

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_Office:

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

========================

"show ip route" section,

HK_Office:

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

HK2:

     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_Office:

     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

==================================================

Update: After I did some config change on LON1 and HK2 router, finally both offices could see the routes from "show ip route", BUT! routing still has an issue, let's see below...

HK_Office "show ip route":

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 "show ip route":

     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 traceroute to HK_Office:

  1 172.16.20.2 8 msec 12 msec 8 msec
  2  *  *  * 
  3  *  *  * 

HK_Office traceroute to LON_Office:

  1 172.16.0.2 8 msec 8 msec 12 msec
  2  *  *  * 
  3  *  *  * 

LON1 config:

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 config:

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

==================================================

Update: I got it working, please check my answer

4
  • A couple of things: 1. Please include your route-maps in your question. 2. On the loopback interfaces, set ip ospf network broadcast.
    – Ron Trunk
    Apr 7 at 12:21
  • You do not redistribute an OSPF process back into itself. Remove the OSPF redistribute command from the OSPF process. Neither are you redistributing BGP into OSPF, so OSPF will not advertise the routes from BGP to a neighbor OSPF router.
    – Ron Maupin
    Apr 7 at 15:54
  • 1
    Also, for BGP, you should use the no auto-summary command, and put the mask on the network statement.
    – Ron Maupin
    Apr 7 at 15:57
  • @RonMaupin sorry which line precisely should I remove from which device? I am a bit confused. Apr 8 at 0:21
1

Add

no auto-summary

to your BGP configurations

3
  • sorry it still not work, is there something else I need to include? Also, for the "ip ospf broadcast" command for the loopback interface, I got the "OSPF: Invalid type for interface" message Apr 8 at 0:20
  • Add the command to ospf as well
    – Ron Trunk
    Apr 8 at 2:51
  • Sorry I am still confused, what are you suggesting? Apr 8 at 2:55
1

I got it all working now, here is the config:

HK_Office:

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
 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
!
ip forward-protocol nd

HK2:

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 bgp 64512 subnets
 passive-interface default
 no passive-interface FastEthernet1/0
 network 172.16.0.0 0.0.0.255 area 0
!
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
!         
ip forward-protocol nd
!
ip prefix-list PREFIX-TO-HK-GENERAL-NETWORK seq 5 permit 192.168.10.1/32
ip prefix-list PREFIX-TO-HK-GENERAL-NETWORK seq 15 permit 172.16.0.0/24
!
ip prefix-list PREFIX-TO-HK-VIP-NETWORK seq 5 permit 10.10.0.1/32
ip prefix-list PREFIX-TO-HK-VIP-NETWORK seq 15 permit 172.16.0.0/24
!
route-map General_NET permit 10
 match ip address prefix-list PREFIX-TO-HK-VIP-NETWORK
 set local-preference 50
!
route-map General_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 bgp 64512 subnets
 passive-interface default
 no passive-interface FastEthernet1/0
 network 172.16.20.0 0.0.0.255 area 0
!
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
!         
ip forward-protocol nd
!
ip prefix-list PREFIX-TO-LON-OFFICE-GENERAL-NETWORK seq 5 permit 192.168.20.1/32
ip prefix-list PREFIX-TO-LON-OFFICE-GENERAL-NETWORK seq 15 permit 172.16.20.0/24
!
ip prefix-list PREFIX-TO-LON-OFFICE-VIP-NETWORK seq 5 permit 10.10.20.1/32
ip prefix-list PREFIX-TO-LON-OFFICE-VIP-NETWORK seq 15 permit 172.16.20.0/24
no cdp log mismatch duplex
!
route-map General_NET permit 10
 match ip address prefix-list PREFIX-TO-LON-OFFICE-VIP-NETWORK
 set local-preference 50
!
route-map General_NET 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_Office:

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
 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 forward-protocol nd

Test Objective: testing link failover

Remark: BGP has a slow converging time, it will take a few minutes to pick up the change, BFD can be used to improve link fail detection but it's outside of this scope

All traceroute below are ran from HK_Office router, it should work similarly from LON_Office too

Before link shut:

Type escape sequence to abort.
Tracing the route to 10.10.20.1

1 172.16.0.2 24 msec 16 msec 12 msec
2 10.0.0.2 16 msec 24 msec 16 msec
3 172.16.20.1 24 msec 36 msec 24 msec

Type escape sequence to abort.
Tracing the route to 192.168.20.1

1 172.16.0.2 28 msec 20 msec 20 msec
2 192.168.0.2 28 msec 44 msec 48 msec
3 172.16.20.1 64 msec 44 msec 56 msec

--------------------------------------------------------------

After link shut:

Tracing the route to 10.10.20.1

1 172.16.0.2 8 msec 20 msec 16 msec
2 192.168.0.2 40 msec 40 msec 40 msec
3 172.16.20.1 20 msec 40 msec 20 msec

Type escape sequence to abort.
Tracing the route to 192.168.20.1

1 172.16.0.2 28 msec 8 msec 8 msec
2 192.168.0.2 24 msec 36 msec 20 msec
3 172.16.20.1 40 msec 36 msec 40 msec

--------------------------------------------------------------

no shut the link again:

Type escape sequence to abort.
Tracing the route to 10.10.20.1

1 172.16.0.2 40 msec 20 msec 8 msec
2 10.0.0.2 16 msec 28 msec 16 msec
3 172.16.20.1 44 msec 36 msec 56 msec


Type escape sequence to abort.
Tracing the route to 192.168.20.1

1 172.16.0.2 36 msec 8 msec 12 msec
2 192.168.0.2 16 msec 20 msec 16 msec
3 172.16.20.1 20 msec 44 msec 40 msec
0

You could try creating route maps to redistribute BGP to OSPF it also gives you more control over what is redistributed. The config below is from an Arista but you should be able to map it to a cisco. Ill try and spin this up in a lab as well and see what i can find.

HK2 Example

route-map bgp_to_ospf permit 10

match ip address access-list bgp_to_ospf

-

ip access-list standard bgp_to_ospf

permit 172.16.20.0 0.0.0.255

permit 192.168.20.0 0.0.0.255

-

router ospf 10

redistribute bgp route-map bgp_to_ospf

2
  • The last line "redistribute bgp route-map bgp_to_ospf" I got "% Only classful networks will be redistributed" Apr 8 at 0:22
  • "ip ospf network broadcast" failed: ip ospf network broadcast Apr 8 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.