cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2317
Views
0
Helpful
7
Replies

BGP with two ISP

amaresh_22jan
Level 1
Level 1

HI All,


Please find the scenario below

Two router (Router A and Router B) with one ISP link terminated on each router . EBGP is established with the ISP router and IBGP between Router A and Router B


As of now all outgoing trafffic orginated from local network goes via Link A (terminated on router A)

Wheres as incoming traffic comes via Link B (terminated on router B) resulting in assymetric .


Now for specific destination host say 1.1.1.2 we want to send the traffic via link B . I belive we need to configure AS path attribute.


Kindly help me with configuration for particular destination host.

7 Replies 7

Hello,

 

do both routers connect to the same ISP AS, or different IPS ASs ?

Different ISP AS 

Hello,

 

you can use local preference. The below would need to be configured on the router connected to ISP B. In this sample config, iBGP AS is 1, and the eBGP AS is 3:

 

router bgp 1
bgp router-id 2.2.2.2
bgp log-neighbor-changes
network 2.2.2.2 mask 255.255.255.255
neighbor 192.168.12.1 remote-as 1
neighbor 192.168.12.1 next-hop-self
neighbor 192.168.24.4 remote-as 3
neighbor 192.168.24.4 route-map LOCPREF in
!
ip prefix-list LOCAL seq 5 permit 1.1.1.2/32
!
route-map LOCPREF permit 10
match ip address prefix-list LOCAL
set local-preference 200
!
route-map LOCPREF permit 20
set local-preference 150

Thanks for the response.

 

Below is the current config on the secondary router

 

router bgp 45XXX
bgp log-neighbor-changes
bgp dampening
network 202.19.138.0
neighbor 124.17.58.89 remote-as 94XX
neighbor 192.168.10.1 remote-as 45XXX
neighbor 192.168.10.1 next-hop-self 

 

 

202.19.138.0 is the network advertise on both the router

124.17.58.89 is the neighbor peer ip of the ISP

192.168.10.1 is used for IBGP between the router 

 

Hello

Local Preference and AS-prepending would be a viable option but I would also suggest to apply some filtering on your bgp rtrs so to negate the possibility of your rtrs becoming a transit path for either ISP

 

The below example should allow RTRB be the preferred rtr to reach outbound towards 1.1.1.0/24
and all ingress traffic to come in via RTRA

 

Lastly the filter-list only allows local subnets to be advertised to either ISP and not any EBGP prefixes.

 

RTR-A
ip as-path access-list 10 permit ^$
route-map LP-ISP1 permit 10
set local-preference 40000


router bgp 45XXX
neighbor (ISP1) route-map LP-ISP1 in
neighbor (ISP1) filter-list 10 out

 

 


RTR-B
ip as-path access-list 10 permit ^$
access-list 10 permit 1.1.1.0 0.0.0.255


route-map LP_ISP2 permit 10
match ip  address 10
set local-preference 50000


route-map LP_ISP2 permit 99
set local-preference 10000


route-map RTRB-AS-prepend permit 10
set as-path prepend 45XXX 45XXX 45XXX


router bgp 45XXX
neighbor (ISP2) route-map LP-ISP2 in
neighbor (ISP2)filter-list 10 out
neighbor (ISP2) route-map RTRB-AS-prepend out

res

Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Thanks everyone.

 

By  default all the traffic is originating from Router A  but some return traffic is coming back  by Router B.

 

Now we want traffic 1.1.1.2 should come back by router A (link A)  only. Does the below config will suffice the requirement.  Where as other return traffic may return via router A or  Router B 

 

 

On Router B

 

router bgp 45XXX
bgp log-neighbor-changes
bgp dampening
network 202.19.138.0
neighbor (ISP2)  remote-as 94XX

neighbor (ISP2) route-map ASPATH  out
neighbor 192.168.10.1 next-hop-self 

 

 

ip prefix-list AS  seq 5 permit 1.1.1.2/32

route-map ASPATH permit 10
set  as-path prepend 45XXX 45XXX 45XXX

 

 

 

Rick Morris
Level 6
Level 6

There are a couple of ways to do what you want.

 

If you want to do some load sharing you can subnet your network, assuming you can do so based on block size, then announce each out their separate links.

 

For instance:

8.8.8.0/23

Subnet

8.8.8.0/24

8.8.9.0/24

 

Router A

Local pref for 8.8.8.0/24

prepend AS for 8.8.9.0/24

 

Router B

Local pref for 8.8.9.0/24

prepend AS for 8.8.8.0/24

 

What you get is a way to break up the block, use both links AND have failover to each other in the event of a carrier issue taking one link down over the other.

 

IF you are using one as a primary and one as a backup:

Router A

local pref for 8.8.8.0/23

 

Router B

prepend AS for 8.8.8.0/23

 

This way you are telling the upstream providers to use one connection over the other by your AS prepending for incoming traffic. Outbound is controlled by local pref

Review Cisco Networking for a $25 gift card