cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
320
Views
0
Helpful
1
Replies

Adjust inbound traffic of BGP peers

eungporhai
Level 1
Level 1

Dear All

Good morning everyone!

Need your assistant to solve this problem as below:

 

Description: There are four AS in this diagram. Assume that we’re in AS30. AS40 and AS50 are our upstream and AS10 is our downstream. There are two routers in AS10 using iBGP. And each router in that AS10 is connected to R3 at AS30.

In R3 currentlly, all traffic destinate to R1 will be via R1, and all destination to R2 wil be via R2.

 

Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.0/24       192.168.31.1             0             0 10 i

*                           192.168.32.2             2              0 10 i

*> 1.1.2.0/24       192.168.31.1             0             0 10 i

*                           192.168.32.2             2             0 10 i

*> 1.1.3.0/24       192.168.31.1             0             0 10 i

*                          192.168.32.2             2             0 10 i

*  2.2.1.0/24       192.168.31.1             2             0 10 i

*>                        192.168.32.2             0             0 10 i

*  2.2.2.0/24       192.168.31.1             2             0 10 i

*>                         192.168.32.2             0             0 10 i

*> 4.4.4.4/32       192.168.34.4             0             0 40 i

*> 5.5.5.5/32       192.168.35.5             0             0 50 i

 

  • Trace result from R4

 

R4#traceroute 1.1.1.1 source 4.4.4.4

 

Type escape sequence to abort.

Tracing the route to 1.1.1.1

 

  1 192.168.34.3 100 msec 12 msec 92 msec

  2 192.168.31.1 96 msec 132 msec 88 msec

 

R4#traceroute 2.2.2.2 source 4.4.4.4

 

Type escape sequence to abort.

Tracing the route to 2.2.2.2

 

  1 192.168.34.3 96 msec 56 msec 72 msec

  2 192.168.32.2 128 msec 48 msec 92 msec

 

  • Trace result from R5

 

R5#traceroute 2.2.2.2 source 5.5.5.5

 

Type escape sequence to abort.

Tracing the route to 2.2.2.2

 

  1 192.168.35.3 104 msec 96 msec 80 msec

  2 192.168.32.2 92 msec 76 msec 64 msec

R5#traceroute 1.1.1.1  source 5.5.5.5

 

Type escape sequence to abort.

Tracing the route to 1.1.1.1

 

  1 192.168.35.3 96 msec 88 msec 164 msec

  2 192.168.31.1 112 msec 88 msec 32 msec

 

Objective:

  • All INBOUND traffic of AS40 destinate to AS10 must go through R2 which is primary link
  • All INBOUND traffic of AS50 destinate to AS10 must go through R1 which is backup link

 

 

I've used route-map to set next hob IP to match my objectives and the result is fine.

 

I would like to ask if there is another method besides this policy based routing to archive it.

 

Your comment would be much appreciated.

1 Reply 1

Aztec_
Level 1
Level 1

I'm not sure whether this will work or not, haven't try it myself.

but try to use as-prepend and apply the route-map to desired BGP neighbor.

Please inform me whether this work or not

 

access-list 1 permit 1.1.0.0 0.0.255.255

access-list 2 permit 2.2.0.0 0.0.255.255

!

route-map AS40AS10 permit 10

match ip address 2

set as-path prepend 30 30 30 30

!

route-map AS40AS10 permit 20

match ip address 1

!

route-map AS50AS10 permit 10

match ip address 1

set as-path prepend 30 30 30 30

!

route-map AS50AS10 permit 20

match ip address 2

router bgp 30

neighbor 4.4.4.4 route-map AS40AS10 out

neighbor 5.5.5.5 route-map AS50AS10 out

!

 

R4 will have path like 0 30 30 30 30 30 to reach R2 network and,

R5 will have path 0 30 30 30 30 30 to reach R1 network. If not, try clear ip bgp proc on R4 & R5

 

i hope it works