Hello,
i know weight and local pref do same things for outbound routes, and weight is for cisco devices, but the question here is whats the main difference between them? when should we use weight and when should we use local pref?
for example when you have 4m routes installed in your route table, using local pref is better or weight and which one works faster for change outbound route when one of our bgp session die?
The main difference is that local-pref can be advertised to remote peers, weight cannot. If you want to control selection only locally on single router then use weight.
Regarding performance I doubt that you will notice few second difference on total amount of time needed to process 4M routes.
Hello,
actually i was using weight and when one of my bgp session died it takes about 5-10m for switch the outbound traffic to other peers but with local pref right now it takes about 2m , so in the speed i think local pref is winner, so I want to check with your guys if i am wrong in this case about speed or not.
and my explanations was general and i know because right now MT use signle thread for bgp needs more time for switch to other peers.
I do not think that cause of such a different performance is caused just by changing whether you set weight or pref-src.
There is no significant difference between both in terms of performance.
Total time can be affected which peer starts to load routes first and if these routes will be best routes even after other peers starts to load routes.
For example lets say peer receives and installs 200k routes, while receiving rest of the routes peer2 starts to receive routes which are more preferred, now already added 200k routes must be removed from FIB and readded with new ones which takes additional time. Probably that is what happened in your case when you saw performance increase. Simply first peer that loaded routes installed best route from the beginning.
Hello,
right now everything is clear and i understood.
just a question is there any way that set which peers first start to load and install routes and for example if that peer was not existed then load the second peer and install their routes in FIB?
thank you.