BGP Connection Collision Resolution & Anycast

Hi All,

I’m trying to configure any cast host routing using bgp, for distributed load-balancers that are software based on servers.
I’m running bgp on the host, peering to a single CSR acting as a top of rack.
Am using OSPF to advertise the loopback reachability to the TOR router, but I’m seeing some interesting behavior where only one tcp session is allowed between the sip and dip loopback ips between the routers and the host server. I have three servers peering theoretically :slight_smile: to the same loopback on the CSR TOR, but only one is being allowed active by BGP. The hope is to have an any cast IP and distribute the traffic via ECMP to the servers.

Thanks
-Shane

Same host config from H1, H2 and H3 have similar configs.

H1#show run | section bgp
router bgp 10
 bgp log-neighbor-changes
 neighbor 10.0.0.2 remote-as 10
 neighbor 10.0.0.2 update-source Loopback0
H1#show run | section ospf
router ospf 1
 router-id 11.11.11.11
 network 10.0.0.1 0.0.0.0 area 0
 network 192.168.1.0 0.0.0.3 area 0
interface Loopback0
 ip address 10.0.0.1 255.255.255.255
end

CSR TOR:

R3#show run | section bgp
router bgp 10
 bgp log-neighbor-changes
 neighbor 10.0.0.1 remote-as 10
 neighbor 10.0.0.1 update-source Loopback0
R3#show run | section ospf
router ospf 1
 network 10.0.0.2 0.0.0.0 area 0
 network 192.168.1.0 0.0.0.3 area 0
 network 192.168.2.0 0.0.0.3 area 0
 network 192.168.3.0 0.0.0.3 area 0
R3#show run interface lo0
Building configuration...

Current configuration : 99 bytes
!
interface Loopback0
 description loopback-host-peering
 ip address 10.0.0.2 255.255.255.255
end

Hi Shane,

Your BGP config looks ok. When you enable debug ip bgp can you find anything why your router refuses a connection?

Rene

Hi Rene,

It seems to be an issue with loopback connectivity on two of the host routers, H1 and H3 when I source the loopback during a ping to R3 lo0.
When I don’t source the loopback its fine and pings ok.
Reachablility is being distributed using OSPF for the loopbacks and they appear in the route table.

Below config from the H1-H2-H3 routers which are all using any cast IP 10.0.0.1 on their lo0 interface which is the source for BGP peering.

H1 Doesn’t ping

H1#show running-config interface lo0
Building configuration...

Current configuration : 64 bytes
!
interface Loopback0
 ip address 10.0.0.1 255.255.255.255
end

H1#show run
H1#show running-config | secti
H1#show running-config | section ospf
router ospf 1
 router-id 11.11.11.11
 network 10.0.0.1 0.0.0.0 area 0
 network 192.168.1.0 0.0.0.3 area 0
H1#show run
H1#show running-config | section bgp
router bgp 10
 bgp log-neighbor-changes
 neighbor 10.0.0.2 remote-as 10
 neighbor 10.0.0.2 update-source Loopback0
H1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      10.0.0.0/32 is subnetted, 2 subnets
    C        10.0.0.1 is directly connected, Loopback0
    O        10.0.0.2 [110/2] via 192.168.1.1, 00:10:23, GigabitEthernet1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
    C        192.168.1.0/30 is directly connected, GigabitEthernet1
    L        192.168.1.2/32 is directly connected, GigabitEthernet1
      192.168.2.0/30 is subnetted, 1 subnets
    O        192.168.2.0 [110/2] via 192.168.1.1, 00:10:23, GigabitEthernet1
      192.168.3.0/30 is subnetted, 1 subnets
    O        192.168.3.0 [110/2] via 192.168.1.1, 00:10:23, GigabitEthernet1
    H1#

H2 WORKS

H2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      10.0.0.0/32 is subnetted, 2 subnets
C        10.0.0.1 is directly connected, Loopback0
O        10.0.0.2 [110/2] via 192.168.2.1, 00:10:28, GigabitEthernet2
      192.168.1.0/30 is subnetted, 1 subnets
O        192.168.1.0 [110/2] via 192.168.2.1, 00:10:28, GigabitEthernet2
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/30 is directly connected, GigabitEthernet2
L        192.168.2.2/32 is directly connected, GigabitEthernet2
      192.168.3.0/30 is subnetted, 1 subnets
O        192.168.3.0 [110/2] via 192.168.2.1, 00:10:28, GigabitEthernet2
H2#

Peering Router R3:

R3#show running-config interface lo0
Building configuration...

Current configuration : 99 bytes
!
interface Loopback0
 description loopback-host-peering
 ip address 10.0.0.2 255.255.255.255
end

R3#show run
R3#show running-config | sec
R3#show running-config | section ospf
router ospf 1
 router-id 44.44.44.44
 network 10.0.0.2 0.0.0.0 area 0
 network 192.168.1.0 0.0.0.3 area 0
 network 192.168.2.0 0.0.0.3 area 0
 network 192.168.3.0 0.0.0.3 area 0
R3#show run
R3#show running-config | sect
R3#show running-config | section bgp
router bgp 10
 bgp log-neighbor-changes
 neighbor 10.0.0.1 remote-as 10
 neighbor 10.0.0.1 update-source Loopback0

Hi Shane,

I see you use 10.0.0.1 on H1, and I guess 10.0.0.1 on H2 as well? H3 uses 10.0.0.2.

You can’t use 10.0.0.1 on H1 and H2 like that for a BGP peering. From H1’s or H2’s perspective, 10.0.0.1 is directly connected so that’s what you see in the routing table. If you try to connect to 10.0.0.1 from H1 or H2, they’ll try to connect to themselves.

Rene