Prepending ASNs to the AS Path
Problem
You want to increase the length of an AS Path so that one inbound path looks better than another.
Solution
In situations when you have multiple connections between ASs, you will often want to make remote networks prefer one inbound path when sending packets to your network. The easiest way to do this is to prepend your own ASN to the AS PATH several times, instead of just once, as it would do by default:
Router1#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router1(config)#ip as-path access-list15permitRouter1(config)#^$route-mapPREPENDpermitRouter1(config-route-map)#10match as-pathRouter1(config-route-map)#15set as-path prependRouter1(config-route-map)#65500 65500 65500exitRouter1(config)#route-mapPREPENDpermitRouter1(config-route-map)#20exitRouter1(config)#router bgpRouter1(config-router)#65500neighbor192.168.1.5remote-asRouter1(config-router)#65510neighbor192.168.1.5route-mapPREPENDoutRouter1(config-router)#exitRouter1(config)#endRouter1#
This example uses the same network shown in Figure 9-2, earlier in this chapter.
Discussion
We have already discussed methods for making your outbound traffic prefer one path over another in Recipe 9.7. But, as we mentioned in that recipe, that only affects your outbound path. If you also want to ensure that inbound traffic prefers one path over another, then you have to somehow trick the remote networks into believing that one path is better than ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access