Router BGP Inbound Outbound Policy Settings

Posted by fanie on Sunday, December 23, 2012

Continuing our BGP router simulation for routing specific packets . We have seen the usage of weight and local preference to influence our outbound packets. Now we will see how to influence inbound packet from R5. So from R2 point of view, we can have this result :

R2 to 5.5.5.5 using source Lo0
R2 - R3 - R5 - R3 - R2

R2 to 50.50.50.50 using source Lo0
R2 - R4 - R5 - R4 - R2

We can see that inbound and outbound packet use the same way. To influence inbound packet use as path.

This is the topology that we used in our lab :




The configurations that we added in R2 is like this :

router bgp 7
 no synchronization
 bgp log-neighbor-changes
 network 7.7.23.0 mask 255.255.255.0
 network 7.7.24.0 mask 255.255.255.0
 redistribute connected
 neighbor 7.7.23.3 remote-as 33
 neighbor 7.7.23.3 soft-reconfiguration inbound
 neighbor 7.7.23.3 route-map A in
 neighbor 7.7.23.3 route-map D out
 neighbor 7.7.24.4 remote-as 44
 neighbor 7.7.24.4 soft-reconfiguration inbound
 neighbor 7.7.24.4 route-map B in
 neighbor 7.7.24.4 route-map C out
 no auto-summary


access-list 101 permit ip host 5.5.5.5 any
access-list 102 permit ip host 50.50.50.50 any
access-list 103 permit ip host 2.2.2.2 any
access-list 104 permit ip host 20.20.20.20 any





route-map C permit 10
 match ip address 103
 set as-path prepend 14
route-map C permit 20

route-map D permit 10
 match ip address 104
 set as-path prepend 15
route-map D permit 20

The logic is like this, bgp selection path is using the shortest as path. From  R2 perspective, we match loopback0 in R2 using access list. Because we want R5 lo0 to reach R2 lo0 through R3 so we make as path from R4 longer than R3. We add as path 14 to R4 way. So as the link from R5 lo1 to R2 lo1.


R5#traceroute 2.2.2.2 so lo0

Type escape sequence to abort.
Tracing the route to 2.2.2.2

  1 7.7.35.3 4 msec 4 msec 4 msec
  2 7.7.23.2 [AS 33] 12 msec *  36 msec

R5#traceroute 20.20.20.20 so lo0

Type escape sequence to abort.
Tracing the route to 20.20.20.20

  1 7.7.45.4 4 msec 8 msec 4 msec
  2 7.7.24.2 [AS 44] 8 msec *  36 msec






This configuration is useful if we only have control to R2. I have attached the GNS topology and initial config, so you can try it at home.

http://www.4shared.com/rar/SkNK_5aW/bgp-routing-in-out.html

Happy Labbing





{ 0 comments... read them below or add one }

Post a Comment