1

Network diagram:

Site A (.85)----172.24.0.84/30---- (.86)Site B
    |(.66)                              |(.102)
    |                                   |
    |(172.24.0.64/30)                   |(172.24.0.100/30)
    |(.65)                              |(.101)
    -------------- Site C ---------------

Router configs & traceroute result:

site_a:

interface FastEthernet0/0
 ip address 172.24.0.85 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 172.24.0.65 255.255.255.252
 duplex auto
 speed auto
!
router bgp 900
 no synchronization
 bgp router-id 172.24.0.65
 bgp log-neighbor-changes
 network 172.24.0.64 mask 255.255.255.252
 network 172.24.0.84 mask 255.255.255.252
 timers bgp 1 3
 neighbor 172.24.0.66 remote-as 100
 neighbor 172.24.0.66 soft-reconfiguration inbound
 neighbor 172.24.0.86 remote-as 1200
 neighbor 172.24.0.86 soft-reconfiguration inbound
 neighbor 172.24.0.86 route-map site_b_only in
 no auto-summary
!
ip as-path access-list 1 permit ^[0-9]+_[0-9]+$
!
route-map site_b_only permit 10
 match as-path 1

_____________________________________
site_b:

interface FastEthernet0/0
 ip address 172.24.0.86 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 172.24.0.102 255.255.255.252
 duplex auto
 speed auto
!
router bgp 1200
 no synchronization
 bgp router-id 172.24.0.86
 bgp log-neighbor-changes
 network 172.24.0.84 mask 255.255.255.252
 network 172.24.0.100 mask 255.255.255.252
 timers bgp 1 3
 neighbor 172.24.0.85 remote-as 900
 neighbor 172.24.0.85 soft-reconfiguration inbound
 neighbor 172.24.0.85 route-map site_a_only in
 neighbor 172.24.0.101 remote-as 100
 neighbor 172.24.0.101 soft-reconfiguration inbound
 no auto-summary
!
ip as-path access-list 1 permit ^900_[0-9]*$
!
route-map site_a_only permit 10
 match as-path 1

__________________________________________
site_c:

interface FastEthernet0/0
 ip address 172.24.0.66 255.255.255.252
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 172.24.0.101 255.255.255.252
 duplex auto
 speed auto
!
router bgp 100
 no synchronization
 bgp router-id 192.168.255.2
 bgp log-neighbor-changes
 network 172.24.0.64 mask 255.255.255.252
 network 172.24.0.100 mask 255.255.255.252
 timers bgp 1 3
 neighbor 172.24.0.65 remote-as 900
 neighbor 172.24.0.65 soft-reconfiguration inbound
 neighbor 172.24.0.102 remote-as 1200
 neighbor 172.24.0.102 soft-reconfiguration inbound
 no auto-summary

_________________________________________________________
site_c#show ip bgp  
BGP table version is 4, local router ID is 192.168.255.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*  172.24.0.64/30   172.24.0.65              0             0 900 i
*>                  0.0.0.0                  0         32768 i
*  172.24.0.84/30   172.24.0.102             0             0 1200 i
*>                  172.24.0.65              0             0 900 i
*  172.24.0.100/30  172.24.0.102             0             0 1200 i
*>                  0.0.0.0                  0         32768 i
site_c#traceroute 172.24.0.85

Type escape sequence to abort.
Tracing the route to 172.24.0.85

  1 172.24.0.65 28 msec 16 msec 20 msec
site_c#traceroute 172.24.0.86

Type escape sequence to abort.
Tracing the route to 172.24.0.86

  1 172.24.0.65 24 msec 20 msec 24 msec
  2 172.24.0.86 [AS 900] 16 msec 36 msec 24 msec

How could I force traffic not to route between Site A and Site B if traffic is from Site C ? I want Site C -> Site A, Site C -> Site B only; but Site A and Site B have to communicate via their p2p link

If you check the traceroute result from site C to 172.24.0.86, it still passing Site A, which is wrong.

Eventually deployment will be under Linux running Quagga, this is just simulation in my lab environment running IOS.

10
  • Pastebin automatically removes content, please include all relevant information here so this question remains useful over time.
    – Teun Vink
    Jan 15 '16 at 5:49
  • I may be missing something but this would probably be a more realistic scenario if you associated an actual user subnet (a /24 or whatever) behind each of the routers to actually simulate the site. As is, you are reasoning based on the interconnect IPs and subnets, and I do not think that is actually representative of the routes traffic would take to get to a user subnet, which would follow the path you are expecting. Jan 15 '16 at 7:52
  • @JeremyGibbons, everything is exactly identical with our production environment including subnet and IP address. Jan 15 '16 at 8:00
  • 2
    No it's not irrelevant. Say you have 192.168.1.0/24, 192.168.2.0/24 and 192.168.3.0/24 behind routers A, B, C, and have those subnets added to BGP. As seen from site C, the path towards 192.168.2.X will be shorter through B (1 hop) than through C (2 hops), and you'll get your expected behaviour. When you are testing with your interconnect IPs, recall that, as seen from C, the path to the 172.24.0.84/30 subnet, which is what counts from a routing point of view, is equivalent through A and B (1 hop), so it has to pick one and it's not the one you want, in this case. Jan 15 '16 at 8:29
  • 2
    Well presumably you could just announce the /32s into BGP rather than or in addition to the /30s and get the result you want... but in practice how much of your IP traffic is really going to those IPs, rather than to the LAN IPs beyond the routers ? Does it really matter if routing to the interconnect IPs is not 100% optimal, as long as routing to the LAN devices is? Jan 15 '16 at 13:15
2

Since you're learning routes through BGP you need to learn how it picks the preferred path. With BGP it picks based on the number of AS it has to pass through. Since that network is learned from both and has the same hop count both are viable routes and equal. As shown in your routing table.

You need to modify another metric in order to change the path selection. There are a number of options. I'll leave it to you to decide.

Check out http://packetlife.net/media/library/1/BGP.pdf for a cheatsheet that contains path selection information.

1
  • Are you saying that I could only choose one path but not both? Jan 16 '16 at 10:57
0

There are a couple of methods that allow use of administrative criteria for traffic management. These criteria are called local-pref and prepend. If the amount of traffic, coming from a site must be decreased, one or two prepends must be placed in AS-path. Thus, the AS-path is artificially extended using 1-2 AS, making it look like your network is announced by someone, located 1-2 autonomous system further from us. As a result, part of the routers, which previously considered the path through this uplink the best one, will choose other paths. Thus, it is possible to balance the load of the incoming links.

Another way to control traffic is to mark your announcements with special flags – community, that tell the provider’s router where and how to announce your networks. For instance, “to site A with three prepends, to site B normally”. There is no standard set of community flags, which is why they need to be stipulated with administrators of your ISP. Usually, these flags are indicated in the description of the autonomous system that can be found in the comments field of RIPE database.

In order to learn how to do this, it is vital to understand how routing is performed between the component parts of the large Internet and what is BGP routing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.