While using BGP attribute local-preference can we tweak both incoming and outgoing traffic ?
kindly refer a scenario to explain ?
LP is local to AS so it will affect in same AS. It is used for out going path selection while more than one or mulltiple BGP routes are avalable. For incomming path use can use MED it is transitive in EBGP neiboure.
Agree. Local preference will affect how traffic will leve your AS. It affects all BGP speaking routers within that AS, meaning it's transitive only within your AS.
MED and AS path prepending can be used to hint to your upstream neighbor how they should send traffic into your AS.
It all depends on your perspective!
If you are talking in general about your AS, then the answers that Jitendra and ErickB gave are spot on.
If you're talking about router-to-router within your own AS, then things are a little different.
Remember that routing takes place based on local decisions per router. So if I start changing the local pref, and you get that, I can influence the path selection that you'll take towards me (incoming) as well as my own decision for going out (outgoing) can be made.
Local Preference is a non-transitive value though, meaning that whatever you set will only be passed to other speakers with your autonomous system.