This is a nice email I got from an engineer struggling with multi-homing BGP setup:
We faced a problem with our internet routers a few days back. The engineer who configured them earlier used the syntax: network x.x.x.x mask y.y.y.y route-map PREPEND to influence the incoming traffic over two service-providers.
We weren't getting the desired results so I changed the configuration from up above to: neighbor x.x.x.x route-map PREPEND and to my surprise everything started working fine as before. Is there a difference between to the two sets of configuration?
The network route-map command uses a route map to change the attributes of an IP prefix as it’s inserted in the BGP table. You can set BGP communities and change MED, local preference and next hop (I wouldn’t change the next hop), but not AS-path (Quagga can do that as well). If the route-map doesn’t match the IP prefix, the attributes are not changed (but I wouldn’t use a route-map with a match statement in the network command).
Neighbor route-map in|out command applies a route map to BGP updates received or sent to a neighbor. It’s not just an attribute modifying tool, it’s also a filter – if the route map doesn’t match a BGP prefix, the inbound update gets dropped before it’s inserted in the BGP table, or the BGP prefix never gets sent to the BGP neighbor.
Route map applied to a BGP neighbor can change most BGP attributes that make sense (example: you cannot change local preference if the neighbor is not in the same AS) and prepend AS numbers to the AS path (you’re not allowed to modify AS path directly, as that might bypass BGP loop prevention mechanisms).
On top of obvious sanity checks, the router applies the usual BGP route reflector safeguards: if the neighbor is a route reflector client, you cannot change any attributes of reflected routes with an outbound route-map (but you can change attributes of routes you’ve received from EBGP neighbors). If you want to change attributes of IBGP prefixes sent to route reflector clients, you have to modify them as you receive them from other neighbors with inbound route-maps.