Categories

CUC (6) CUCM (26) Jabber (6) Python (2) Routing (3) Solarwinds Orion NPM (4) switching (1) Video (6) voice (2)

Sunday, 13 October 2013

Load Sharing When Dual-Homed to One ISP Through Multiple Local Routers (using BGP)

Another BGP post. In a previous post,
http://www.ciscoshizzle.blogspot.com.au/2013/10/same-provider-multi-homing-using-bgp.html  I have discussed a possible set up of a multihomed customer using redundant paths to a single provider. The techniques used for this are local preference and AS path prepending. I will recycle that GNS3 network I used for that post, with two locations: Copenhagen and Stockholm.

OK, so in these two viking outposts (thought the flags were a nice touch), we have a company. HQ in Copenhagen where the internet breaks out and a remote site in Stockholm.



OBJECTIVE and THEORY:

This scenario shows how to achieve load sharing when there are multiple connections to the same ISP through multiple local routers. The two eBGP peers are terminated on two separate local routers. Load balancing on the two links is not possible because BGP chooses the single best path among the networks that is learned from eBGP and internal BGP (iBGP). Load sharing among the multiple paths to AS65218 (Copenhagen) is the next-best option. With this type of load sharing, traffic to specific networks, on the basis of predefined policies, travels through both links. Additionally, each link acts as a backup to the other link, in case one link fails. So applied to our scenario the following objectives can be identified:


  • Stockholm, AS 65118, representing our remote site, should accept all local routes from Copenhagen as well as a default route, representing Internet routes.
  • Fail over between the two links
  • All internet destined traffic that hits Stockholm1, uses the Stock1-Cop1 link
  • All internet destined traffic that hits Stockholm2, uses the Stock2-Cop2 link
  • Traffic inbound from Copenhagen to 10.11.200.0/24 should go through the Stock1-Cop1 link (with failover)
  • Traffic inbound from Copenhagen to 10.11.201.0/24 should go through the Stock2-Cop2 link (with fail over)


Fig.1 - Scenario




CONFIGS


Copenhagen 1:


interface FastEthernet0/0
 description Copenhagen2
 ip address 192.168.30.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 description Stockholm1
 ip address 192.168.20.1 255.255.255.0
 duplex auto

 speed auto
!
router bgp 65218
 no synchronization
 bgp log-neighbor-changes
 network 192.168.20.0
 network 192.168.30.0
 neighbor 192.168.20.2 remote-as 65118
 neighbor 192.168.20.2 default-originate
 neighbor 192.168.30.2 remote-as 65218
 no auto-summary
!

Copenhagen 2:

interface FastEthernet0/0
 description Copenhagen1
 ip address 192.168.30.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 description Stockholm2
 ip address 192.168.10.1 255.255.255.0
 duplex auto

 speed auto
!
router bgp 65218
 no synchronization
 bgp log-neighbor-changes
 network 192.168.10.0
 network 192.168.30.0
 neighbor 192.168.10.2 remote-as 65118
 neighbor 192.168.10.2 default-originate
 neighbor 192.168.30.1 remote-as 65218
 no auto-summary

Stockholm 1:

interface FastEthernet0/0
 description Stcokholm2
 ip address 10.11.201.1 255.255.255.0 secondary
 ip address 10.11.200.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 description Copenhagen1
 ip address 192.168.20.2 255.255.255.0
 duplex auto
 speed auto
!
router bgp 65118
 no synchronization
 bgp log-neighbor-changes
 network 10.11.200.0 mask 255.255.255.0
 network 10.11.201.0 mask 255.255.255.0
 network 192.168.20.0
 neighbor 10.11.200.2 remote-as 65118
 neighbor 192.168.20.1 remote-as 65218
 neighbor 192.168.20.1 route-map St1-Cop1 out

 no auto-summary
!
access-list 1 permit 10.11.200.0
access-list 2 permit 10.11.201.0
!
!
!
route-map St1-Cop1 permit 10
 match ip address 1
!
route-map St1-Cop1 permit 20
 match ip address 2
 set as-path prepend 65118 65118 65118



Stockholm 2:


interface FastEthernet0/0
 description Stockholm1
 ip address 10.11.201.2 255.255.255.0 secondary
 ip address 10.11.200.2 255.255.255.0
 speed auto
 half-duplex
!
interface FastEthernet0/1
 description Copenhagen2
 ip address 192.168.10.2 255.255.255.0
 duplex auto
 speed auto

!
router bgp 65118
 no synchronization
 bgp log-neighbor-changes
 network 10.11.200.0 mask 255.255.255.0
 network 10.11.201.0 mask 255.255.255.0
 network 192.168.10.0
 neighbor 10.11.200.1 remote-as 65118
 neighbor 192.168.10.1 remote-as 65218
 neighbor 192.168.10.1 route-map St2-Cop2 out
 no auto-summary
!
access-list 1 permit 10.11.200.0
access-list 2 permit 10.11.201.0
!
!
!
route-map St2-Cop2 permit 10
 match ip address 1
 set as-path prepend 65118 65118 65118
!
route-map St2-Cop2 permit 20
 match ip address 2



VERIFICATION

Verifying the default route on the Stockholm 1 router:

Stockholm1#sh ip bgp
BGP table version is 21, local router ID is 192.168.20.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network              Next Hop               Metric     LocPrf      Weight          Path
*> 0.0.0.0                192.168.20.1             0                            0                65218   i
   -------- default gateway next hop to Copenhagen 1, Internet
* i                            192.168.10.1             0         100             0                 65218   i
* i10.11.200.0/24    10.11.200.2               0        100              0                             i
*>                            0.0.0.0                       0                        32768                        i
* i10.11.201.0/24    10.11.200.2              0          100             0                             i
*>                            0.0.0.0                      0                         32768                        i
*  192.168.10.0      192.168.20.1             0                                               65218 i
*>i                          10.11.200.2               0          100              0                            i
*  192.168.20.0      192.168.20.1             0                             0                65218 i
*>                           0.0.0.0                       0                         32768                         i
*> 192.168.30.0     192.168.20.1             0                            0                65218      i
------------Copenhagen local LAN, next hop Copenhagen 1

* i                           192.168.10.1             0         100                   0           65218     i



Remember that the ">" sign indicates the best path, So the BGP table for Stockholm 1, shows that the best path for all outgoing internet traffic is through Copenhagen 1. The same goes for outbound traffic to the Copenhagen LAN of 192.168.30.0/24.



On Stockholm 2, the opposite can be established; traffic for the Copenhagen LAn and internet traffic across the link to Copenhagen 2.


  Stockholm2#sh ip bgp
BGP table version is 11, local router ID is 192.168.10.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network               Next Hop                Metric      LocPrf       Weight     Path
* i0.0.0.0                192.168.20.1              0              100              0           65218 i
*>                          192.168.10.1              0                                   0           65218 i
 -------- default gateway, next hop to Copenhagen 2, Internet
* i10.11.200.0/24   10.11.200.1               0              100               0            i
*>                          0.0.0.0                       0                               32768         i
*> 10.11.201.0/24   0.0.0.0                     0                               32768         i
* i                           10.11.200.1               0            100                  0           i
*  192.168.10.0      192.168.10.1             0                                     0        65218 i
*>                          0.0.0.0                       0                                 32768        i
*>i192.168.20.0    10.11.200.1               0             100                  0            i
*                            192.168.10.1             0                                                 65218 i
* i192.168.30.0     192.168.20.1             0            100                    0          65218 i
*>                          192.168.10.1             0                                      0          65218 i
------------Copenhagen local LAN, next hop Copenhagen 1

As you can see from both the Stockholm 1 and 2 BGP-table,  the default route has a fail over successor.

Verification of all inbound traffic from Copenhagen to Stockholm
Let us consider all Stockholm inbound traffic, as seen from the perspective of the Copenhagen 1 and 2 routers. On Copenhagen 1, all traffic for 10.11.200.0/24 is sent out its link to Stockholm 1 (as per requirement), all traffic to Stockholm's secondary IP 10.11.201.0/24 gets sent to Stockholm 2. So as you can see the two links between the two locations both get utilised.


Copenhagen1#sh ip bgp
BGP table version is 15, local router ID is 192.168.30.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network                    Next Hop            Metric      LocPrf     Weight       Path
*> 10.11.200.0/24       192.168.20.2           0                              0             65118 i
------------Stockholm local LAN subnet 1, next hop Stockholm 1
*  10.11.201.0/24        192.168.20.2            0                              0             65118 65118 65118 65118 i
*>i                              192.168.10.2            0            100            0             65118 i
------------Stockholm local LAN subnet 2, next hop Stockholm 2
*>i192.168.10.0          192.168.30.2           0            100           0               i
*> 192.168.20.0          0.0.0.0                     0                        32768            i
* i192.168.30.0           192.168.30.2            0           100            0               i
*>                                  0.0.0.0                   0                          32768          i

On the Copenhagen 2 router:


Copenhagen2#sh ip bgp
BGP table version is 14, local router ID is 192.168.30.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network                 Next Hop            Metric      LocPrf        Weight       Path
*>i10.11.200.0/24    192.168.20.2           0            100                 0           65118 i
------------Stockholm local LAN subnet 1, next hop Stockholm 1
*                                192.168.10.2           0                                   0           65118 65118 65118 65118 i
*> 10.11.201.0/24    192.168.10.2           0                                   0            65118 i
------------Stockholm local LAN subnet 1, next hop Stockholm 2
*> 192.168.10.0      0.0.0.0                      0                              32768          i
*>i192.168.20.0     192.168.30.1             0           100                 0              i
* i192.168.30.0        192.168.30.1           0            100                 0             i
*>                               0.0.0.0                  0                                  32768       i

tweaking local preference, using route maps.

<insert needed>


I realise, that in reality you will have more to consider when sending traffic across a WAN to a main site. I have not touched on things like redistributing another IGP into BGP, policy based routing or redundancy through means of like HSRP. This is because I wanted to post purely on BGP and not on the techniques, on how to route redundantly to your WAN routers. Which of course doesnt mean I dont want to discuss, or answer questions about it. 


Bonne chance and Namaste!



1 comment:

  1. Good Explanation
    Can you pls post hoe to do the same with local preference

    ReplyDelete