# Applicationinstanceip

This element describes an IP address of an [ApplicationInstance](/game-hosting/elements/application/applicationinstance.md). Every ApplicationInstance element has one or more IP addresses. Virtual hosts have both private (internal) and public IP addresses, whereas bare metal hosts normally only have a public IP address, unless you have a custom networking setup.

## Element structure

| Property  | Value type | Required  | Description                                                                            |
| --------- | ---------- | --------- | -------------------------------------------------------------------------------------- |
| ipAddress | string     | Read-only | An IP address                                                                          |
| ipVersion | int        | Read-only | <p><strong>4</strong>: IPv4<br><strong>6</strong>: IPv6</p>                            |
| private   | int        | Read-only | <p><strong>0</strong>: public IP address<br><strong>1</strong>: private IP address</p> |

Table 1: ApplicationInstanceIP element structure

## Public and private IP addresses

An ApplicationInstance will have at least one public IP address. An instance deployed onto a VM will additionally have at least one private IP address ([RFC 1918](https://tools.ietf.org/html/rfc1918)). The reason for this is that a VM has no public IP address defined on the host level, but instead gets its public IP address via NAT. This means that the VM host itself only has knowledge of private IP addresses and not any public ones. The illustration below explains this further:

\[!\[]\(images/BM-&-VM-ip-address-assignment.png "BM & VM IP address assignment.png")]\(images/BM-&-VM-ip-address-assignment.png)\
Figure 1: BM & VM IP address assignment

Our platform has knowledge about all IP addresses involved with a bare metal server or VM. As such it can populate an [ApplicationInstance](/game-hosting/elements/application/applicationinstance.md) element with all public and private IP addresses related to the host it's deployed on.

## IP address binding

If you must bind a specific IP address to your application's socket(s), care must be taken during configuration of your [Application](/game-hosting/elements/application.md)'s properties.

When configuring an application, you can use [platform variables](/game-hosting/elements/application/platform-variables.md) in your application's startup parameters or configuration file(s). If you have a socket that must be bound to a specific IP address, note that you should use the platform variable VARIPV4BINDING or VARIPV6BINDING. These variables contain the correct IP addresses to use for socket binding, depending on whether your application is being deployed onto a bare metal (BM) server or a cloud VM. If it concerns a BM, a public IP address will be used. Otherwise, on a VM, its private IP address will be used, allowing your application to bind to the correct socket.

If you specifically need the public IP addresses of an ApplicationInstance during Application configuration, you can use the platform variable VARIPV4PUBLIC. See the chapter on [platform variables](/game-hosting/elements/application/platform-variables.md) for all available platform variables.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.i3d.net/game-hosting/elements/application/applicationinstanceip.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
