2

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

for iface in `(nmcli -f GENERAL dev list 2>/dev/null || nmcli -f GENERAL dev show) | grep 'GENERAL.DEVICE' | awk '{print $2}'`
do
    nmcli dev disconnect iface $iface
done

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!

1 Answer 1

2

Use this command:

nmcli -p con up id "interface name" iface eth0

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks! My problem is: how to get the uuid(s) that are specific to Ethernet interfaces?
nmcli con list gives the uuid, doesn't it?
Oh yes, that should do the job if I grep on the word ethernet... Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.