Score:1

Network 'device is strictly unmanaged', trying to make static IP work

I have a Ubuntu 22.04.2 LTS machine here that needs to be set with static IP address.

I followed the Linuxize tutorial for employing netplan, plus the StackExchange update on the new syntax to set /etc/netplan/01-netcfg.yaml as follows:

network:
    version: 2
    renderer: networkd
    ethernets:
        enp2s0f0:
            dhcp4: no
            addresses:
                - 172.16.86.3/24
            routes:
                - to: default
                    via: 172.16.86.2
            nameservers:
                addresses: [200.131.157.4, 8.8.8.8]

The file /etc/NetworkManager/NetworkManager.conf is like this:

[main]
plugins=ifupdown,keyfile
 
[ifupdown]
managed=true
 
[device]
wifi.scan-rand-mac-address=no

I've tried nmcli dev set enp2s0f0 managed yes

But nmcli device status still shows:

DEVICE      TYPE        STATE       CONNECTION
enp2s0f0    ethernet    unmanaged   --
enp2s0f1    ethernet    unmanaged   --
enp2s0f2    ethernet    unmanaged   --
enp2s0f3    ethernet    unmanaged   --
lo          loopback    unmanaged   --

And nmtui is of no help:

[Activate a connection]
[Ethernet connection 1]
 
Could not activate connection:
Connection 'Ethernet Connection
1' is not available on device
enp2s0f0 because device is
strictly unmanaged.
[OK]

So, what should I do to make device manageable? Is this what I need in order to make the static IP work, or I am acting on wrong assumptions?

Please add output of ip a.

Here it is:

1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
        valid_lft forever preferred_lft forever     
    inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
2: enp2s0f0:  mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:25:90:5a:[...] brd ff:ff:ff:ff:ff:ff
    inet 127.16.86.3/24 brd 172.16.86.255 scope global enp2s0f0
        valid_lft forever preferred_lft forever     
    inet6 fe80::255:90ff:fe5a:fe/64 scope link
        valid_lft forever preferred_lft forever 
3: enp2s0f1:  mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:25:90:5a:[...] brd ff:ff:ff:ff:ff:ff
4: enp2s0f2:  mtu 1500 qdisc noop state DOWN group default qlen 1000 
    link/ether 00:25:90:5a:[...] brd ff:ff:ff:ff:ff:ff
5: enp2s0f3:  mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 00:25:90:5a:[...] brd ff:ff:ff:ff:ff:ff
Pilot6 avatar
cn flag
It is unclear why you need NM at all. Please add output of `ip a`. And is it a desktop or a server? You need to choose one way to setup your interface, not both.
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
@Pilot6 It is a server. I have added `ip a` output to the question description. NetworkManager was used because that's what shows up on Google when searching for a way to set up static IP addresses, most of the time.
Pilot6 avatar
cn flag
So you've setup a static IP. What is the problem? It shouldn't be manageable on nmcli.
Score:1
cn flag

Your device is managed by networkd.

You've successfully setup a static IP as it is shown by ip a.

It shouldn't be managable by NetworkManager, because it is not used.

BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
I have `renderer: networkd` because [the Linuxize tutorial said to put this in there](https://linuxize.com/post/how-to-configure-static-ip-address-on-ubuntu-20-04/). But it also says this line is not required. How about just deleting it and letting the OS figure out what to do?
BsAxUbx5KoQDEpCAqSffwGy554PSah avatar
Correct: the static IP works, and the "strictly unmanaged" WORK AS INTENDED, as you said. I tested today.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.