cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Join Customer Connection to register!
1056
Views
5
Helpful
7
Replies
jon_panes24
Beginner

Dual BGP neighbors with route-maps

Hi,

Here in our company we have a router that is connected to 2 eBGP peers, lets say that the first peer is 1.1.1.1 and the other is 2.2.2.2. Currently, we are receiving and using a default route to 1.1.1.1, this make the 2.2.2.2 not utilized. So what we did is create a route-map that sets the ip next-hop to 2.2.2.2

 

example:

access-list 1 standard pernit 200.200.200.200

route-map BROWSE permit 10

match ip address 1

set ip next-hop 2.2.2.2

 

I wonder what happens when the 2.2.2.2 ISP goes down, will it failover to ISP1? If not is there a way of doing this type of setup with failover without using IP SLA?

 

Thanks.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Alexey Stytsenko
Beginner

If ip address 2.2.2.2 known to your router as connected network than you don’t have to configure SLA. If 2.2.2.2 goes down, connected route will be withdrawn from routing table and route-map will not sent packets to it.

But if 2.2.2.2 isn’t directly connected, than you have to configure sla operation to track it reachability and use verify-reachability keyword in route-map.

View solution in original post

Akash Agrawal
Cisco Employee

Hi,

 

Setting next-hop to 2.2.2.2 for routes received from 1.1.1.1 is very bad design, this may cause blackholing of traffic or traffic loop. Say suppose, prefix which ISP1 is advertising , not available with ISP2 and we are sending traffic to ISP2 with next-hop change, eventually it may get dropped.

 

If you are receiving partial/full routes then you can pefer few prefixes to ISP1 and others to ISP2 with changing local preference.


If you are receving just default route then you can use "maximum-paths 2" to install both default routes into routing table and do load balance of traffic.
By default "maximum-paths 2" works only for prefixes coming from same AS. To enable same for prefixes coming from different AS, there is hidden command in BGP "bgp bestpath as-path multipath-relax"

 

Configuration example:
----------------------

Topology
                      _______R1 (AS-100)
                     /
(AS-300) R3
                     \_______R2 (AS-200)

 

R1, R2 advertsiing default route to R3.

R3#sh ip bgp su | i 1.1.1.1|2.2.2.2
1.1.1.1         4          100      38      39       20    0    0 00:30:54       10
2.2.2.2         4          200      39      39       20    0    0 00:30:53        2
R3#


R3#show ip bgp 0.0.0.0
BGP routing table entry for 0.0.0.0/0, version 20
Paths: (2 available, best #2, table default)
Multipath: eBGP
  Advertised to update-groups:
     1         
  100
    1.1.1.1 (metric 11) from 1.1.1.1 (204.90.255.1)
      Origin IGP, localpref 100, valid, external, multipath
  200
    2.2.2.2 (metric 11) from 2.2.2.2 (100.100.100.100)
      Origin IGP, localpref 100, valid, external, multipath, best
R3#


R3#sh ip route | b Gateway
Gateway of last resort is 2.2.2.2 to network 0.0.0.0

B*    0.0.0.0/0 [20/0] via 2.2.2.2, 00:00:36   <<<<<<<<<<<<<<<< preferring only 2.2.2.2
      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/11] via 172.31.13.1, 00:32:21, Ethernet1/0.100

After configuring "Maximum-paths 2" and "bgp bestpath as-path multipath-relax"


R3#conf t 
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router bgp 300
R3(config-router)#maximum-path 2
R3(config-router)#bgp bestpath as-path multipath-relax
R3(config-router)#

 

R3#sh ip route | b Gateway
Gateway of last resort is 2.2.2.2 to network 0.0.0.0

B*    0.0.0.0/0 [20/0] via 2.2.2.2, 00:00:19
                [20/0] via 1.1.1.1, 00:00:19  <<<<<<<<<<<<< both BGP routes got installed into routing table
      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/11] via 172.31.13.1, 00:33:41, Ethernet1/0.100


-- Pls dont forget to rate helpful posts --

Regards,
Akash

View solution in original post

7 REPLIES 7
Sandeep Sharma
Cisco Employee

Hi,

There are different ways of achieving the load balancing using bgp like multipath or BGP link bandwidth feature. Refer the below link that will help you configure load balancing as per you requirement.

 

http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13762-40.html

 

Hope it answers your query.

 

Thanks & Regards

Sandeep

Agreed with Akash.

You can use the meximum-path 2 in order to achieve dual ISP with different AS,  its a hidden command in BGP bgp bestpath as-path multipath-relax.

#Maximum-path 2

#bgp bestpath as-path multipath-relax

Alexey Stytsenko
Beginner

If ip address 2.2.2.2 known to your router as connected network than you don’t have to configure SLA. If 2.2.2.2 goes down, connected route will be withdrawn from routing table and route-map will not sent packets to it.

But if 2.2.2.2 isn’t directly connected, than you have to configure sla operation to track it reachability and use verify-reachability keyword in route-map.

View solution in original post

Akash Agrawal
Cisco Employee

Hi,

 

Setting next-hop to 2.2.2.2 for routes received from 1.1.1.1 is very bad design, this may cause blackholing of traffic or traffic loop. Say suppose, prefix which ISP1 is advertising , not available with ISP2 and we are sending traffic to ISP2 with next-hop change, eventually it may get dropped.

 

If you are receiving partial/full routes then you can pefer few prefixes to ISP1 and others to ISP2 with changing local preference.


If you are receving just default route then you can use "maximum-paths 2" to install both default routes into routing table and do load balance of traffic.
By default "maximum-paths 2" works only for prefixes coming from same AS. To enable same for prefixes coming from different AS, there is hidden command in BGP "bgp bestpath as-path multipath-relax"

 

Configuration example:
----------------------

Topology
                      _______R1 (AS-100)
                     /
(AS-300) R3
                     \_______R2 (AS-200)

 

R1, R2 advertsiing default route to R3.

R3#sh ip bgp su | i 1.1.1.1|2.2.2.2
1.1.1.1         4          100      38      39       20    0    0 00:30:54       10
2.2.2.2         4          200      39      39       20    0    0 00:30:53        2
R3#


R3#show ip bgp 0.0.0.0
BGP routing table entry for 0.0.0.0/0, version 20
Paths: (2 available, best #2, table default)
Multipath: eBGP
  Advertised to update-groups:
     1         
  100
    1.1.1.1 (metric 11) from 1.1.1.1 (204.90.255.1)
      Origin IGP, localpref 100, valid, external, multipath
  200
    2.2.2.2 (metric 11) from 2.2.2.2 (100.100.100.100)
      Origin IGP, localpref 100, valid, external, multipath, best
R3#


R3#sh ip route | b Gateway
Gateway of last resort is 2.2.2.2 to network 0.0.0.0

B*    0.0.0.0/0 [20/0] via 2.2.2.2, 00:00:36   <<<<<<<<<<<<<<<< preferring only 2.2.2.2
      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/11] via 172.31.13.1, 00:32:21, Ethernet1/0.100

After configuring "Maximum-paths 2" and "bgp bestpath as-path multipath-relax"


R3#conf t 
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router bgp 300
R3(config-router)#maximum-path 2
R3(config-router)#bgp bestpath as-path multipath-relax
R3(config-router)#

 

R3#sh ip route | b Gateway
Gateway of last resort is 2.2.2.2 to network 0.0.0.0

B*    0.0.0.0/0 [20/0] via 2.2.2.2, 00:00:19
                [20/0] via 1.1.1.1, 00:00:19  <<<<<<<<<<<<< both BGP routes got installed into routing table
      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/11] via 172.31.13.1, 00:33:41, Ethernet1/0.100


-- Pls dont forget to rate helpful posts --

Regards,
Akash

View solution in original post

Hi ,

 

Actually I have a same question but for a different Topology.

I have two routers connecting to different Service Providers (Router A to Service provider A1 and Router B to Service Provider B1).

We are using iBGP between A and B and eBGP between A to A1 and B to B1.

Can I use ''bgp bestpath as-path multipath-relax'' command to load balance/share outbound traffic between these two service providers in different AS'es ?

 

Where all this command be applied ? in eBGP as well as iBGP ? (we are using VRF).

Hello,

 

I set this up in GNS3, and it seems to work. Make sure both iBGP routers have:

 

maximum-paths eibgp 2

bgp bestpath as-path multipath-relax

 

configured.

 

R1 and R2 are the iBGP neighbors, I have configured the 77.77.77.77/32 route from the Internet, both routers have two paths:

 

R1

 

router bgp 1
bgp router-id 1.1.1.1
bgp log-neighbor-changes
bgp bestpath as-path multipath-relax
neighbor 192.168.12.2 remote-as 1
neighbor 192.168.12.2 next-hop-self
neighbor 192.168.13.3 remote-as 2
maximum-paths eibgp 2

 

R1#sh ip route

77.0.0.0/32 is subnetted, 1 subnets
B 77.77.77.77 [20/0] via 192.168.13.3, 00:00:14
[20/0] via 192.168.12.2, 00:00:14

 

R2

 

router bgp 1
bgp log-neighbor-changes
bgp bestpath as-path multipath-relax
neighbor 192.168.12.1 remote-as 1
neighbor 192.168.12.1 next-hop-self
neighbor 192.168.24.4 remote-as 3
maximum-paths eibgp 2

 

R2#sh ip route

77.0.0.0/32 is subnetted, 1 subnets
B 77.77.77.77 [20/0] via 192.168.24.4, 00:00:34
[20/0] via 192.168.12.1, 00:00:34

jon_panes24
Beginner

Thanks for the reply.