Can we change metric2 of a BGP prefix?
For BGP routes, metric corresponds to the MED, and metric2 corresponds to the IGP metric if the BGP next hop loops through another router
You can create routing policy with any action, but only actions relevant to the protocol will be executed. So, can't set external type for BGP routes nor add community to routes exported to OSPF and the like.
Regarding route preference, it's local value (device specific) and you can't set it in export policy. Additionally, OSPF import policy is limited to filtering OSPF external routes (from going into RIB), other actions are not effective.
Please click here for more information on the summary of Key Routing Policy Actions
Citation - This blog post does not reflect original content from the author. Rather it summarizes content that are relevant to the topic from different sources in the web. The sources might include any online discussion boards, forums, websites and others.