---
title: "Connect a container to a network"
method: POST
path: "/networks/{id}/connect"
tags: ["Network"]
---

# Connect a container to a network

`POST /networks/{id}/connect`

## Path parameters

- `id` string, required

## Request body

- NetworkConnect — contains the request for the remote API: POST /networks/{id:.*}/connect
  - `Container` string — The ID or name of the container to connect to the network.
  - `EndpointConfig` EndpointSettings — Configuration for a network endpoint.
    - `IPAMConfig` EndpointIPAMConfig — IPAM configurations for the endpoint
      - `IPv4Address` string — ipv4 address
      - `IPv6Address` string — ipv6 address
      - `LinkLocalIPs` string[] — link to the list of local ip
    - `Links` string[]
    - `Aliases` string[]
    - `NetworkID` string — Unique ID of the network.
    - `EndpointID` string — Unique ID for the service endpoint in a Sandbox.
    - `Gateway` string — Gateway address for this network.
    - `IPAddress` string — IPv4 address.
    - `IPPrefixLen` integer — Mask length of the IPv4 address.
    - `IPv6Gateway` string — IPv6 gateway address.
    - `GlobalIPv6Address` string — Global IPv6 address.
    - `GlobalIPv6PrefixLen` integer — Mask length of the global IPv6 address.
    - `MacAddress` string — MAC address for the endpoint on this network.
    - `DriverOpts` object, nullable — DriverOpts is a mapping of driver options and values. These options are passed directly to the driver and are driver specific.

## Response `200`

No error

## Other responses

- `400` — bad parameter
- `404` — An unexpected 404 error occurred.
- `500` — An unexpected server error occurred.

---

[API](https://skmtc.net/aliyun/apis/pouch-engine-api.md) · [All operations](https://skmtc.net/aliyun/apis/pouch-engine-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aliyun/pouch-engine-api/versions/36d75b2825fc/schema)
