Skip to content
Advertisement

Programatically activate and deactivate network interfaces using nmcli

I wrote a script that deactivates all the interfaces available using nmcli commands such as:

JavaScript

I would now like to reactivate these interfaces; there is no nmcli dev connect iface … command, and I’m stuck. In particular, my problem is to reactivate the Ethernet interface.

Thanks in advance for your help!

Advertisement

Answer

Use this command:

JavaScript

You can also use uuid instead of id.

-p is just for human readable output and can be ignored.

iface eth0 can also be omitted.

Take a look here for more information.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement