# Networkmanager Could not activate connection: Connection 'eth0' is not available on device eth0 because device is strictly unmanaged

**URL:** <https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519>\
**Category:** Rocky Linux Help & Support\
**Created:** [January 11, 2023, 12:58pm UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519 "2023-01-11T12:58:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lipkowski.be](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@lipkowski.be](https://forums.rockylinux.org/u/lipkowski.be)\
**Post date:** [January 11, 2023, 12:58pm UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519/1 "2023-01-11T12:58:31Z")

</div>

Hello,

i want to install Rockylinux9 on my VPS on [euserv.com](http://euserv.com).

The vps is an lxc container.  
My main interface name is eth0. Then i try to configure my vps with nmtui i got  
Could not activate connection: Connection ‘eth0’ is not available on device eth0 because device is strictly unmanaged.

I have tried to force eth0 to management possible like in ubuntu. But nothing works have you any solution for me ?

---

<div class="post-metadata">

**Author:** ![sspencerwire](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sspencerwire](https://forums.rockylinux.org/u/sspencerwire)\
**Post date:** [January 11, 2023, 1:45pm UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519/2 "2023-01-11T13:45:26Z")

</div>

Hello @lipkowski.be and welcome!

I’ve run into similar issues with LXD and I’ve got to say, whether or not you will be able to resolve this depends on your access rights. If I recall correctly, Network Manager is not installed by default on an LXD container. There is a document on our site that might help [here](https://docs.rockylinux.org/books/lxd_server/06-profiles/), specifically the section dealing with “Rocky Linux macvlan”.

Thanks,  
Steve

---

<div class="post-metadata">

**Author:** ![lipkowski.be](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@lipkowski.be](https://forums.rockylinux.org/u/lipkowski.be)\
**Post date:** [January 11, 2023, 2:59pm UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519/3 "2023-01-11T14:59:03Z")

</div>

Hello Steve,

thanks for your help but…

I have no access to the hostnode part of this lxc system i have only access to the container itself.  
My OS is an image of the standard Rockylinux9 installed via cd (absolut base system). Networkmanager is installed as default. I don’t want to go the ‘hacky way’ and configure the network with iptools2(ip add etc). I will create a clear standard system. If i rename the interface from eth0 to net0 via iptools2, reconfigure network-manager from eth0 to net0 and restart network-manager it works to0 but only until the next boot. Is there a way to remove the ‘strictly unmanged’ state from eth0?

---

<div class="post-metadata">

**Author:** ![sspencerwire](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sspencerwire](https://forums.rockylinux.org/u/sspencerwire)\
**Post date:** [January 11, 2023, 3:29pm UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519/4 "2023-01-11T15:29:29Z")

</div>

I was afraid of that. Can you script the entire process you ran and run it in a cron with an @reboot option? That would work, but to my knowledge, there is no way to remove the unmanaged state on eth0. This is what I’m talking about scripting:

> If i rename the interface from eth0 to net0 via iptools2, reconfigure network-manager from eth0 to net0 and restart network-manager it works to0 but only until the next boot.

---

<div class="post-metadata">

**Author:** ![sspencerwire](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sspencerwire](https://forums.rockylinux.org/u/sspencerwire)\
**Post date:** [January 11, 2023, 3:54pm UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519/5 "2023-01-11T15:54:08Z")

</div>

I just tried this on my lab machine and it worked. I don’t know what exactly you are trying to accomplish as far as configuring the interface, but I used setting a static IP address as the example. Created a script in /usr/local/sbin called “static”, which contains these lines:

```auto
/usr/sbin/ip link set dev eth0 name net0
sleep 3
/usr/sbin/ip addr add 192.168.1.151/24 dev net0

```

The `sleep 3` lines may not be necessary.

Then in side the container, set the following crontab for root:

```auto
@reboot /usr/local/sbin/static

```

On reboot of the container, the device was renamed and the static IP applied.

---

<div class="post-metadata">

**Author:** ![lipkowski.be](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@lipkowski.be](https://forums.rockylinux.org/u/lipkowski.be)\
**Post date:** [January 11, 2023, 4:02pm UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519/6 "2023-01-11T16:02:08Z")

</div>

Hi,

i know that renaming and static ip assigment works (like you has discribed). But this is not a clear way for an os ip configuration i think. The default of Rockylinux 9 is Networkmanager i read in the docs. So is search a way to configure the interfaces with Networkmanager. But thanks for your help. I check if it is possible to start link renaming script via systemd before networkmanager starts than its not possible to use eth0 dedicated. I think there is a config file i have not seen.

---

<div class="post-metadata">

**Author:** ![sspencerwire](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sspencerwire](https://forums.rockylinux.org/u/sspencerwire)\
**Post date:** [January 11, 2023, 4:08pm UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519/7 "2023-01-11T16:08:56Z")

</div>

Let me know how it goes. I will be curious to see if you find a solution that works for you.

---

<div class="post-metadata">

**Author:** ![lipkowski.be](https://avatars.discourse-cdn.com/v4/letter/l/8e8cbc/32.png) [@lipkowski.be](https://forums.rockylinux.org/u/lipkowski.be)\
**Post date:** [January 16, 2023, 12:12pm UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519/8 "2023-01-16T12:12:15Z")

</div>

Hi,

i have found a solution for me. This solution require 2 files and 2 systemd scripts.

1.) Move your Networkmanager connection from eth0 to net0 if not already done.  
2.) Create dir for scripts

```auto
mkdir -p /opt/nm-if

```

3.) Create script for rename eth0 to net0 (vim /opt/nm-if/nm-if-rename.bash)

```auto
#!/bin/bash

function nm-if-rename
{
	local v_if=''
	local v_if_new=''
	
	while read v_if 
	do 
		if [-n "${v_if}"]
		then
			v_if_new="$(echo "${v_if}" | sed 's/eth/net/')"
			/usr/sbin/ip link set "${v_if}" down
			/usr/sbin/ip link set "${v_if}" name "${v_if_new}"
			/usr/sbin/ip link set "${v_if_new}" up
		fi

	done <<< "$(ls -1 /sys/class/net/ | grep -E '^eth')"
}

nm-if-rename

```

4.) Create script for force Networkmanager to manage connectios (vim /opt/nm-if/nm-if-manage.bash)

```auto
#!/bin/bash

function nm-if-manage
{
	local v_if=''
	
	while read v_if 
	do 
		if [-n "${v_if}"]
		then
			/usr/bin/nmcli dev set "${v_if}" managed yes
		fi

	done <<< "$(ls -1 /sys/class/net/ | grep -E '^net')"
}

nm-if-manage

```

5.) Create systemd script for interface rename (vim /etc/systemd/system/nm-if-rename.service)

```auto
[Unit]
Description=nm-if-rename service

[Service]
Type=simple
ExecStart=/opt/nm-if/nm-if-rename.bash

[Install]
WantedBy=network-pre.target

```

6.) Create systemd script for interface manage (vim /etc/systemd/system/nm-if-manage.service)

```auto
[Unit]
Description=nm-if-manage service
After=NetworkManager.service

[Service]
Type=simple
ExecStart=/opt/nm-if/nm-if-manage.bash

[Install]
WantedBy=multi-user.target

```

7.) Set rights for script, reload systemd and enable scripts

```auto
chmod +x /opt/nm-if/nm-if-rename.bash
chmod +x /opt/nm-if/nm-if-manage.bash
chmod 664 /etc/systemd/system/nm-if-rename.service
chmod 664 /etc/systemd/system/nm-if-manage.service

systemctl daemon-reload
systemctl enable nm-if-rename
systemctl enable nm-if-manage

```

8.) Reboot

```auto
reboot

```

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:28am UTC](https://forums.rockylinux.org/t/networkmanager-could-not-activate-connection-connection-eth0-is-not-available-on-device-eth0-because-device-is-strictly-unmanaged/8519/9 "2023-08-25T03:28:04Z")

</div>


