> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-waap-api-guides.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create and manage a network

export const MethodSection = ({children}) => children ?? null;

export const MethodSwitch = ({children}) => {
  const tabs = React.Children.toArray(children).map(c => {
    if (!c || !c.props) return null;
    if (c.props.id) return c;
    const inner = c.props.children;
    if (inner && inner.props && inner.props.id) return inner;
    return null;
  }).filter(Boolean);
  const firstId = tabs.length > 0 ? tabs[0].props.id : "";
  const [active, setActive] = React.useState(firstId);
  React.useEffect(() => {
    try {
      const saved = localStorage.getItem("gcore_docs_method");
      if (saved && tabs.find(t => t.props.id === saved)) {
        setActive(saved);
      }
    } catch (_) {}
  }, []);
  React.useEffect(() => {
    try {
      document.querySelectorAll("h2[id], h3[id]").forEach(heading => {
        const visible = heading.offsetParent !== null;
        document.querySelectorAll(`a[href="#${heading.id}"]`).forEach(link => {
          if (link.closest("h1,h2,h3,h4,h5,h6")) return;
          const li = link.closest("li");
          if (li) li.style.display = visible ? "" : "none";
        });
      });
    } catch (_) {}
    window.dispatchEvent(new Event("scroll"));
  }, [active]);
  const handleClick = id => {
    setActive(id);
    try {
      localStorage.setItem("gcore_docs_method", id);
    } catch (_) {}
  };
  return <div>
      <div className="not-prose flex gap-0 border-b border-zinc-200 dark:border-zinc-800 mb-8 mt-2" role="tablist">
        {tabs.map(tab => {
    const isActive = active === tab.props.id;
    return <button key={tab.props.id} role="tab" aria-selected={isActive} onClick={() => handleClick(tab.props.id)} className={["px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors cursor-pointer", isActive ? "border-primary text-primary" : "border-transparent text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"].join(" ")}>
              {tab.props.label}
            </button>;
  })}
      </div>

      {tabs.map(tab => <div key={tab.props.id} style={{
    display: active === tab.props.id ? "" : "none"
  }}>
          {tab.props.children}
        </div>)}
    </div>;
};

<MethodSwitch>
  <MethodSection id="portal" label="Customer Portal">
    A Gcore Cloud network is a virtualized software-defined network that operates in a cloud computing infrastructure. Cloud networks are used to transfer information between cloud resources and provide an internet connection.

    You can attach networks (also known as network interfaces) to [Virtual Machines (VMs)](/cloud/virtual-instances/types-of-virtual-machines), [Bare Metal](/cloud/bare-metal-servers/about-bare-metal-servers), [Load Balancers](/cloud/networking/create-and-configure-a-load-balancer), and [Managed Kubernetes](/cloud/kubernetes/about-gcore-kubernetes) clusters.

    ## Types of networks

    For Cloud resources, you can configure the following types of networks:

    * **Private network** : This interface is for local internal connections to the server and doesn't have access to the external network. Resources with private interfaces can only be accessed from the same network. However, you can customize their setup and establish internet connectivity.\
      For example, if you add a VM with a private interface to a public Load Balancer, this Virtual Machine will receive requests from the internet. You can also assign a [Floating IP address](/cloud/networking/ip-address/create-and-configure-a-floating-ip-address) to provide external connectivity.
    * **Public network** : This interface grants access to the external network. Instances with a public network interface will be available from the internet.
    * **Dedicated network** : This network type is designed for individual usage, providing an exclusive pool of addresses for each client. It works with Bare Metal servers and supports assigning multiple public IP addresses to a single server, making it ideal for advanced use cases such as virtualization and traffic balancing. These networks rely on dedicated public subnets, and the number of supported public IPs depends on the size of the assigned subnet. Other customizations are available upon request to meet specific needs.

    The type of network used depends on the cloud resource:

    * VMs use **VxLAN**, enabling isolated communication between instances across different physical hosts. At the same time, they can operate in both **VxLAN** and **VLAN** networks.
    * Bare Metal servers use **VLAN**, providing direct Layer 2 segmentation for higher performance and security.

    ## Create and attach networks to cloud resources

    You can attach both public and private networks to VMs, Bare Metal, Load Balancers, and Managed Kubernetes clusters.

    There are two ways to create and attach a network: during resource creation or by adding a network separately and then attaching it to an existing Cloud resource.

    The support team must configure a dedicated network before it can be selected or used. This network type allows the assignment of multiple public IP addresses to a single server, with the total number of IPs determined by the size of the assigned subnet. Public IPs in a dedicated network must be explicitly assigned to the server in order to function. Unassigned IPs within the subnet will not be operational.

    ### Attach a network when creating a new cloud resource

    For detailed steps on how to attach a network interface for each resource, refer to the relevant guide:

    * [Attach network interface to a Virtual Machine](/cloud/virtual-instances/create-an-instance)
    * [Attach network interface to a Bare Metal](/cloud/bare-metal-servers/create-a-bare-metal-server)
    * [Attach network interface to a Managed Kubernetes cluster](/cloud/kubernetes/clusters/create-a-kubernetes-cluster#step-6-configure-network-settings)
    * [Attach network interface to a Load Balancer](/cloud/networking/create-and-configure-a-load-balancer#step-4-configure-network)

    ### Create a network from the Networks page

    You can create new network interfaces in the Customer Portal, on the **Networks** page.

    To add a new network:

    1. In the Gcore Customer Portal, navigate to **Cloud** > **Networking**.
    2. Click **Create network**.

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/networking-page.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=eec517e0ed918d70a89116e3e5aa0051" alt="Create network page in the Customer Portal" width="5628" height="2396" data-path="images/docs/cloud/networking/create-and-manage-a-network/networking-page.png" />
    </Frame>

    3. Enter the network name.
    4. (Optional) If you want to create a network for Bare Metal servers, turn on the **Bare Metal Network (VLAN)** toggle.
    5. (Optional) Add tags if you want to include metadata.
    6. Click **Create network**.

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/create-network-dialog.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=1f10adb29e6c78136ec03529bf4a5c83" alt="Create network dialog" width="2260" height="1004" data-path="images/docs/cloud/networking/create-and-manage-a-network/create-network-dialog.png" />
    </Frame>

    If you need to configure a private network, you also need to add a subnetwork. To do so, follow instructions from the [creating a subnetwork](/cloud/networking/create-and-manage-a-subnetwork#create-a-subnetwork-from-the-networks-page) guide.

    ### Attach a network interface to an existing VM or Bare Metal

    <Info>
      **Info**

      You can't change network interfaces for created Load Balancers.
    </Info>

    If you've already created a cloud resource and want to add more networks to it, you can do so in the resource settings:

    1. In the Gcore Customer Portal, navigate to **Cloud**.
    2. Open the relevant page with your resource: **Virtual Instances** or **Bare Metal**.
    3. Click the resource name to open its settings.
    4. Go to the **Networking** tab. Here you can view, attach, and detach network interfaces attached to your resource. Here's the network configuration for a Virtual Machine:

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/networking-tab-vm.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=5688bfef43b4bcce3188c19bba52f9bd" alt="Networking tab in the VM settings" width="4292" height="2156" data-path="images/docs/cloud/networking/create-and-manage-a-network/networking-tab-vm.png" />
    </Frame>

    5. To attach a new interface, click **Add interface** :

    * **Public** : Each virtual machine can only have one native public interface. If you require additional public IP addresses, consider using a [reserved IP address](/cloud/networking/ip-address/create-and-configure-a-reserved-ip-address) or [floating IP address](/cloud/networking/ip-address/create-and-configure-a-floating-ip-address) (applied to a private interface) instead.

    <Info>
      **Info**

      You can assign multiple public IP addresses to a VM using floating IPs.
    </Info>

    * **Private** : Choose a network from the list or create a new one, then [configure a subnetwork](/cloud/networking/create-and-manage-a-subnetwork) according to your requirements.

    <Info>
      **Info**

      InfiniBand networks can only be attached to resources with flavors that support them.
    </Info>

    6. (Optional) If your network contains both IPv6 and IPv4 addresses, you can enable IPv6 dual-stack and simultaneously use IPv4 and IPv6 protocols on the same network infrastructure.
    7. Click **Save Changes**.

    You've successfully attached a new network interface to your resource.

    ## Detach a network from a VM or Bare Metal

    To remove an interface from your cloud resource, you need to detach all subnetworks within this network interface:

    1. In the Gcore Customer Portal, navigate to **Cloud**.
    2. Open the relevant page with the resource: **Virtual Instances** or **Bare Metal**.
    3. Find the needed resource and click its name to open it.
    4. Go to the **Networks** tab and find the network to detach.
    5. Click the three-dot icon next to each subnetwork within the network and select **Detach subnetwork**.

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/detach-subnetwork.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=af6b284722f3644341af3d283c134130" alt="Network settings with the detach subnetwork option" width="4292" height="1712" data-path="images/docs/cloud/networking/create-and-manage-a-network/detach-subnetwork.png" />
    </Frame>

    If you have a connected Floating IP, detach it before removing subnetworks.

    6. Confirm the action by clicking **Detach**.

    Repeat this step for all subnetworks within the network.

    <Warning>
      **Warning**

      Disabling a subnet will automatically remove its network interface from the machine, causing network disconnection until a new interface is assigned.
    </Warning>

    ## Manage networks

    All your configured network interfaces and their subnetworks appear in the Customer Portal, on the **Networks** page.

    You can view network details, rename or delete a network, and configure its subnetworks.

    ### View network details

    1. In the Gcore Customer Portal, navigate to **Cloud** > **Networking**.
    2. Find the needed network and click its name to open the details page.

    The details page includes comprehensive information about the network, such as network ID, creation date, tags, and other relevant specifications.

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/network-details.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=877d88e94d0f2649d66b334f0b46dfc9" alt="Network details page" width="4472" height="2156" data-path="images/docs/cloud/networking/create-and-manage-a-network/network-details.png" />
    </Frame>

    Here you can also create and remove [subnetworks](/cloud/networking/create-and-manage-a-subnetwork).

    ### Port security

    Port Security is enabled by default for all VMs, allowing only authorized traffic through network interfaces. To establish connectivity, you must configure a firewall. In some cases, such as specific network configurations or applications that require unrestricted access, turning off Port Security may be necessary.

    To disable Port Security:

    1. Open the Gcore Customer Portal and navigate to your Virtual Machine.
    2. Go to the **Networking** tab.
    3. Click on the three-dot menu next to the interface.
    4. Select **Disable Port Security**.

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/disable-port-security.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=0caec11bcb836256900fc898dca8b1fa" alt="Disable port security" width="1414" height="501" data-path="images/docs/cloud/networking/create-and-manage-a-network/disable-port-security.png" />
    </Frame>

    <Info>
      **Info**

      Virtual Machines use only MAC addresses assigned by Gcore Cloud. Custom (virtual) MAC addresses are not supported.

      Custom MAC addresses are supported only on Bare Metal servers connected to private networks.
    </Info>

    ### Rename a network

    1. In the Gcore Customer Portal, navigate to **Cloud** > **Networking**.
    2. Find the network that you want to rename and click the three-dot icon next to it.
    3. Select **Rename**.

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/rename-network.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=7a3a13f7adb22f25b94d91ae83b2f26d" alt="Network settings menu with the rename button highlighted" width="4508" height="1152" data-path="images/docs/cloud/networking/create-and-manage-a-network/rename-network.png" />
    </Frame>

    4. Enter a new name and click **Save** to apply the changes.

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/edit-name-description.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=7149ef96612a2d498f4b63d85a088531" alt="Edit network name and description dialog" width="2260" height="1004" data-path="images/docs/cloud/networking/create-and-manage-a-network/edit-name-description.png" />
    </Frame>

    The network has been renamed.

    ### Delete a network

    1. In the Gcore Customer Portal, navigate to **Cloud** > **Networking**.
    2. Find the network that you want to remove and click the three-dot icon next to it.
    3. Select **Delete**.

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/delete-network.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=fdd87056a08869d0584eb82dcd0f29da" alt="Network settings menu with the delete button highlighted.png" width="4508" height="1152" data-path="images/docs/cloud/networking/create-and-manage-a-network/delete-network.png" />
    </Frame>

    4. Click **Delete network** to confirm your action.

    <Frame>
      <img src="https://mintcdn.com/gcore-waap-api-guides/GajElLtKXAb1eOo8/images/docs/cloud/networking/create-and-manage-a-network/verify-deletion.png?fit=max&auto=format&n=GajElLtKXAb1eOo8&q=85&s=79ba710d48e2ce9f73a62671bc98dec6" alt="Delete network dialog" width="2260" height="1004" data-path="images/docs/cloud/networking/create-and-manage-a-network/verify-deletion.png" />
    </Frame>

    You've successfully removed a network.
  </MethodSection>

  <MethodSection id="api" label="REST API">
    Creating a usable private network takes two calls: create the network, then add a subnet to define the IP address range. Both calls are asynchronous and return a task ID to poll.

    <Info>
      A permanent [API token](/account-settings/api-tokens) is required, along with a [project ID](https://api.gcore.com/docs/cloud#tag/Projects/operation/ProjectsListV1.get) and [region ID](https://api.gcore.com/docs/cloud#tag/Regions/operation/RegionListV1.get).
    </Info>

    Open a bash terminal and set these as environment variables before running the examples:

    ```bash theme={null}
    export GCORE_API_KEY="{YOUR_API_KEY}"
    export GCORE_CLOUD_PROJECT_ID="{YOUR_PROJECT_ID}"
    export GCORE_CLOUD_REGION_ID="{YOUR_REGION_ID}"
    ```

    ## Quickstart

    The scripts below create a private network and a subnet within it.

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        import os
        from gcore import Gcore

        client = Gcore()

        # Step 1. Create a private network.
        network = client.cloud.networks.create_and_poll(name="my-network")
        network_id = network.id
        print(f"Network ID: {network_id}")

        # Step 2. Create a subnet with DHCP enabled.
        subnet = client.cloud.networks.subnets.create_and_poll(
            name="my-subnet",
            cidr="192.168.10.0/24",
            network_id=network_id,
            enable_dhcp=True,
        )
        print(f"Subnet ID: {subnet.id}, CIDR: {subnet.cidr}")
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        package main

        import (
            "context"
            "fmt"

            gcore "github.com/G-Core/gcore-go"
            "github.com/G-Core/gcore-go/cloud"
        )

        func main() {
            client := gcore.NewClient()
            ctx := context.Background()

            // Step 1. Create a private network.
            network, err := client.Cloud.Networks.NewAndPoll(ctx, cloud.NetworkNewParams{
                Name: "my-network",
            })
            if err != nil {
                panic(err.Error())
            }
            fmt.Printf("Network ID: %s\n", network.ID)

            // Step 2. Create a subnet with DHCP enabled.
            subnet, err := client.Cloud.Networks.Subnets.NewAndPoll(ctx, cloud.NetworkSubnetNewParams{
                NetworkID:  network.ID,
                Name:       "my-subnet",
                Cidr:       "192.168.10.0/24",
                EnableDhcp: gcore.Bool(true),
                IPVersion:  4,
            })
            if err != nil {
                panic(err.Error())
            }
            fmt.Printf("Subnet ID: %s, CIDR: %s\n", subnet.ID, subnet.Cidr)
        }
        ```
      </Tab>
    </Tabs>

    ## Step-by-step

    <p>Each step below explains what the call does, which parameters matter, and what the response looks like. Use this section to understand the flow or to debug a specific step.</p>

    <Accordion title="Show all steps">
      ### Step 1. Create a network

      A [network](https://api.gcore.com/docs/cloud#tag/Networks/operation/NetworkCreateV1.post) is the top-level container. Creating it also provisions a router that can later connect the subnet to external networks.

      | Parameter       | Required | Description                                                 |
      | --------------- | -------- | ----------------------------------------------------------- |
      | `name`          | Yes      | Display name for the network                                |
      | `type`          | No       | `vxlan` (default, for VMs) or `vlan` (for Bare Metal)       |
      | `create_router` | No       | Automatically create an external router; defaults to `true` |

      <Tabs>
        <Tab title="Python SDK">
          ```python theme={null}
          network = client.cloud.networks.create_and_poll(name="my-network")
          network_id = network.id
          print(f"Network ID: {network_id}")
          ```
        </Tab>

        <Tab title="Go SDK">
          ```go theme={null}
          network, err := client.Cloud.Networks.NewAndPoll(ctx, cloud.NetworkNewParams{
              Name: "my-network",
          })
          if err != nil {
              panic(err.Error())
          }
          fmt.Printf("Network ID: %s\n", network.ID)
          ```
        </Tab>

        <Tab title="curl">
          ```bash theme={null}
          curl -X POST "https://api.gcore.com/cloud/v1/networks/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID" \
            -H "Authorization: APIKey $GCORE_API_KEY" \
            -H "Content-Type: application/json" \
            -d '{"name": "my-network"}'
          ```

          Response:

          ```json theme={null}
          {
            "tasks": ["fe5ad7f4-8b88-4d91-9d2f-c7be0b0c9e03"]
          }
          ```

          Poll <code>GET /cloud/v1/tasks/{task_id}</code> every 5 seconds until `state` is `FINISHED`. Save the network ID from `created_resources.networks[0]`:

          ```json theme={null}
          {
            "state": "FINISHED",
            "created_resources": {
              "networks": ["b4b8107a-7e90-4b9c-ae19-63de2cbc8a6f"],
              "routers": ["d2c3a1e0-5f1b-4c8d-9e2a-7b4f0c3d1e5f"]
            }
          }
          ```
        </Tab>
      </Tabs>

      ### Step 2. Create a subnet

      A [subnet](https://api.gcore.com/docs/cloud#tag/Subnets/operation/SubnetCreateV1.post) defines the IP range and DHCP settings for the network. VMs attached to this network receive addresses from this range.

      | Parameter     | Required | Description                                         |
      | ------------- | -------- | --------------------------------------------------- |
      | `network_id`  | Yes      | ID of the network created in Step 1                 |
      | `cidr`        | Yes      | IP range in CIDR notation, e.g. `192.168.10.0/24`   |
      | `name`        | Yes      | Display name for the subnet                         |
      | `enable_dhcp` | No       | Automatically assign IPs to VMs; defaults to `true` |

      <Tabs>
        <Tab title="Python SDK">
          ```python theme={null}
          subnet = client.cloud.networks.subnets.create_and_poll(
              name="my-subnet",
              cidr="192.168.10.0/24",
              network_id=network_id,
              enable_dhcp=True,
          )
          print(f"Subnet ID: {subnet.id}, CIDR: {subnet.cidr}")
          ```
        </Tab>

        <Tab title="Go SDK">
          ```go theme={null}
          subnet, err := client.Cloud.Networks.Subnets.NewAndPoll(ctx, cloud.NetworkSubnetNewParams{
              NetworkID:  network.ID,
              Name:       "my-subnet",
              Cidr:       "192.168.10.0/24",
              EnableDhcp: gcore.Bool(true),
              IPVersion:  4,
          })
          if err != nil {
              panic(err.Error())
          }
          fmt.Printf("Subnet ID: %s, CIDR: %s\n", subnet.ID, subnet.Cidr)
          ```
        </Tab>

        <Tab title="curl">
          ```bash theme={null}
          curl -X POST "https://api.gcore.com/cloud/v1/subnets/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID" \
            -H "Authorization: APIKey $GCORE_API_KEY" \
            -H "Content-Type: application/json" \
            -d '{
              "name": "my-subnet",
              "network_id": "'"$NETWORK_ID"'",
              "cidr": "192.168.10.0/24",
              "enable_dhcp": true
            }'
          ```

          Response:

          ```json theme={null}
          {
            "tasks": ["4bc1a043-008e-410f-8a10-3ededf9a9a7b"]
          }
          ```

          Poll <code>GET /cloud/v1/tasks/{task_id}</code> until `state` is `FINISHED`. Save the subnet ID from `created_resources.subnets[0]`:

          ```json theme={null}
          {
            "state": "FINISHED",
            "created_resources": {
              "subnets": ["cf3ca33f-ad0d-457d-8bf2-919dc8c76155"]
            }
          }
          ```
        </Tab>
      </Tabs>
    </Accordion>

    ## Rename a network

    Renaming is a synchronous operation — no task polling required.

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        updated = client.cloud.networks.update(network_id, name="my-network-renamed")
        print(f"New name: {updated.name}")
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        // Add "github.com/G-Core/gcore-go/packages/param" to your imports.
        updated, err := client.Cloud.Networks.Update(ctx, networkID, cloud.NetworkUpdateParams{
            Name:      param.NewOpt("my-network-renamed"),
        })
        if err != nil {
            panic(err.Error())
        }
        fmt.Printf("New name: %s\n", updated.Name)
        ```
      </Tab>

      <Tab title="curl">
        ```bash theme={null}
        curl -X PATCH "https://api.gcore.com/cloud/v1/networks/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID/$NETWORK_ID" \
          -H "Authorization: APIKey $GCORE_API_KEY" \
          -H "Content-Type: application/json" \
          -d '{"name": "my-network-renamed"}'
        ```

        Response:

        ```json theme={null}
        {
          "id": "b4b8107a-7e90-4b9c-ae19-63de2cbc8a6f",
          "name": "my-network-renamed",
          "type": "vxlan",
          "region_id": 148,
          "project_id": 1186668
        }
        ```
      </Tab>
    </Tabs>

    ## Clean up

    Deleting the network removes all attached subnets automatically. Delete the network:

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        client.cloud.networks.delete_and_poll(network_id=network_id)
        print("Network deleted.")
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        err = client.Cloud.Networks.DeleteAndPoll(ctx, networkID, cloud.NetworkDeleteParams{})
        if err != nil {
            panic(err.Error())
        }
        fmt.Println("Network deleted.")
        ```
      </Tab>

      <Tab title="curl">
        ```bash theme={null}
        curl -X DELETE "https://api.gcore.com/cloud/v1/networks/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID/$NETWORK_ID" \
          -H "Authorization: APIKey $GCORE_API_KEY"
        ```

        Response:

        ```json theme={null}
        {
          "tasks": ["5c00c510-a9c9-4c55-ae05-2d413a0bf2f1"]
        }
        ```

        Poll <code>GET /cloud/v1/tasks/{task_id}</code> until `state` is `FINISHED` to confirm deletion.
      </Tab>
    </Tabs>
  </MethodSection>
</MethodSwitch>
