# Configure and get up second network interface

**URL:** <https://forums.rockylinux.org/t/configure-and-get-up-second-network-interface/14007>\
**Category:** Rocky Linux Help & Support\
**Tags:** rocky-linux-9\
**Created:** [May 11, 2024, 5:11pm UTC](https://forums.rockylinux.org/t/configure-and-get-up-second-network-interface/14007 "2024-05-11T17:11:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kinu](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@kinu](https://forums.rockylinux.org/u/kinu)\
**Post date:** [May 11, 2024, 5:11pm UTC](https://forums.rockylinux.org/t/configure-and-get-up-second-network-interface/14007/1 "2024-05-11T17:11:32Z")

</div>

Hello. I posted this in matermost channel but no one anwered, so I’m posting here.

I’m trying to configure a second interface in a Rocky Linux 9 LXC container (LXD/Incus). I’ve defined the second interface as macvlan in the container profile, and I want it to get an ip address from my router. I did this before in an Ubuntu container just configuring my second interface in netplan conf file, but I don’t know how to do it with NetworkManager.

```auto
[root@r1 ~]# nmcli dev
DEVICE TYPE STATE CONNECTION
eth1 ethernet connected Wired connection 1
lo loopback connected (externally) lo
eth0 macvlan unmanaged --
[root@r1 ~]# nmcli con
NAME UUID TYPE DEVICE
Wired connection 1 c659e992-2e24-3a83-94c0-b5ac07fb0185 ethernet eth1
lo 328f7a75-52de-4883-a35e-50eef576e153 loopback lo
System eth0 5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 ethernet --

```

tried

```auto
[root@r1 ~]# nmcli con modify "System eth0" connection.interface-name eth0
[root@r1 ~]# nmcli con up "System eth0"
Error: Connection activation failed: No suitable device found for this connection (device eth1 not available because profile is not compatible with device (mismatching interface name)).

```

How to get the second interface (eth0) up?

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [May 11, 2024, 7:14pm UTC](https://forums.rockylinux.org/t/configure-and-get-up-second-network-interface/14007/2 "2024-05-11T19:14:36Z")

</div>

> [@kinu](#):
>
> `macvlan`

I don’t have an answer, so I did search with that and first hit was: [NetworkManager cannot manage macvlan devices inside container (#785) · Issues · NetworkManager / NetworkManager · GitLab](https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/785)  
Note that that is not strictly about el9.

---

<div class="post-metadata">

**Author:** ![kinu](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@kinu](https://forums.rockylinux.org/u/kinu)\
**Post date:** [May 12, 2024, 9:50am UTC](https://forums.rockylinux.org/t/configure-and-get-up-second-network-interface/14007/3 "2024-05-12T09:50:42Z")

</div>

Thank you for your find. The last comment is 11 months old so I suppose it is affecting to el9 too. ☹

So I workarounded it. Good bye NetworkManager, hello networkd and netplan. Posting this just for someone having same problem until they fix NetworkManager. In my container I did:

Install EPEL repository

```auto
sudo dnf upgrade --refresh
sudo dnf install 'dnf-command(config-manager)'
sudo dnf config-manager --set-enabled crb

```

then

```auto
sudo dnf install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm

```

Install packages for networkd and netplan

```auto
sudo dnf makecache --refresh
sudo dnf install systemd-networkd systemd-resolved netplan

```

set up systemd-resolved

```auto
sudo systemctl enable systemd-resolved --now
sudo mv /etc/resolv.conf /etc/resolv.conf.sos
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

```

configure netplan  
`nano /etc/netplan/10-lxc.yaml`  
I’ve used this for my two interfaces, so both get ip from dhcp servers, the bridged from Incus internal bridge and the macvlan from my router

```auto
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: true
      dhcp-identifier: mac
    eth1:
      dhcp4: true
      dhcp-identifier: mac

```

then

```auto
sudo netplan apply
sudo systemctl enable systemd-networkd

```

and finally

`systemctl disable NetworkManager && sudo reboot`

It is working fine now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [July 11, 2024, 9:51am UTC](https://forums.rockylinux.org/t/configure-and-get-up-second-network-interface/14007/4 "2024-07-11T09:51:32Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
