0

I am assigning a static IP 4 address to ens33 interface on Ubuntu 24.04 using nmcli. But I'm getting the error.

Error. unknown connection 'ens33'

The commmand I am exceuting on terminal:

sudo nmcli connection modify 'ens33' ipv4.address 172.16.1.2/16

You can see from the attached image, ens33 interface exists.

enter image description here

Note: If assign this IP address to 'lo' interface, it works.

I am following this guide: https://greenwebpage.com/community/how-to-change-an-ip-address-on-debian-12/

What could be wrong? Your help is appreciated.

1 Answer 1

4

Yes, the ens33 interface exists, but the command isn't asking you for an interface name. It is asking you for a NetworkManager connection profile name. In your screenshot, the network profile active on ens33 is named netplan-ens33.

There is no 1:1 relationship, as NM allows you to have many profiles that could be activated on a given interface (consider e.g. a laptop with a single 'wlan0' interface and 20 different Wi-Fi network profiles). This also means that you have to reapply the profile after editing, using nmcli con up <name>.

However, the profile name suggests that the profile has been automatically generated by Netplan, in which case you shouldn't be editing it directly through NM as it will be re-generated anew upon the next reboot. Instead you should edit the files in /etc/netplan and run netplan apply.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.