Viewing a list of addresses used in a subnet
You can view internal IP addresses that are assigned to cloud resources in your folder.
To view a list of internal addresses used in a subnet:
- In the management console
, go to the folder containing your subnet. - In the list of services, select Virtual Private Cloud.
- In the left-hand panel, select
Subnets. - Click the subnet name.
- Navigate to the IP addresses tab.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder through the --folder-name
or --folder-id
parameter.
-
View the description of the CLI command to get a list of addresses in use:
yc vpc subnet list-used-addresses --help
-
Get a list of addresses in the selected subnet:
yc vpc subnet list-used-addresses --name <subnet_name>
Result:
+-----------+------------+---------------------------------------+ | ADDRESS | IP VERSION | REFERENCES | +-----------+------------+---------------------------------------+ | 10.1.2.1 | IPV4 | vpc.virtualGateway: | | 10.1.2.2 | IPV4 | vpc.virtualDns: | | 10.1.2.3 | IPV4 | compute.instance:epdf6lfsaki9******** | | 10.1.2.15 | IPV4 | compute.instance:epdb2hmhj935******** | | 10.1.2.28 | IPV4 | managedKubernetes.cluster: | +-----------+------------+---------------------------------------+
Use the listUsedAddresses REST API method for the Subnet resource or the SubnetService/ListUsedAddresses gRPC API call and provide the ID of the subnet you want to update in the subnetId
request parameter.
To get the subnet ID, use the list REST API method for the Subnet resource or the SubnetService/List 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.