# Connect a LAN to a Cross Connect

To associate a Cross Connect with your VDC and the configured private LAN, you can perform the following API calls:

* `POST` creates a LAN and connects it to a Cross Connect in a single API call.
* `PUT` or `PATCH` can be used to update the corresponding `/lan` resource.

## Request

The following is an example of a `PUT` operation:

```bash
curl --location 
--request PUT 'https://api.ionos.com/cloudapi/v6/datacenters/{datacenter_UUID}/lans/2' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <auth-token>' \
--data '{    
    "properties": {        
        "pcc": "2e136690-1169-424f-ac4e-ead3fc02292b"    
                  }
        }'
```

## Response

**202 Successful operation**

```json
{
    "id": "2",
    "type": "lan",
    "href": "https://api.ionos.com/cloudapi/v6/datacenters/{datacenter_UUID}/lans/2",
    "metadata": {
        "etag": "d0f9c52b979bfe779e9368ca303bab88",
        "createdDate": "2023-09-11T12:00:35Z",
        "createdBy": "xyz@ionos.com",
        "createdByUserId": "0ea7c8-fd97-48ce-a375-6b2c38",
        "lastModifiedDate": "2023-09-20T11:48:03Z",
        "lastModifiedBy": "xyz@ionos.com",
        "lastModifiedByUserId": "0ea7c8-fd97-48ce-a375-6398fb",
        "state": "BUSY"
    },
    "properties": {
        "name": "LANCC",
        "ipFailover": [],
        "pcc": "2690-1169-424f-ac4e-222b",
        "ipv6CidrBlock": null,
        "public": false
    },
    "entities": {
        "nics": {
            "id": "2/nics",
            "type": "collection",
            "href": "https://api.ionos.com/cloudapi/v6/datacenters/{datacenter_UUID}/lans/2/nics"
        }
    }
}
```

For more information, see [<mark style="color:blue;">Create LANs</mark>](https://api.ionos.com/docs/cloud/v6/#tag/LANs/operation/datacentersLansPost) and [<mark style="color:blue;">Partially modify LANs</mark>](https://api.ionos.com/docs/cloud/v6/#tag/LANs/operation/datacentersLansPatch).


---

# 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.ionos.com/cloud/network-services/cross-connect/api-how-tos/connect-lan-api.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.
