Making a dynamic public IP address static
You can make a dynamic public IP address static. Static public IP addresses are reserved and remain attached to respective resources when VMs and network load balancers are stopped.
Note
Pay attention to the pricing policy for inactive static public IPs.
To change a public IP address from dynamic to static:
- In the management console, select the folder containing the appropriate address.
- In the list of services, select Virtual Private Cloud.
- On the left-hand panel, select IP addresses.
- Click
- In the menu that opens, select Make static.
- In the window that opens, click Change.
If you don't have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To change a public IP address from dynamic to static:
-
See the description of the CLI's update address attribute command:
yc vpc address update --help
-
Get a list of addresses in the default folder:
yc vpc address list
Result:
+----------------------+------+---------------+----------+------+ | ID | NAME | ADDRESS | RESERVED | USED | +----------------------+------+---------------+----------+------+ | e2l46k8conff8n6ru1jl | | 84.201.177.41 | false | true | +----------------------+------+---------------+----------+------+
The
false
value of the RESERVED parameter of the IP address with the IDe2l46k8conff8n6ru1jl
shows that this address is dynamic. -
Make the address static by using the
--reserved=true
key and address ID:yc vpc address update --reserved=true e2l46k8conff8n6ru1jl
Result:
id: e2l46k8conff8n6ru1jl folder_id: b1g7gvsi89m34pipa3ke created_at: "2021-01-14T09:36:46Z" external_ipv4_address: address: 84.201.177.41 zone_id: ru-central1-a requirements: {} reserved: true used: true
The
reserved
parameter value changed totrue
and the IP address is now static.