Skip to main content
A WireGuard peer of the Agent Gateway instance’s Network routes a subnet of the user’s network, and the instance reaches the targets behind it at their own addresses.

Add the Router

The router joins the Network the same way as a target’s host. On the router, turn on IP forwarding and masquerade traffic from the Network onto the subnet:
Router
172.27.0.0/24 is the Network’s subnet, and eth0 is the router’s interface on the user’s network. Each target sees requests from the router’s address.

Route the Subnet

POST /v2/network_routes sends the subnet to the router:

Add the Target

POST /v2/agent_gateways/{id}/mcp_servers adds the target by its own address, open to every key on the instance: