ip_addresses
Creates, updates, deletes, gets or lists an ip_addresses
resource.
Overview
Name | ip_addresses |
Type | Resource |
Id | linode.linode.ip_addresses |
Fields
The following fields are returned by SELECT
queries:
- get_linode_ip
- get_linode_ips
A single 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. |
Requested Linode's networking configuration.
Name | Datatype | Description |
---|---|---|
ipv4 | object | Read-only Information about this Linode's IPv4 addresses. |
ipv6 | object | Read-only Information about this Linode's IPv6 addresses. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get_linode_ip | select | View information for a Linode's set of IPs, its Linode interfaces and VPC IPs and ranges. Learn more... Learn more... | ||
get_linode_ips | select | Returns networking information for a single Linode. > 📘 > > If the target Linode has several configuration profiles that include a Virtual Private Cloud (VPC) interface, the response lists address information for all of the VPCs. Learn more... Learn more... | ||
post_add_linode_ip | insert | data__type , data__public | Allocates a public or private IPv4 address to a Linode. Public IP Addresses, after the one included with each Linode, incur an additional monthly charge. If you need an additional public IP Address you must request one - please Open a support ticket. You may not add more than one private IPv4 address to a single Linode. Learn more... Learn more... | |
put_linode_ip | replace | data__rdns | Updates the reverse DNS (RDNS) for a Linode's IP Address. This may be done for both IPv4 and IPv6 addresses. Setting the RDNS to null for a public IPv4 address, resets it to the default ip.linodeusercontent.com RDNS value.Learn more... Learn more... | |
delete_linode_ip | delete | Deletes a public or private IPv4 address associated with this Linode. This will fail if it is the Linode's last remaining public IPv4 address, or if the address has a 1:1 NAT with an active VPC Subnet address. > 📘 > > You can't use this operation to delete an IP assigned to a Linode interface. Run the update the Linode interface operation instead. 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 |
---|
SELECT
examples
- get_linode_ip
- get_linode_ips
View information for a Linode's set of IPs, its Linode interfaces and VPC IPs and ranges.
Learn more...
Learn more...
SELECT
interface_id,
linode_id,
address,
gateway,
prefix,
public,
rdns,
region,
subnet_mask,
type,
vpc_nat_1_1
FROM linode.linode.ip_addresses;
Returns networking information for a single Linode.
> 📘
>
> If the target Linode has several configuration profiles that include a Virtual Private Cloud (VPC) interface, the response lists address information for all of the VPCs.
Learn more...
Learn more...
SELECT
ipv4,
ipv6
FROM linode.linode.ip_addresses;
INSERT
examples
- post_add_linode_ip
- Manifest
Allocates a public or private IPv4 address to a Linode. Public IP Addresses, after the one included with each Linode, incur an additional monthly charge. If you need an additional public IP Address you must request one - please Open a support ticket. You may not add more than one private IPv4 address to a single Linode.
Learn more...
Learn more...
INSERT INTO linode.linode.ip_addresses (
data__public,
data__type
)
SELECT
{{ public }} --required,
'{{ type }}' --required
RETURNING
interface_id,
linode_id,
address,
gateway,
prefix,
public,
rdns,
region,
subnet_mask,
type,
vpc_nat_1_1
;
# Description fields are for documentation purposes
- name: ip_addresses
props:
- name: public
value: boolean
description: >
Whether to create a public or private IPv4 address.
- name: type
value: string
description: >
The type of address you are allocating. Only IPv4 addresses may be allocated through this operation.
valid_values: ['ipv4']
REPLACE
examples
- put_linode_ip
Updates the reverse DNS (RDNS) for a Linode's IP Address. This may be done for both IPv4 and IPv6 addresses.
Setting the RDNS to null
for a public IPv4 address, resets it to the default ip.linodeusercontent.com
RDNS value.
Learn more...
Learn more...
REPLACE linode.linode.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;
DELETE
examples
- delete_linode_ip
Deletes a public or private IPv4 address associated with this Linode. This will fail if it is the Linode's last remaining public IPv4 address, or if the address has a 1:1 NAT with an active VPC Subnet address.
> 📘
>
> You can't use this operation to delete an IP assigned to a Linode interface. Run the update the Linode interface operation instead.
Learn more...
Learn more...
DELETE FROM linode.linode.ip_addresses;