[Yandex Cloud documentation](../../index.md) > [Yandex Virtual Private Cloud](../index.md) > [Step-by-step guides](index.md) > IP address > Converting a static public IP address to dynamic

# Converting a static public IP address to dynamic

You can convert a static [public IP address](../concepts/address.md#public-addresses) assigned to a cloud resource to dynamic. If a VM uses a dynamic IP address, it gets lost when the VM is stopped and changes when it is started again.

{% list tabs group=instructions %}

- Management console {#console}

   1. In the [management console](https://console.yandex.cloud), select the folder containing the address.
   1. Navigate to **Virtual Private Cloud**.
   1. In the left-hand panel, select ![image](../../_assets/console-icons/map-pin.svg) **Public IP addresses**.
   1. Click ![image](../../_assets/console-icons/ellipsis.svg) in the row of the IP address and select **Make dynamic**.
   1. In the window that opens, click **Change**.

- CLI {#cli}

   If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

   The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

   1. See the description of the CLI commands for updating the address attributes:

      ```bash
      yc vpc address update --help
      ```

   1. Get a list of addresses in the default folder:

      ```bash
      yc vpc address list
      ```

      Result:

      ```text
      +----------------------+------+---------------+----------+------+
      |          ID          | NAME |    ADDRESS    | RESERVED | USED |
      +----------------------+------+---------------+----------+------+
      | e2l46k8conff******** |      | 84.201.177.41 | true     | true |
      +----------------------+------+---------------+----------+------+
      ```

      The `true` value of the `reserved` parameter for the IP address with the `e2l46k8conff********` ID shows that this address is static.

   1. Convert it to dynamic by using the `--reserved=false` parameter and the address ID:

      ```bash
      yc vpc address update --reserved=false e2l46k8conff********
      ```

      Result:

      ```text
      id: e2l46k8conff********
      folder_id: b1g7gvsi89m3********
      created_at: "2021-01-14T09:36:46Z"
      external_ipv4_address:
        address: 84.201.177.41
        zone_id: ru-central1-a
        requirements: {}
      used: true
      ```

      The IP address is now dynamic.

- API {#api}

  To change the type of a public IP address from static to dynamic, use the [update](../api-ref/Address/update.md) REST API method for the [Address](../api-ref/Address/index.md) resource or the [AddressService/Update](../api-ref/grpc/Address/update.md) gRPC API call, and provide the following in the request:

  * ID of the IP address you want to convert to dynamic, in the `addressId` parameter.

    To get the address ID, use the [list](../api-ref/Address/list.md) REST API method for the [Address](../api-ref/Address/index.md) resource or the [AddressService/List](../api-ref/grpc/Address/list.md) gRPC API call and provide the folder ID in the `folderId` request parameter.

    To learn how to find out the folder ID, see [Getting the folder ID](../../resource-manager/operations/folder/get-id.md).

  * `false` in the `reserved` parameter.
  * Name of the `reserved` parameter in the `updateMask` parameter.

  {% note warning %}
  
  The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the `updateMask` parameter as a single comma-separated string.
  
  {% endnote %}

{% endlist %}