---
title: "Configure the default gateway for a cloud server"
sidebar_label: "Configure default gateway"
sidebar_position: 14
description: "How to set a port as the default gateway for a cloud server"
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from 'docs-kit/components'
import MoreVerticalIcon from 'docs-kit/icons/more-vertical'
import Formbricks from '@theme/MDXComponents/Formbricks'

# Configure the default gateway for a cloud server

If a cloud server uses multiple network interfaces, you can assign a specific interface as the default gateway.

:::note

For example, a cloud server has two network interfaces: the first is the IP address of a private subnet, and the second is the IP address of a public subnet for internet access. If the first interface is used as the default gateway, the server will not have internet access. To change the interface to the second one (public), you need to set the public subnet port as the default gateway for the cloud server.

:::

<Tabs queryString="set-default-gateway">
  <TabItem value="panel" default>
    <TabItemLabel>
      Control panel
    </TabItemLabel>

    1. In the [Control panel](https://my.selectel.ru/vpc/default/servers/), on the top menu, click **Products** and select **Cloud Servers**.

    2. Open the server page → **Ports** tab.

    3. In the <MoreVerticalIcon /> port menu, select **Set as default gateway**.

    4. In the <MoreVerticalIcon /> server menu, select **Soft reboot**.
  </TabItem>

  <TabItem value="openstack">
    <TabItemLabel>
      OpenStack CLI
    </TabItemLabel>

    1. [Open the OpenStack CLI](/cloud-servers/tools/openstack-cli/).

    2. Configure the default gateway for the cloud server:

       ```bash
       openstack server set \
         --property x_sel_server_default_addr='{"ipv4":"<gateway>"}' \
         <server>
       ```

       Specify:

       * `<gateway>` — port IP address to be set as the default gateway, for example, `192.168.0.5`;
       * `<server>` — cloud server ID or name; you can view it using the `openstack server list`.

    3. Perform a soft reboot of the server:

       ```bash
       openstack server reboot <server>
       ```

       Specify `<server>` — server ID or name. You can view the server list using the `openstack server list`.
  </TabItem>
</Tabs>

<Formbricks />
