---
title: "Switching network configuration from ifupdown to netplan"
sidebar_label: "Switch network configuration to netplan"
sidebar_position: 5
description: "How to switch network configuration from ifupdown to netplan on cloud servers created from pre-built images with Ubuntu 18.04, 20.04, and 22.04"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'

# Switching network configuration from ifupdown to netplan

In cloud servers created from [pre-built images](/cloud-servers/images/about-images.mdx#default-images) with Ubuntu 18.04, 20.04, and 22.04, the ifupdown utility is used to configure the network by default.

You can switch network configuration from ifupdown to netplan; the procedure depends on whether the cloud-init agent is installed in the image.

<Tabs queryString="switch-to-netplan">
  <TabItem value="cloud-init" default>
    <TabItemLabel>
      Cloud-init is installed
    </TabItemLabel>

    1. [Connect to the server](/cloud-servers/manage/connect-to-server.mdx).

    2. Remove ifupdown:

       ```bash
       sudo apt purge ifupdown
       ```

    3. Perform a soft restart of the server:

       ```bash
       sudo reboot now
       ```

       The cloud-init agent will automatically configure the network for netplan.
  </TabItem>

  <TabItem value="no-cloud-init">
    <TabItemLabel>
      Cloud-init is not installed
    </TabItemLabel>

    1. [Connect to the server](/cloud-servers/manage/connect-to-server.mdx).

    2. Create a configuration file for netplan:

       ```bash
       nano /etc/netplan/config.yaml
       ```

    3. Optional: enter the necessary network settings in the file. Examples can be found in the [Edit cloud server network configuration file](/cloud-servers/cloud-networks/update-network-settings.mdx#edit-cloud-server-network-configuration-file) instructions.

    4. Check the file syntax:

       ```bash
       sudo netplan try
       ```

    5. Apply the settings:

       ```bash
       sudo netplan apply
       ```
  </TabItem>
</Tabs>

<Formbricks />
