An installation of CentOS 7 has two connections and three devices.  How can I attach the device ens7 to the connection my-bridge?  And how can I attach the device eth0 to the connection my-eth1? Here is the relevant data from the terminal:  [root@localhost ~]# nmcli con showNAME       UUID          TYPE            DEVICE my-bridge  some.uuid     802-3-ethernet  --     my-eth1    another.uuid  802-3-ethernet  --     [root@localhost ~]# nmcli device statusDEVICE  TYPE      STATE         CONNECTION ens7    ethernet  disconnected  --         eth0    ethernet  disconnected  --         lo      loopback  unmanaged     --         [root@localhost ~]# ping 8.8.8.8connect: Network is unreachableI think it is something like nmcli connection modify id my-bridge ens7 but I am not sure of the exact syntax.  Also, the problem may have to do with the fact that the my-bridge connection (for example) was created in this way:  # nmcli con add con-name my-bridge ifname eth1 type ethernet ip4 10.1.1.2/24# nmcli connection modify my-bridge ipv4.method manual ipv4.addresses 10.1.1.1/24An answer would either show the exact syntax to type in the terminal for attaching the devices to the connections, or alternatively, the syntax for creating new connections that are automatically attached to devices from the start.
how do I attach devices to connections using nmcli?
centos;networking;rhel;networkmanager;nmcli
The easiest would benmcli device wifi connect <name ssid> password <the password>For a solution with the password as variable: https://github.com/aurelien-git/bash/blob/master/nmcli-sec/nmcli-sec.shThis script offer you the choice of selection and hidden passord