Update BGP route policies
This guide describes how to do the following updates to BGP route policies for Cloud Router:
- Remove a BGP route policy
- Add BGP route policy terms
- Update BGP route policy terms
- Remove BGP route policy terms
Remove a BGP route policy
Run the following:
gcloud beta compute routers remove-route-policy ROUTER_NAME \ --policy-name=BGP_ROUTE_POLICY_NAME
Replace the following:
ROUTER_NAME
: the name of your Cloud RouterBGP_ROUTE_POLICY_NAME
: the name of the BGP route policy that you want to remove
Add a BGP route policy term
Run the following:
gcloud beta compute routers add-route-policy-term ROUTER_NAME \ --policy-name=BGP_ROUTE_POLICY_NAME \ --priority=PRIORITY \ --match=CEL_MATCH_EXPRESSION \ --actions=CEL_ACTIONS_EXPRESSION
Replace the following:
ROUTER_NAME
: the name of your Cloud RouterBGP_ROUTE_POLICY_NAME
: the name of the BGP route policy that you want to exportPRIORITY
: the order of this term within the BGP route policy, where lower values indicate higher priority. The accepted range is [0, 2^31).CEL_MATCH_EXPRESSION
: a Common Expression Language (CEL) element that matches routes that this term applies toCEL_ACTIONS_EXPRESSION
: a semicolon separated CEL expression for actions to take for items that match this rule
Update a BGP route policy term
Run the following:
gcloud beta compute routers update-route-policy-term ROUTER_NAME \ --policy-name=BGP_ROUTE_POLICY_NAME \ --priority=PRIORITY \ --match=CEL_MATCH_EXPRESSION \ --actions=CEL_ACTIONS_EXPRESSION
Replace the following:
ROUTER_NAME
: the name of your Cloud RouterBGP_ROUTE_POLICY_NAME
: the name of the BGP route policy that you want to exportPRIORITY
: The order of this term within the BGP route policy, where lower values indicate higher priority. The accepted range is [0, 2^31).CEL_MATCH_EXPRESSION
: a CEL element that matches routes that this term applies toCEL_ACTIONS_EXPRESSION
: a semicolon separated CEL expression for actions to take for items that match this ruleBGP_ROUTE_POLICY_NAME
: the name of the BGP route policy that you want to export
Remove a BGP route policy term
Run the following:
gcloud beta compute routers remove-route-policy-term ROUTER_NAME \ --policy-name=BGP_ROUTE_POLICY_NAME \ --priority=PRIORITY
Replace the following:
ROUTER_NAME
: the name of your Cloud RouterBGP_ROUTE_POLICY_NAME
: the name of the BGP route policy that you want to exportPRIORITY
: the order of this term within the BGP route policy, where lower values indicate higher priority. The accepted range is [0, 2^31).