Show text-ads on your Website or Blog with BidVertiser. Sell your ad space with BidVertiser Make money from your Website or Blog with BidVertiser

Thursday, April 21, 2016

Load Sharing When Dual-Homed to One ISP Through Multiple Local Routers

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 AS 10 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.
For simplicity, assume that the BGP routing policy for AS 11 is:
  • AS 11 accepts the local routes from AS 10, along with a default for the rest of the Internet routes.
  • The outbound traffic policy is:
    • All traffic that is destined to the Internet from R101 goes out through the R101-R103 link.
    • If the R101-R103 link fails, then all traffic to the Internet from R101 goes through R102 to AS 10.
    • Similarly, all traffic that is destined to the Internet from R102 goes through the R102-R104 link.
    • If the R102-R104 link fails, then all traffic to the Internet from R102 goes through R101 to AS 10.
  • The inbound traffic policy is:
    • Traffic that is destined for network 192.168.11.0/24 from the Internet should come from the R103-R101 link.
    • Traffic that is destined for network 192.168.12.0/24 from the Internet should come from the R104-R102 link.
    • If one link to AS 10 fails, then the other link should route the traffic that is destined for all networks back to AS 11 from the Internet.
In order to achieve this, 192.168.11.0 is announced from R101 to R103 with a shorter AS_PATH than is announced from R102 to R104. AS 10 finds the best path through the R103-R101 link. Similarly, 192.168.12.0 is announced with a shorter path through the R102-R104 link. AS 10 prefers the R104-R102 link for traffic that is bound to 192.168.12.0 in AS 11.
For outbound traffic, BGP determines the best path on the basis of routes that are learned through eBGP. These routes are preferable to routes learned through iBGP. So R101 learns 10.10.34.0 from R103 through eBGP and from R102 through iBGP. The external path is selected over the internal path. So, if you look at the BGP table in the R101 configuration, the route toward 10.10.34.0 would be through the R101-R103 link, with next hop 10.10.13.3. On R102, the route toward 10.10.34.0 would be through the R102-R104 link, with next hop 10.10.24.4. This achieves load sharing for traffic that is destined to 10.10.34.0. Similar reasoning applies to the default routes on R101 and R102. For more information on BGP path selection criteria, refer to BGP Best Path Selection Algorithm.

Network Diagram

 

 

This section uses this network setup:
40c.gif

Configurations

This section uses these configurations:
  • R101
  • R102
  • R103
  • R104
R101
hostname R101

!
interface Ethernet0/0
 ip address 192.168.11.1 255.255.255.0 secondary
 ip address 192.168.12.1 255.255.255.0
!
interface Serial8/0
 ip address 10.10.13.1 255.255.255.0
!
router bgp 11
 no synchronization
 bgp log-neighbor-changes
 network 192.168.11.0
 network 192.168.12.0
 neighbor 10.10.13.3 remote-as 10
 neighbor 10.10.13.3 route-map R101-103-MAP out

!--- The AS_PATH is increased for 192.168.12.0.

 neighbor 192.168.12.2 remote-as 11
 neighbor 192.168.12.2 next-hop-self
 maximum-paths 2
 no auto-summary
!
access-list 1 permit 192.168.12.0
access-list 2 permit 192.168.11.0
route-map R101-103-MAP permit 10
 match ip address 1
 set as-path prepend 11 11 11
!         
route-map R101-103-MAP permit 20
 match ip address 2
R102
hostname R102
!

interface Ethernet0/0
 ip address 192.168.11.2 255.255.255.0 secondary
 ip address 192.168.12.2 255.255.255.0
!
interface Serial8/0
 ip address 10.10.24.2 255.255.255.0
!
router bgp 11
 no synchronization
 bgp log-neighbor-changes
 network 192.168.11.0
 network 192.168.12.0
 neighbor 10.10.24.4 remote-as 10
 neighbor 10.10.24.4 route-map R102-104-MAP out

!--- The AS_PATH is increased for 192.168.11.0.

 neighbor 192.168.12.1 remote-as 11
 neighbor 192.168.12.1 next-hop-self
 no auto-summary
!
access-list 1 permit 192.168.11.0
access-list 2 permit 192.168.12.0
route-map R102-104-MAP permit 10
 match ip address 1
 set as-path prepend 11 11 11
!         
route-map R102-104-MAP permit 20
 match ip address 2
!
R103
hostname R103
!
interface Ethernet0/0
 ip address 10.10.34.3 255.255.255.0
!
interface Serial8/0
 ip address 10.10.13.3 255.255.255.0
!
router bgp 10
no synchronization
 bgp log-neighbor-changes
 network 10.10.34.0 mask 255.255.255.0
 neighbor 10.10.13.1 remote-as 11
 neighbor 10.10.13.1 default-originate
 neighbor 10.10.34.4 remote-as 10
 neighbor 10.10.34.4 next-hop-self
 no auto-summary
 !
R104
hostname R104
!

interface Ethernet0/0
 ip address 10.10.34.4 255.255.255.0

!
interface Serial8/0
 ip address 10.10.24.4 255.255.255.0
!
router bgp 10
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.10.24.2 remote-as 11
 neighbor 10.10.24.2 default-originate
 neighbor 10.10.34.3 remote-as 10
 neighbor 10.10.34.3 next-hop-self
 no auto-summary
!

Verify

This section provides information you can use to confirm your configuration is working properly.
Certain show commands are supported by the Output Interpreter Tool (registered customers only) , which allows you to view an analysis of show command output.

Verification When Both Links Between AS 11 and AS 10 Are Up

Verification of Outbound Traffic
Note: The greater-than sign (>) in the show ip bgp command output represents the best path to use for that network among the possible paths. Refer to BGP Best Path Selection Algorithm for more information.
The BGP table in R101 shows that the best path for all outgoing traffic to the Internet is through the R101-R103 link. The show ip route command output confirms the routes in the routing table.
R101# show ip bgp

BGP table version is 5, local router ID is 192.168.12.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i0.0.0.0          192.168.12.2                  100      0 10 i
*>                  10.10.13.3                             0 10 i  
!--- This is the next hop of R103.

* i10.10.34.0/24    192.168.12.2                  100      0 10 i
*>                  10.10.13.3               0             0 10 i  
!--- This is the next hop of R103.

* i192.168.11.0     192.168.12.2             0    100      0 i
*>                  0.0.0.0                  0         32768 i
* i192.168.12.0     192.168.12.2             0    100      0 i
*>                  0.0.0.0                  0         32768 i

R101# show ip route

!--- Output suppressed.

Gateway of last resort is 10.10.13.3 to network 0.0.0.0

C    192.168.12.0/24 is directly connected, Ethernet0/0
C    192.168.11.0/24 is directly connected, Ethernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.13.0 is directly connected, Serial8/0
B       10.10.34.0 [20/0] via 10.10.13.3, 00:08:53 
!--- This is the next hop of R103.

B*   0.0.0.0/0 [20/0] via 10.10.13.3, 00:08:53     
!--- This is the next hop of R103.

Here are the BGP and routing tables for R102. According to the policy, R102 should route all the traffic to AS 10 through the R102-R104 link:
R102# show ip bgp

BGP table version is 7, local router ID is 192.168.12.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 0.0.0.0          10.10.24.4                             0 10 i   
!--- This is the next hop of R104.

* i                 192.168.12.1                  100      0 10 i
*> 10.10.34.0/24    10.10.24.4                             0 10 i   
!--- This is the next hop of R104.

* i                 192.168.12.1             0    100      0 10 i
* i192.168.11.0     192.168.12.1             0    100      0 i
*>                  0.0.0.0                  0         32768 i
* i192.168.12.0     192.168.12.1             0    100      0 i
*>                  0.0.0.0                  0         32768 i

R102# show ip route

!--- Output suppressed.

Gateway of last resort is 10.10.24.4 to network 0.0.0.0

C    192.168.12.0/24 is directly connected, Ethernet0/0
C    192.168.11.0/24 is directly connected, Ethernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.24.0 is directly connected, Serial8/0
B       10.10.34.0 [20/0] via 10.10.24.4, 00:11:21   
!--- This is the next hop of R104.

B*   0.0.0.0/0 [20/0] via 10.10.24.4, 00:11:21       
!--- This is the next hop of R104.

Verification of Inbound Traffic from AS 10 to AS 11
The networks 192.168.11.0 and 192.168.12.0 belong to AS 11. According to the policy, AS 11 should prefer the R103-R101 link for traffic that is destined to network 192.168.11.0 and the R104-R102 link for traffic that is destined to network 192.168.12.0.
R103# show ip bgp

BGP table version is 4, local router ID is 10.10.34.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.10.34.0/24    0.0.0.0                  0         32768 i
*> 192.168.11.0     10.10.13.1               0             0 11 i             
!--- The next hop is R101.

*  192.168.12.0     10.10.13.1               0             0 11 11 11 11 i   
*>i                 10.10.34.4               0    100      0 11 i             
!--- The next hop is R104.


R103# show ip route

!--- Output suppressed.

Gateway of last resort is not set

B    192.168.12.0/24 [200/0] via 10.10.34.4, 00:04:46  
!--- The next hop is R104.

B    192.168.11.0/24 [20/0] via 10.10.13.1, 00:04:46   
!--- The next hop is R101.

     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.13.0 is directly connected, Serial8/0
C       10.10.34.0 is directly connected, Ethernet0/0
The best path for network 192.168.11.0 on R103 is through the R103-R101 link, and the best path for network 192.168.12.0 is through R104 to AS 11. In this case, the shortest path length determines the best path.
Similarly, on R104, the BGP and routing table resembles this:
R104# show ip bgp

BGP table version is 13, local router ID is 10.10.34.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i10.10.34.0/24    10.10.34.3               0    100      0 i
*>i192.168.11.0     10.10.34.3               0    100      0 11 i
*                   10.10.24.2               0             0 11 11 11 11 i
*> 192.168.12.0     10.10.24.2               0             0 11 i

R104# show ip route

!--- Output suppressed.

Gateway of last resort is not set

B    192.168.12.0/24 [20/0] via 10.10.24.2, 00:49:06    
!--- The next hop is R102.

B    192.168.11.0/24 [200/0] via 10.10.34.3, 00:07:36   
!--- The next hop is R103.

     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.24.0 is directly connected, Serial8/0
C       10.10.34.0 is directly connected, Ethernet0/0

Verification When the R101-R103 Link Fails

When the R101-R103 link fails, all traffic should reroute through R102. This diagram illustrates this change:
40d.gif
Shut down the R103-R101 link on R103 in order to simulate this situation.
R103(config)# interface serial 8/0
R103(config-if)# shutdown

*May 1 00:52:33.379: %BGP-5-ADJCHANGE: neighbor 10.10.13.1 Down Interface flap  
*May 1 00:52:35.311: %LINK-5-CHANGED: Interface Serial8/0, changed state to 
 administratively down
*May 1 00:52:36.127: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial8/0, changed 
 state to down
Verify the outbound route to AS 10.
R101# show ip bgp

BGP table version is 17, local router ID is 192.168.12.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i0.0.0.0          192.168.12.2                  100      0 10 i   
!--- This is the next hop of R102.

*>i10.10.34.0/24    192.168.12.2                  100      0 10 i   
!--- This is the next hop of R102.

* i192.168.11.0     192.168.12.2             0    100      0 i
*>                  0.0.0.0                  0         32768 i
* i192.168.12.0     192.168.12.2             0    100      0 i
*>                  0.0.0.0                  0         32768 i

R101# show ip route

!--- Output suppressed.

Gateway of last resort is 192.168.12.2 to network 0.0.0.0

C    192.168.12.0/24 is directly connected, Ethernet0/0
C    192.168.11.0/24 is directly connected, Ethernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
B       10.10.34.0 [200/0] via 192.168.12.2, 00:01:34
B*   0.0.0.0/0 [200/0] via 192.168.12.2, 00:01:34      
!--- All outbound traffic goes through R102.

     
R102# show ip route

!--- Output suppressed.

Gateway of last resort is 10.10.24.4 to network 0.0.0.0

C    192.168.12.0/24 is directly connected, Ethernet0/0
C    192.168.11.0/24 is directly connected, Ethernet0/0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.24.0 is directly connected, Serial8/0
B       10.10.34.0 [20/0] via 10.10.24.4, 00:13:22
B*   0.0.0.0/0 [20/0] via 10.10.24.4, 00:55:22         
!--- All outbound traffic on R102 goes through R104.

Verify the inbound traffic route when R101-R103 is down.
R103# show ip bgp

BGP table version is 6, local router ID is 10.10.34.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.10.34.0/24    0.0.0.0                  0         32768 i
*>i192.168.11.0     10.10.34.4               0    100      0 11 11 11 11 i
*>i192.168.12.0     10.10.34.4               0    100      0 11 i

R103# show ip route

!--- Output suppressed.

Gateway of last resort is not set

B    192.168.12.0/24 [200/0] via 10.10.34.4, 00:14:55      
!--- The next hop is R104.

B    192.168.11.0/24 [200/0] via 10.10.34.4, 00:05:46      
!--- The next hop is R104.

     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.34.0 is directly connected, Ethernet0/0
On R104, the traffic for 192.168.11.0 and 192.168.12.0 goes through the R104-R102 link.
R104# show ip route

!--- Output suppressed.

Gateway of last resort is not set

B    192.168.12.0/24 [20/0] via 10.10.24.2, 00:58:35    
!--- The next hop is R102.

B    192.168.11.0/24 [20/0] via 10.10.24.2, 00:07:57    
!--- The next hop is R102.

     10.0.0.0/24 is subnetted, 2 subnets
C       10.10.24.0 is directly connected, Serial8/0
C       10.10.34.0 is directly connected, Ethernet0/0

No comments: