ip_addresses
Creates, updates, deletes, gets or lists an ip_addresses
resource.
Overview
Name | ip_addresses |
Type | Resource |
Id | linode.networking.ip_addresses |
Fields
The following fields are returned by SELECT
queries:
- get_ip
- get_ips
The requested IP Address.
Name | Datatype | Description |
---|---|---|
interface_id | integer | Beta, Read-only The Linode interface ID that this IP address is assigned to. This value is null if a Linode interface is not assigned, or if the IP is assigned to a legacy configuration profile interface. |
linode_id | integer | Read-only The ID of the Linode this address currently belongs to. For IPv4 addresses, this is by default the Linode that this address was assigned to on creation, and these addresses may be moved using the Assign IPv4s to Linodes operation. For SLAAC and link-local addresses, this value can't be changed. |
address | string (ip) | Read-only The IP address. (example: 97.107.143.141) |
gateway | string (ip) | Read-only The default gateway for this address. (example: 97.107.143.1) |
prefix | integer | Read-only The number of bits set in the subnet mask. |
public | boolean | Read-only Whether this is a public or private IP address. |
rdns | string | The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode if not explicitly set. (example: test.example.org) |
region | string | Read-only The Region this IP address resides in. (example: us-east) |
subnet_mask | string (ip) | Read-only The mask that separates host bits from network bits for this address. (example: 255.255.255.0) |
type | string | Read-only The type of address this is. (example: ipv4) |
vpc_nat_1_1 | object | IPv4 address configured as a 1:1 NAT for this Interface. If no address is configured as a 1:1 NAT, null is returned. > 📘 > > Only allowed for vpc type interfaces. |
A paginated list of IP Addresses.
Name | Datatype | Description |
---|---|---|
interface_id | integer | Beta, Read-only The Linode interface ID this public IP address is assigned to. This value is null if a Linode interface is not assigned, or if the IP is assigned to a legacy configuration profile interface. |
linode_id | integer | Read-only The ID of the Linode this address currently belongs to. For IPv4 addresses, this defaults to the Linode that this address was assigned to on creation. IPv4 addresses may be moved using the Assign IPv4s to Linodes operation. For SLAAC and link-local addresses, this value may not be changed. |
address | string (ip) | Filterable, Read-only The IP address. (example: 192.0.2.141) |
gateway | string (ip) | Read-only The default gateway for this address. (example: 192.0.2.1) |
prefix | integer | Filterable, Read-only The number of bits set in the subnet mask. |
public | boolean | Read-only Whether this is a public or private IP address. |
rdns | string | Filterable The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode if not explicitly set. (example: test.example.org) |
region | string | Filterable, Read-only The Region this IP address resides in. (example: us-east) |
subnet_mask | string (ip) | Read-only The mask that separates host bits from network bits for this address. (example: 255.255.255.0) |
type | string | Filterable, Read-only The type of address this is. (example: ipv4) |
vpc_nat_1_1 | object | IPv4 address configured as a 1:1 NAT for this interface. Empty if no address is configured as a 1:1 NAT. > 📘 > > Only allowed for vpc type interfaces. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_ip | select | Returns information about a single IP Address on your Account. Learn more... Learn more... | ||
get_ips | select | skip_ipv6_rdns | Returns a paginated list of IP addresses on your account for Linodes or Linode interfaces, excluding private addresses. > 👍 > > if your application frequently accesses this operation and doesn't require IPv6 RDNS data, you can use the skip_ipv6_rdns query string to improve performance.Learn more... Learn more... | |
put_ip | replace | data__rdns | Sets RDNS on an IP Address. Forward DNS must already be set up for reverse DNS to be applied. If you set the RDNS to null for public IPv4 addresses, it will be reset to the default ip.linodeusercontent.com RDNS value.Learn more... Learn more... | |
post_allocate_ip | exec | type , public , linode_id | Allocates a new IPv4 Address on your Account. The Linode must be configured to support additional addresses - please Open a support ticket requesting additional addresses before attempting allocation. > 📘 > > You can run this operation for Linodes with legacy configuration interfaces. You can't use it for Linodes with Linode interfaces. To allocate an IP for a Linode with Linode interfaces, use the Add a Linode interface operation and set the public IPv4 address to auto .Learn more... Learn more... | |
post_assign_ips | exec | region , assignments | Assign any set of IPv4 addresses and IPv6 ranges to Linodes in one region. This allows swapping, shuffling, or otherwise reorganizing IPs among your Linodes. The following restrictions apply: - All Linodes need to have at least one public IPv4 address assigned. - For Linode interfaces, the Linode needs to have a public interface, and the address it receives can't be a private IPv4 address. - Linodes may have no more than one assigned private IPv4 address. - Linodes may have no more than one assigned IPv6 range. - Shared IP addresses cannot be swapped between Linodes. Open a support ticket to request additional IPv4 addresses or IPv6 ranges beyond standard account limits. > 📘 > > Removing an IP address that has been set as a Managed Linode's ssh.ip causes the Managed Linode's SSH access settings to reset to their default values.To view and configure Managed Linode SSH settings, use the following operations: - Get a Linode's managed settings - Update a Linode's managed settings > 📘 > > Addresses with an active 1:1 NAT to a VPC Interface address cannot be assigned to other Linodes. Learn more... Learn more... | |
post_share_ips | exec | linode_id , ips | Configure shared IPs. IP sharing allows IP address reassignment (also referred to as IP failover) from one Linode to another if the primary Linode becomes unresponsive. This means that requests to the primary Linode's IP address can be automatically rerouted to secondary Linodes at the configured shared IP addresses. IP failover requires configuration of a BGP based failover service within the internal system of the primary Linode. > 📘 > > A public IPv4 address can't be shared if it's configured for a 1:1 NAT on a legacy configuration profile VPC interface or on a Linode VPC interface. Learn more... Learn more... |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
skip_ipv6_rdns | boolean | When true , the rdns property for any ipv6 type addresses always returns null regardless of whether RDNS data exists for the address. |
SELECT
examples
- get_ip
- get_ips
Returns information about a single IP Address on your Account.
Learn more...
Learn more...
SELECT
interface_id,
linode_id,
address,
gateway,
prefix,
public,
rdns,
region,
subnet_mask,
type,
vpc_nat_1_1
FROM linode.networking.ip_addresses;
Returns a paginated list of IP addresses on your account for Linodes or Linode interfaces, excluding private addresses.
> 👍
>
> if your application frequently accesses this operation and doesn't require IPv6 RDNS data, you can use the skip_ipv6_rdns
query string to improve performance.
Learn more...
Learn more...
SELECT
interface_id,
linode_id,
address,
gateway,
prefix,
public,
rdns,
region,
subnet_mask,
type,
vpc_nat_1_1
FROM linode.networking.ip_addresses
WHERE skip_ipv6_rdns = '{{ skip_ipv6_rdns }}';
REPLACE
examples
- put_ip
Sets RDNS on an IP Address. Forward DNS must already be set up for reverse DNS to be applied. If you set the RDNS to null
for public IPv4 addresses, it will be reset to the default ip.linodeusercontent.com RDNS value.
Learn more...
Learn more...
REPLACE linode.networking.ip_addresses
SET
data__rdns = '{{ rdns }}'
WHERE
data__rdns = '{{ rdns }}' --required
RETURNING
interface_id,
linode_id,
address,
gateway,
prefix,
public,
rdns,
region,
subnet_mask,
type,
vpc_nat_1_1;
Lifecycle Methods
- post_allocate_ip
- post_assign_ips
- post_share_ips
Allocates a new IPv4 Address on your Account. The Linode must be configured to support additional addresses - please Open a support ticket requesting additional addresses before attempting allocation.
> 📘
>
> You can run this operation for Linodes with legacy configuration interfaces. You can't use it for Linodes with Linode interfaces. To allocate an IP for a Linode with Linode interfaces, use the Add a Linode interface operation and set the public IPv4 address to auto
.
Learn more...
Learn more...
EXEC linode.networking.ip_addresses.post_allocate_ip
@@json=
'{
"linode_id": {{ linode_id }},
"public": {{ public }},
"type": "{{ type }}"
}';
Assign any set of IPv4 addresses and IPv6 ranges to Linodes in one region. This allows swapping, shuffling, or otherwise reorganizing IPs among your Linodes.
The following restrictions apply:
- All Linodes need to have at least one public IPv4 address assigned.
- For Linode interfaces, the Linode needs to have a public interface, and the address it receives can't be a private IPv4 address.
- Linodes may have no more than one assigned private IPv4 address.
- Linodes may have no more than one assigned IPv6 range.
- Shared IP addresses cannot be swapped between Linodes.
Open a support ticket to request additional IPv4 addresses or IPv6 ranges beyond standard account limits.
> 📘
>
> Removing an IP address that has been set as a Managed Linode's ssh.ip
causes the Managed Linode's SSH access settings to reset to their default values.
To view and configure Managed Linode SSH settings, use the following operations:
- Get a Linode's managed settings
- Update a Linode's managed settings
> 📘
>
> Addresses with an active 1:1 NAT to a VPC Interface address cannot be assigned to other Linodes.
Learn more...
Learn more...
EXEC linode.networking.ip_addresses.post_assign_ips
@@json=
'{
"assignments": "{{ assignments }}",
"region": "{{ region }}"
}';
Configure shared IPs.
IP sharing allows IP address reassignment (also referred to as IP failover) from one Linode to another if the primary Linode becomes unresponsive. This means that requests to the primary Linode's IP address can be automatically rerouted to secondary Linodes at the configured shared IP addresses.
IP failover requires configuration of a BGP based failover service within the internal system of the primary Linode.
> 📘
>
> A public IPv4 address can't be shared if it's configured for a 1:1 NAT on a legacy configuration profile VPC interface or on a Linode VPC interface.
Learn more...
Learn more...
EXEC linode.networking.ip_addresses.post_share_ips
@@json=
'{
"ips": "{{ ips }}",
"linode_id": {{ linode_id }}
}';