---
title: Set a Static IP Address
slug: edgemanager/how-to-guides/lem-admin-console-guides/set-a-static-ip-address
description: Learn how to set a static IP address in Litmus Edge Manager. 
docTags: 
createdAt: 2022-07-06T18:39:24.000Z
---

You can set a static IP address for Litmus Edge Manager instead of using DHCP.

If you have installed Litmus Edge Manager on ESXi and there is no IP address shown to access the interface, you must set a static IP address.

If you would like to change the current IP address used to access Litmus Edge Manager, see [Change the IP Address of Litmus Edge Manager](docId\:qcv7MR9ma_fzEqjKizQpC).&#x20;

Depending on your version of Litmus Edge Manager, refer to the appropriate steps.&#x20;

# Litmus Edge Manager Version 2.16.0 and Later

These steps are for Litmus Edge Manager 2.16.0 and later on Ubuntu 22. Network configuration is managed by Netplan [https://netplan.io/](https://netplan.io/).

**To set a static IP address:&#x20;**

1. Login to the VM console.&#x20;
2. Use the following command to get the filename in the NetPlan config directory. Depending on the Linux distribution NetPlan configuration, the file can have different filenames.&#x20;
   `sudo ls -l /etc/netplan`

The default configuration looks like the following:

```yaml
network:
  ethernets:
    ens192:
      dhcp4: true
  version: 2
```

You will need to update this configuration. As an example, you will disable DHCP and set the static IP address of 10.17.8.146/22 with the default router of 10.17.8.1. The configuration will be updated to the following:

```yaml
network:
  ethernets:
    ens192:
      dhcp4: false
      addresses:
        - 10.17.8.146/22
      routes:
        - to: default
          via: 10.17.8.1
  version: 2
```

Apply the configuration with the following command.&#x20;

:::BlockQuote
sudo netplan apply
:::

Once the new IP address is set, if the base domain name was set as an IP address, log in to the Litmus Edge Manager Admin Console (https\://\[LEM IP address]:8446) and update the base and remote domain names. See [Domain Settings](docId\:MC8Z1bK3yWcKQq4-kupCv) to learn more.&#x20;

If you get an error message that the network interface configuration failed, see [Static IP Address Error](docId\:qcfAzyS-rv5d-3oeSlLf3) to resolve it.&#x20;

# Litmus Edge Manager Version 2.15.0 and Earlier

These steps are for Litmus Edge Manager 2.15.0 and earlier on Ubuntu 18.&#x20;

**To set a static IP address:&#x20;**

&#x20;    1\. From a command prompt, enter the following:

:::BlockQuote
NEW\_IP=xxx.xxx.1.222
sudo /opt/lem/bin/lem-update-domain-names.sh $NEW\_IP $NEW\_IP
sudo /opt/lem/bin/stop-all-nomad-jobs.sh
sudo vi /etc/netplan/01-netcfg.yaml
:::

The `.yaml` file opens.

:::hint{type="info"}
**Note**: The `.yaml` file is located in `/etc/netplan/01-netcfg.yaml`.
:::

&#x20;    2\. Enter the following lines in the `.yaml `file while substituting `x` with the relevant numbers:

```yaml
network:
  version: x
  ethernets:
    eth0:
      dhcp4: false
      addresses: [xxx.xxx.x.xxx/xx]
      gateway4: xxx.xxx.x.x
      nameservers:
        addresses: [x.x.x.x,x.x.x.x]
```

&#x20;    3\. From a command prompt, enter the following:

:::BlockQuote
sudo netplan apply
sudo reboot
:::

