Hello
I have tried to set AS Prepend on Peer2 to make Rx (incoming traffic) less preferable path. However, no matter what AS Prepend number I tried, 5, 10, and 15, it seems no difference. Rx is still more than Rx on Peer1.
Notes: after the filter modified, I did run /routing BGP peer refresh (peername).
The upstream did see more my AS numbers.
Even if prepend is working correctly, you have little control on how people send traffic to your AS.
They can override your prepend with their weight/local-pref. It is also possible that the people sending traffic to you only have peer2 as upstream.
In order to receive full routing table, what is a correct in-filter?
If you want to receive every prefix that your peer advertises, than do not use a filter or do not set any prefix related parameters in the filter.
You might want to deny some prefixes to protect your network from misconfigurations though (eg: filter martians/bogons networks, your own IP ranges, etc.).
Set Weight or Set Local Preference in which filter, in-filter or out-filter?
Weight and local preference are set when you receive routes from a peer, so it is defined in an in-filter.
For example:
/routing bgp peer
add in-filter=peer1-in name=peer1 remote-address=10.0.0.1 remote-as=100
/routing filter
add chain=peer1-in set-bgp-local-pref=200
[admin@MikroTik] /routing> /ip route print detail
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
0 ADC dst-address=10.0.0.0/24 pref-src=10.0.0.2 gateway=ether3 gateway-status=ether3 reachable distance=0 scope=10
1 ADb dst-address=192.168.2.0/24 gateway=10.0.0.1 gateway-status=10.0.0.1 reachable via ether3 distance=20 scope=40 target-scope=10 bgp-as-path="100" bgp-local-pref=200 bgp-med=0 bgp-origin=igp received-from=peer1
2 ADb dst-address=192.168.87.0/24 gateway=10.0.0.1 gateway-status=10.0.0.1 reachable via ether3 distance=20 scope=40 target-scope=10 bgp-as-path="100" bgp-local-pref=200 bgp-med=0 bgp-origin=igp received-from=peer1
3 ADb dst-address=192.168.122.0/24 gateway=10.0.0.1 gateway-status=10.0.0.1 reachable via ether3 distance=20 scope=40 target-scope=10 bgp-as-path="100" bgp-local-pref=200 bgp-med=0 bgp-origin=igp received-from=peer1
Weight and local-pref work the same way: routes with highest values are preferred.
However, weight is only local to the router. Local-pref is advertised to your iBGP peers.