> This page is for Portal.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.emnify.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.emnify.com/_mcp/server.

> Turn on device-to-device communication on a service policy so your devices can communicate directly with each other over the emnify network

> **Note**
>
> Your role needs permission to update device-to-device settings.
> Without the update permission, the switch is read-only.

Device-to-device (D2D) communication lets your devices exchange IP traffic with each other directly over the emnify network.
You turn it on per service policy in [**Device Policies**](https://portal.emnify.com/device-policies) on the emnify Portal.

Device-to-device communication is off by default on every service policy.
For two devices to communicate, turn it on for the service policy of each device.
If only one policy has it on, return traffic is blocked.

Devices must belong to the same organization and region.
Device-to-device communication doesn't work between organizations or across regions.

## Prerequisites

Device-to-device communication is opt-in.
The **Device-to-Device communication** switch only appears for organizations that have it enabled.
To request access, contact [emnify support](https://support.emnify.com/hc/en-us/requests/new).

Your organization also needs a virtual network before you can turn on device-to-device communication.
If it doesn't have one, the switch is unavailable and a hint says device-to-device isn't supported for your organization.
Contact emnify support to set up a virtual network for your organization.

## Enable device-to-device communication

In [**Service Policies**](https://portal.emnify.com/device-policies#service-policies), choose the policy you want to update and expand the policy details.

In **Connectivity**, find the **Device-to-Device communication** switch.

Turn the switch on.
The change saves automatically and takes effect without devices reconnecting.
If saving fails, the switch returns to its previous position and an error message appears.

Repeat these steps for the service policy of every device that needs to communicate with devices on this policy.

## Disable device-to-device communication

In [**Service Policies**](https://portal.emnify.com/device-policies#service-policies), choose the policy you want to update and expand the policy details.

In **Connectivity**, find the **Device-to-Device communication** switch.

Turn the switch off.
The change saves automatically, and devices on this policy can no longer communicate with other devices.

## Configure device-to-device communication with the emnify REST API

You can also retrieve or update the device-to-device mode of a service policy using the emnify REST API.
The API offers a third mode, `forward_to_backend`, which routes traffic between devices through your [Cloud Connect](/services/cloud-connect) backend instead of delivering it directly, for example so your own firewall can inspect it.
This mode only prepares the configuration.
It requires a default route over Cloud Connect, and OpenVPN isn't supported.
Until the setup is complete, traffic between devices is dropped.

For details, see [Retrieve device-to-device mode of a service profile](/developers/api/service-profiles/service-profile-device-to-device-get) and [Update device-to-device mode of a service profile](/developers/api/service-profiles/service-profile-device-to-device-put) in the API reference.