Can you help me clarify this on route-maps:
Please find attached a diagram and the following config for "RouterC":
RouterC(config)#router bgp 100
RouterC(config-router)#neig 192.168.5.2 route-map LOCAL in
RouterC(config)#router-map LOCAL permit 10
RouterC(config)#set local-preference 300
Imagine I want to force traffic to use the "CD" link to
reach the 192.168.10.0/24 and 192.168.11.0/24 networks.
I can't understand why on "neig 192.168.5.2 route-map LOCAL"
line, it is being used "in". Why not "out" ?
Can you clarify what's the logic used to determine
whether I should use "in" or "out" in this case ?
You want to apply it inbound.
In the case of local preference you cannot really send it outbound to a EBGP neighbor. This parameter is only used within a AS.
A more generic explination is that if you want to affect outbound TRAFFIC you set the attributes on the ROUTES as they enter the router. To affect inbound TRAFFIC you set the attributes on the ROUTES as they leave the router.
Local preference is a BGP attribute used to influence path selection when multiple paths are available to get to a specific network. Higher local preference is preferrred. Default value is 100. The local preference value stays local to the AS and isn't carried over in updates to another AS.
You need to apply the route map inbound because you want to set the local-pref to 300 for any routes learnt from RouterC as you want it to be the preferred path to get to networks 192.168.10.0/24 and 192.168.11.0/24. If you are learning the same two networks from RouterA then they would have the default local-pref value of 100, which is lower, and wouldn't be preferred.