to influence the BGP path selection in a neighbor AS you can use BGP AS path, BGP MED or - through BGP community with the help of the neighbor AS - Local preference.
Unless the neighboring AS does implement their own policy contradicting yours, the most simple approach would be to set different MED values - lower ones are better. As all other path selection criteria (Weight, Loc Pref, AS path) are the same in all updates, path selection in the neighbor AS will be based on MED.
The advantage is also, that the neighboring AS does not have to do something special.
BGP MED can be set f.e. through an outgoing route-map.
Say I have 4 x /24's and 2 external Peers. (on two distinct routers using iBGP for prefix exchange) What I would like to achieve is for 1 of the /24's to prefer external router A as oppsed to router B for both egress and ingress traffic. B is only to be used by this /24 in the event that A is unaccessible.
If i'm still unclear please say so, and I'll elaborate.
Depending on your network, there are at least few ways of doing this, none that I know of are all that pretty and it depends on your network structure as to which way would be best. Assuming the /24 that you want to egress through router A is directly connected to router and and the other three /24s are directly connected to Router B, you can add a weight to the incoming advertisements from your external peers. The weight is only local to the router, so once traffic arrives on that router, it will use that as an exit point, unless the exit point is down.
The second way to do this is to use policy based routing. You create a route-map which matches on prefix you want to route out of router A, and then set the next-hop to the next-hop to router A. You then match your other three prefixes, (or just omit the match statment for everything else) and set the next hop to your path to router B. You need to apply this on the inbound interface where the traffic is coming from as a policy-map. Depending on how your network is built, you have to be careful not to create a routing loop as you are manually manipulating traffic.
If the prefix that is to go out router A is located on one router C and the prefixes to go our router B are on router D, you can also change the local preference on your iBGP advertisement out to routers C and D. To do this you would apply a route-map outbound from router A to router C which sets to the local preference to say 200. Because iBGP routes are not passed on to any other iBGP neighbors, all of the other routers will still have a local preference of 100 for the outbound destinations . You could then also apply a route-map outbound on the iBGP session from router B to router D doing the same thing. This would make Router D prefer router B as its exit point, and Router C would prefer router A as its exit point. All other routers would be uneffected by the change.
Let me know if this helps or more information about how the network is configured.
The policy routing method is certianly ugly, albeit will work. I was hoping to be able to achieve this with BGP.
The network at the moment is standard as far as enterprise multi-layered model goes. At the top Transport layer 2 routers with ebgp feeds exist. These two routers exchange prefixes via ibgp. Anything from the transport to customer access, where the prefixes reside, exchange routing information using an IGP. The idea was to have a /24 prefix exit via router A, since the customer does not "like" Router B's transit.
I certainly could use policy routing based oin source at the transport devices to manually set next hops. It doesn't however seem like an ideal situation.
This is actually a pretty cool feature, i didn't even know it existed until I was looking for a solution to advertise a subnet (prefix in BGP talk), only if a certain condition existed. This is exactly what conditional advertisements does
j ai une question j ai achete un routeur cisco 887VA-k9 , je le configuré avec la configuration ci- dessous
si je le lier avec mon pc portable sur l un de ses ports directement ça marche toute est bien ( la connexion internet + m...
Attached policy provides CLI access to the Cisco 4G router over text messaging. Two files are in the attached .tar file:
2. PDF with instructions on how to load and use the .tcl file.