Hello Emanuel
Just a clarification. Local preference is a BGP attribute, but AS prepend is not an attribute itself, but it is a method used to manipulate the AS path length, which is an attribute.
Local preference is applied within an autonomous system and is used to choose the outbound eBGP path to a particular prefix. Local preference changes can be applied using route maps in an inbound or outbound direction, between BGP neighbours. Remember, the direction has to do with the BGP updates and not the traffic itself! For example, if you apply the following route map:
R3(config)#router bgp 2
R3(config-router)#neighbor 192.168.13.1 route-map LOCALPREF in
the changes made to the local preference attribute by the LOCALPREF route-map will be applied to all prefixes in BGP updates sent from this neighbour inbound to the local router.
You can find out more detailed information about the local preference attribute and how to manipulate it in the BGP Local Preference lesson.
The AS Path Length attribute on the other hand has to do with the length of the AS to a particular prefix. You can manipulate this attribute to adjust BGP path selection by using AS prepending. Like local preference, the AS Path Length can be adjusted by applying a route map to a neighbour. The same concept applies: the direction of application has to do with the direction of the BGP update and not the direction of the actual user traffic.
So, for example, if we have the following configuration:
R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 route-map PREPEND out
then the changes made to the AS path that are configured in the PREPEND route map will be applied to all of the prefixes found within the BGP update that is being sent outbound to the specific BGP neighbour. In other words, this particular neighbour will receive a BGP update with prefixes that have an adjusted AS path, as per the PREPEND route map.
For more information about AS prepending, take a look at the BGP AS Path Prepending lesson.
I hope this has been helpful!
Laz