Connectivity 11 min read

How to Set a Static IP Address on Ubuntu Desktop

Set a static IPv4 address in Ubuntu Desktop, verify the route, restore the original profile and connect safely to an EpiSensor Gateway.

A separate NetworkManager profile is the safest way to put an Ubuntu Desktop laptop on an isolated device subnet temporarily. It avoids overwriting the laptop's ordinary DHCP connection and makes the rollback explicit.

This guide applies to Ubuntu Desktop interfaces managed by NetworkManager. It does not cover Ubuntu Server or Netplan YAML, Ubuntu Core, every Linux desktop, unmanaged interfaces, bridges, bonds or VLANs. Work from the laptop's local console; do not change the interface carrying a remote session you depend on.

EpiSensor direct-management settings

For a ZGW-20 provisioned through the current Core 26 factory workflow, after confirming its actual network profile and physical management connector, use:

Laptop field Temporary value
IPv4 address 172.31.255.123
Prefix / netmask /24 / 255.255.255.0
Default gateway Leave empty
DNS Leave empty
Gateway management address 172.31.255.1

These are not universal EpiSensor defaults. Older, upgraded or manually changed Gateways can differ. The management profile can obtain an additional DHCP address while ignoring DHCP routes and DNS; it does not provide DHCP service to the laptop and is not the Gateway's uplink profile. Do not infer network roles from Linux names such as eth0 and eth1 alone.

This procedure changes the laptop, not the Gateway. Obtain administrator-approved values for a permanent business-network address, and consider a DHCP reservation rather than copying this isolated-link example.

Before changing the laptop

Record the selected wired profile's name, UUID, IP configuration, DNS, routes and IPv6 settings. Check that 172.31.255.0/24 is not already routed through a VPN or another active adapter. Confirm that .123 is free; .1 belongs to the Gateway, while .0 and .255 are the subnet and broadcast addresses.

Inspect the current state:

nmcli --version
nmcli device status
nmcli -f NAME,UUID,TYPE,DEVICE connection show
ip -4 address show
ip -4 route show table all

Stop if the intended interface is unmanaged or part of a bridge, bond or VLAN. Do not disable firewalls, VPNs or global NetworkManager state merely to make the example work.

Choose one of the next two methods. If you edit the connection in Ubuntu Settings, skip the separate nmcli profile procedure. If you create the separate nmcli profile, do not first change the original profile in Settings.

Set the address in Ubuntu Settings

Ubuntu Desktop's current documented path is:

  1. Open Settings, then Network.
  2. Select the gear beside the intended wired connection.
  3. Open IPv4 and choose Manual.
  4. Enter the approved address and prefix. For the scoped EpiSensor link, enter 172.31.255.123 with /24 or 255.255.255.0.
  5. Leave gateway and DNS empty for this direct link. Where the installed version offers it, limit the connection to resources on its own network.
  6. Apply the change and reconnect that wired connection if required.

Labels can vary between Ubuntu releases. Record the original values before editing. For repeat commissioning, a separate command-line profile is easier to audit and remove.

Create a separate profile with nmcli

Run these commands on the Ubuntu laptop. Replace the interface and original UUID with values you inspected; do not paste the examples without checking them. Choose a new profile name and confirm that it is not already used before running the creation command.

LAN_IFACE='enp3s0'
ORIGINAL_UUID='paste-original-profile-uuid'
LAN_PROFILE='EpiSensor temporary management'

nmcli connection show uuid "$ORIGINAL_UUID"

sudo nmcli connection add \
  type ethernet \
  ifname "$LAN_IFACE" \
  con-name "$LAN_PROFILE" \
  connection.autoconnect no \
  ipv4.method manual \
  ipv4.addresses '172.31.255.123/24' \
  ipv4.never-default yes \
  ipv4.ignore-auto-dns yes \
  ipv6.method disabled

LAN_PROFILE_UUID=$(nmcli -g connection.uuid connection show id "$LAN_PROFILE")
nmcli connection show uuid "$LAN_PROFILE_UUID"

Gateway and DNS remain unset, never-default prevents this profile from becoming the internet route, and IPv6 is disabled only on this temporary profile.

If nmcli device help on the installed version lists checkpoint support, NetworkManager can activate the profile with a bounded rollback:

sudo nmcli device checkpoint --timeout 120 "$LAN_IFACE" -- \
  nmcli connection up uuid "$LAN_PROFILE_UUID" ifname "$LAN_IFACE"

Verify from another local terminal before confirming the checkpoint. Timeout rollback is a recovery aid, not a substitute for local access.

If checkpoint support is unavailable, activate the temporary profile only from the laptop's local console, with the original profile details already recorded:

sudo nmcli connection up uuid "$LAN_PROFILE_UUID" ifname "$LAN_IFACE"

The activation can interrupt the prior connection on that interface. Do not use this fallback through a remote session.

Verify the address and route

Shell variables do not carry into a new terminal. Set the actual interface name again in every verification terminal:

LAN_IFACE='enp3s0'
nmcli device show "$LAN_IFACE"
ip -4 address show dev "$LAN_IFACE"
ip -4 route get 172.31.255.1
ip -4 route show default
ping -c 4 -W 2 -I "$LAN_IFACE" 172.31.255.1

The route to .1 should use the selected Ethernet interface and source .123. The temporary profile must not add a default internet route. A successful ping proves an IP response, not the identity, version or application service. A blocked ping does not prove the Gateway is offline.

Open the application address, protocol and port specified for the deployment; do not invent a universal Edge web port. Confirm Gateway identity and software version before commissioning a known measurement. Changing Edge networking itself is a separate operation that needs recovery planning.

Restore the ordinary network

If you used Ubuntu Settings, return to Settings, Network and the same wired connection. Restore the exact recorded IPv4 method, address, DNS, routes and IPv6 settings. If the original connection used DHCP and automatic DNS, select Automatic (DHCP) and automatic DNS again. Apply the change, reconnect and verify the ordinary address and default route.

If you used the separate nmcli profile, reconnect the original network. In the same terminal, set the actual interface and recorded original UUID again, then activate that exact profile:

LAN_IFACE='enp3s0'
ORIGINAL_UUID='paste-original-profile-uuid'
sudo nmcli connection up uuid "$ORIGINAL_UUID" ifname "$LAN_IFACE"
nmcli device show "$LAN_IFACE"
ip -4 route show default

Verify that the approved DHCP or static address, DNS, default route and IPv6 behavior have returned. Only after that confirmation, optionally delete the specific temporary profile:

LAN_PROFILE='EpiSensor temporary management'
LAN_PROFILE_UUID=$(nmcli -g connection.uuid connection show id "$LAN_PROFILE")
nmcli connection show uuid "$LAN_PROFILE_UUID"
sudo nmcli connection delete uuid "$LAN_PROFILE_UUID"

If there was no original profile, say so explicitly and configure an approved ordinary-network profile. Never manufacture an original UUID or delete a similarly named connection without resolving its exact identity.

About the preserved Linux PDF

The older EpiSensor Linux PDF remains available as a legacy reference. It uses 172.31.255.123 with an older 255.255.0.0 (/16) example and carries inconsistent document identifiers. It is not the current setup authority. Use the scoped /24 values above only after confirming the actual Gateway profile.

For a managed production network, stop and ask the network owner for the address, prefix, gateway and DNS. For the isolated management link, leave gateway and DNS empty; expected “no internet” status is not a reason to invent them.

Frequently asked questions

What static IP should Ubuntu Desktop use for a current EpiSensor Gateway management connection?

For a ZGW-20 provisioned through the current Core 26 factory workflow and confirmed at 172.31.255.1/24, use 172.31.255.123/24 on the laptop's selected Ethernet interface, with no default gateway or DNS. Confirm the actual Gateway profile and management connector first.

Should the EpiSensor temporary profile become Ubuntu's default network connection?

No. Keep it as a separate non-autoconnect profile with no default route. Restore the original NetworkManager profile after commissioning so the ordinary network regains its approved DHCP, DNS, route and IPv6 settings.

Is the older EpiSensor Linux PDF still the current setup authority?

No. It is retained as a legacy reference and uses an older /16 subnet example. This HTML guide uses the current, narrowly scoped /24 management profile and should be checked against the actual Gateway before use.