Skip to main content

ip_addresses

Creates, updates, deletes, gets or lists an ip_addresses resource.

Overview

Nameip_addresses
TypeResource
Idlinode.linode.ip_addresses

Fields

The following fields are returned by SELECT queries:

A single IP address.

NameDatatypeDescription
interface_idintegerBeta, 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_idintegerRead-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.
addressstring (ip)Read-only The IP address. (example: 97.107.143.141)
gatewaystring (ip)Read-only The default gateway for this address. (example: 97.107.143.1)
prefixintegerRead-only The number of bits set in the subnet mask.
publicbooleanRead-only Whether this is a public or private IP address.
rdnsstringThe 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)
regionstringRead-only The Region this IP address resides in. (example: us-east)
subnet_maskstring (ip)Read-only The mask that separates host bits from network bits for this address. (example: 255.255.255.0)
typestringRead-only The type of address this is. (example: ipv4)
vpc_nat_1_1objectIPv4 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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_linode_ipselectView information for a Linode's set of IPs, its Linode interfaces and VPC IPs and ranges.

Learn more...

Learn more...
get_linode_ipsselectReturns 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_ipinsertdata__type, data__publicAllocates 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_ipreplacedata__rdnsUpdates 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_ipdeleteDeletes 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.

NameDatatypeDescription

SELECT examples

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;

INSERT examples

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
;

REPLACE examples

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

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;