# Set up an app connector in MagicIP mode

Last validated Nov 17, 2026

> **Note:** App connectors in MagicIP mode are currently in alpha.

> **Note:**
>
> To request access to use app connectors in MagicIP mode, contact your Tailscale account team.

MagicIP mode lets you route traffic to applications through an [app connector][docs-app-connectors] without advertising a subnet route for each destination IP address. Use it for applications behind a content delivery network (CDN) or domains that resolve to many IP addresses, such as `*.amazonaws.com`.

## Prerequisites

To set up an app connector in MagicIP mode, you need:

* The [Owner, Admin, or Network admin](/docs/reference/user-roles/) role to edit the tailnet policy file and manage app connector settings in the admin console.
* A Linux device, already connected to your tailnet, to use as the connector. The device must have internet access. You can use a physical device or a virtual machine (VM). In Step 2, you will enable IPv4 and IPv6 forwarding on this device.
* The [latest unstable Tailscale release][pk-unstable] on every client and connector. Clients must run Tailscale v1.105.181 or later.
* A public software as a service (SaaS) or self-hosted application to route traffic to. If you want to restrict access to the connector's public IP addresses, you also need the ability to configure an IP allowlist.

> **Warning:**
>
> During the alpha, a modified client could request access through a connector to public IP addresses outside the domains in its app definitions. Treat connectors in MagicIP mode as equivalent to exit nodes for security purposes. Use this mode only for public applications, not internal applications.

## How it works

MagicIP mode uses two types of devices:

* A **client** is a device running an application that connects to a configured domain.
* A **connector** is a Linux device that resolves the destination and forwards traffic for that domain.

Classic app connectors advertise subnet routes for destination IP addresses, and DNS responses contain the public IP addresses of those destinations. In MagicIP mode, the client allocates MagicIP addresses that are meaningful only on that device and returns them in DNS responses.

When an application connects to a MagicIP address, the client selects a connector for the app and sends the traffic to it over WireGuard. The connector forwards the traffic to the application's real IP address. This reduces the number of advertised routes and lets clients select connectors for each app.

### Address pools

MagicIP mode uses two address pools defined for the tailnet and shared by all app definitions:

| Pool         | Purpose                                 | Default range           |
| ------------ | --------------------------------------- | ----------------------- |
| IPv4 MagicIP | Addresses returned in DNS A records.    | `87.81.192.0/20`        |
| IPv6 MagicIP | Addresses returned in DNS AAAA records. | `2606:b740:0:c025::/64` |

All clients use the same address ranges, but each client allocates addresses independently. The same MagicIP address can represent different destinations on different clients. MagicIP addresses aren't visible outside the device.

## Get started

To use MagicIP mode, define an app and grant access to it in your tailnet policy file, configure a Linux device as its connector, and verify connectivity from a client.

### Step 1. Configure the tailnet policy file

Open the [Access controls](https://console.tailscale.com/admin/acls) page of the admin console to edit your [tailnet policy file][docs-tailnet-policy-file]. The examples use `tag:connector` for the connector and `group:app-users` for users who can access the app. Before adding the app definition, [create the tag][docs-tags] and [define the group][docs-policy-file-groups], or replace them with an existing tag and group. Make sure your account can assign the connector tag.

#### Define an app

> **Warning:**
>
> MagicIP mode is the next generation of app connectors. During the alpha, the policy syntax and capability name are subject to change.

Add an app definition to the `nodeAttrs` section under the `tailscale.com/app-connectors` capability. Set `mode` to `magicip`:

```json
{
  "nodeAttrs": [
    {
      "target": ["*"],
      "app": {
        "tailscale.com/app-connectors": [
          {
            "name": "example-app",
            "connectors": ["tag:connector"],
            "domains": ["*.example.com"],
            "mode": "magicip",
          },
        ],
      },
    },
  ],
  // Other tailnet policy options
}
```

| Field        | Description                                                                                                                                                        |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `name`       | A unique, lowercase app name, displayed in the admin console and referenced by grants.                                                                             |
| `connectors` | One or more tags identifying the connector devices that serve the app's domains.                                                                                   |
| `domains`    | Domains to route through the connector. Wildcards are supported for subdomains, such as `*.example.com`, but not for top-level domains, such as `*.com`.           |
| `mode`       | Set to `magicip` for MagicIP mode. The default, `subnet`, uses classic app connector behavior. You can use different modes for different apps in the same tailnet. |

During the alpha, `target` must be `["*"]`. This includes the tagged connectors and the users who might use the app. App definitions apply across the tailnet, but your access control policies must make the app's connectors visible to clients. If a connector isn't visible to a client, DNS requests for the app's domains fail.

#### Grant access to the app

Add a [grant][docs-grants] for the users or devices that need access. Use `appc:<app-name>` as the destination, where `<app-name>` matches the app definition's `name` field. For `example-app`, the destination is `appc:example-app`:

```json
{
  "grants": [
    {
      "src": ["group:app-users"],
      "dst": ["appc:example-app"],
      "ip": ["*"],
    },
  ],
  // Other tailnet policy options
}
```

Grants apply to each app independently, so you can give different groups access to different apps. During the alpha, `autogroup:internet` doesn't automatically match app destinations. Add an explicit grant for each app.

#### Combined policy example

The following example combines the app definition and grant. Merge these entries into your existing policy file, keeping your group and tag definitions and other policy settings.

```json
{
  "nodeAttrs": [
    {
      "target": ["*"],
      "app": {
        "tailscale.com/app-connectors": [
          {
            "name": "example-app",
            "connectors": ["tag:connector"],
            "domains": ["*.example.com"],
            "mode": "magicip",
          },
        ],
      },
    },
  ],

  "grants": [
    {
      "src": ["group:app-users"],
      "dst": ["appc:example-app"],
      "ip": ["*"],
    },
  ],
  // Other tailnet policy options
}
```

### Step 2. Configure a device as a connector

A connector in MagicIP mode runs the standard Tailscale daemon, `tailscaled`. You don't need to install an additional binary.

1. On the Linux connector, enable IPv4 and IPv6 forwarding:

   ```shell
   sudo sysctl -w net.ipv4.ip_forward=1

   sudo sysctl -w net.ipv6.conf.all.forwarding=1
   ```

   Make the settings persistent so they survive a restart. For example, add the following to `/etc/sysctl.d/99-tailscale.conf`:

   ```text
   net.ipv4.ip_forward = 1
   net.ipv6.conf.all.forwarding = 1
   ```

2. Run Tailscale as a connector with the tag from your app definition:

   ```shell
   sudo tailscale up --advertise-connector --advertise-tags=tag:connector
   ```

   The `--advertise-connector` flag lets the device route traffic for app domains in the policy file. The `--advertise-tags` flag authenticates the device with the specified tag.

3. (Optional) To prevent users from accessing the application without the connector, [restrict application access to the connector's public IP addresses][docs-app-connectors-ip-allowlist].

### Step 3. Verify connectivity

Run the following checks on a client that has access to the app. Replace `app.example.com` with a domain covered by your app definition. The example outputs use the default IPv4 MagicIP pool.

1. Query the [Quad100 DNS resolver][docs-quad100]. The response should contain MagicIP addresses:

   ```shell
   dig @100.100.100.100 +short app.example.com
   ```

   Example output:

   ```text
   87.81.192.0
   87.81.192.1
   ```

2. Test connectivity using the application or `ping`. The `ping` command should show a MagicIP address. The destination must respond to ping for you to receive replies.

   ```shell
   ping app.example.com
   ```

   Example output:

   ```text
   PING app.example.com (87.81.192.0) 56(84) bytes of data.
   ```

   The `tailscale ping` command doesn't currently support MagicIP destinations.

3. On a Linux client, check that the Tailscale routing table contains a route for the MagicIP range:

   ```shell
   ip route show table 52 | grep -F 87.81.192.0/20
   ```

   Example output:

   ```text
   87.81.192.0/20 dev tailscale0
   ```

If the client's DNS responses and routes are correct but connections fail, check the connector using the [troubleshooting steps][ar-troubleshooting].

## Add, update, or remove an app

You can manage apps directly in the tailnet policy file:

* To add an app, add an entry under `tailscale.com/app-connectors` with a unique name, connector tags, domains, and `"mode": "magicip"`. Then grant access to the app.
* To update an app, edit its `domains` or `connectors`.
* To remove an app, delete its definition and grants. Traffic to those domains then flows directly from the client, or through an exit node if the client uses one.

## Troubleshooting

| Symptom                                                            | What to check                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| DNS lookups fail for an app domain.                                | Verify that the client runs the latest unstable Tailscale release, at least v1.105.181. Query the domain with `dig @100.100.100.100 <domain>`. Run `tailscale debug localapi v0/conn25/state` to check whether the client's MagicIP pool is exhausted and whether the app's connectors are visible to the client. |
| DNS works, but connections fail.                                   | Run `tailscale debug localapi v0/conn25/state` to check the client's route for the MagicIP range, connector health, and address pool usage.                                                                                                                                                                       |
| Client DNS responses and routes are correct, but connections fail. | Check the connector's `tailscaled` logs. On a Linux connector that uses systemd, run `sudo journalctl -fu tailscaled`.                                                                                                                                                                                            |

> **Warning:**
>
> `tailscale debug localapi v0/conn25/state` is a debugging endpoint that may change in the future. While it is safe to use for troubleshooting, you should not depend on this endpoint for automation.

## Turn off MagicIP mode

To disable MagicIP mode entirely, remove all app connectors running in MagicIP mode from your tailnet. Then, contact your Tailscale Solutions Engineer or Customer Success Engineer to disable the feature flag for your tailnet and restore direct routing or classic app connector routing for the affected domains.

## Limitations

The following limitations apply during the alpha:

* MagicIP mode supports public applications only. Modified clients can request access to public IP addresses outside the domains in an app definition, so treat connectors as equivalent to exit nodes for security purposes.
* High availability (HA), geographic routing with MagicRoute, and regional routing aren't supported.
* Every client that uses a MagicIP app must run the latest unstable Tailscale release. Keep classic app connectors available for clients running earlier versions until all clients are upgraded.
* The `tailscale ping` command doesn't support MagicIP destinations. Use `ping` or the application to test connectivity.
* DNS rewriting removes DNS Security Extensions (DNSSEC) records and flattens CNAME references. Responses contain A or AAAA records directly for the queried fully qualified domain name (FQDN).
* MagicIP mode doesn't translate between IP versions. IPv4 traffic stays IPv4, and IPv6 traffic stays IPv6.
* If a client's MagicIP pool is exhausted, DNS lookups fail or new connections to new destinations are dropped until addresses become available.
* A connector serving an app doesn't forward that app's traffic to other connectors. Each client connects directly to its selected connector.
* Connectors must run Linux. Clients can use any supported operating system with the required Tailscale version.
* Routing traffic from devices on a shared subnet through a connector isn't supported.

## Feedback

To report issues or share feedback about MagicIP mode, contact [Tailscale Support][co-support] or your Customer Success Engineer.

[ar-troubleshooting]: #troubleshooting

[co-support]: /contact/support

[docs-app-connectors-ip-allowlist]: /docs/features/app-connectors/how-to/setup#restrict-application-access-by-ip-address

[docs-app-connectors]: /docs/features/app-connectors

[docs-grants]: /docs/features/access-control/grants

[docs-policy-file-groups]: /docs/reference/syntax/policy-file#groups

[docs-quad100]: /docs/reference/quad100

[docs-tags]: /docs/features/tags

[docs-tailnet-policy-file]: /docs/features/tailnet-policy-file

[pk-unstable]: https://pkgs.tailscale.com/unstable
