Filtering with nm-connection-edtior

Issues related to configuring your network
Post Reply
scarney
Posts: 1
Joined: 2020/09/10 23:17:11

Filtering with nm-connection-edtior

Post by scarney » 2021/06/04 16:21:10

All,
We are a medical device manufacturer with a need for our customers to sometimes setup static ip or bring eth0 down.

We figured out how to get the uuid of eth0 by running 'nmcli c s eth0 | grep 'connection.uuid' | awk '{print $2}' and then giving that result to 'nm-connection-editor' via the -e option.

That brings up the 'eth0' profile. However, the 'Device' is a drop-down list consisting of other devices. We can filter on the type which is 802-3-ethernet so it will only make devices of that type visible.

What we would like is to disable the ability for them to select another device. I have looked through Stack Overflow, the documents and even the code and there doesn't seem to be a way to impose such a restriction.

Any thoughts would be welcome.

--
Regards,
Sandra Carney

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Filtering with nm-connection-edtior

Post by jlehtone » 2021/06/04 18:40:07

Code: Select all

nmcli c s eth0
Implies that there is connection with name "eth0".

You can bring that connection down with:

Code: Select all

nmcli c down eth0
You can also create a connection with another name and static IP:

Code: Select all

nmcli con add con-name my-con ifname eth0 type ethernet ip4 192.168.42.7/24 gw4 192.168.42.1

The point is: why let untrained user do anything?

Post Reply