After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 698113 - cli: iface-independent physical connections should be explicit
cli: iface-independent physical connections should be explicit
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: nmcli
unspecified
Other Linux
: Normal minor
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: tracker-nmcli
 
 
Reported: 2013-04-16 08:51 UTC by Pavel Simerda
Modified: 2013-06-13 08:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pavel Simerda 2013-04-16 08:51:55 UTC
You can add an ethernet connection that is not bound to a specific interface either by mac address or by name (not yet implemented, AFAIK).

nmcli connection add type ethernet

But that makes it easy to do that by mistake, e.g. assuming that name is the interface name:

nmcli connection add type ethernet name eth0

This may lead to unexpected behaviour and it *might* be worth forcing the user to explicitly state that this is what he needs. There is a number of possibilities I can think of:

* nmcli --force connection add type ethernet name eth0 (the --force/-f being suggested by the unsuccessful command)
* nmcli connection add type ethernet independent
* nmcli connection add type ethernet mac any
* nmcli connection add type ethernet interface-name any

I'm not suggesting any particular way, the list here is only to express myself better.
Comment 1 Jiri Klimes 2013-04-22 17:25:02 UTC
Actually, there was 'ifname any', but after some discussions the special value 'any' was trashed in the end. Also 'name is now 'con-name', so it should not be confusing.
Comment 2 Pavel Simerda 2013-04-23 14:40:58 UTC
(In reply to comment #1)
> Actually, there was 'ifname any', but after some discussions the special value
> 'any' was trashed in the end.

Could be also for example 'ifname "*"' or 'any-ifname' or maybe the best would be 'unbound' or 'floating' or something along that line.

> Also 'name is now 'con-name', so it should not be confusing.

I don't see this as so much related (though maybe others do) and I don't think 'con-name' is a good name. It's both long and weird. Plain old 'name' was good enough in my opinion.
Comment 3 Pavel Simerda 2013-04-25 12:48:26 UTC
Putting here a bunch of notes I had to prepare anyway:

* The context is 'nmcli connection add', so we're adding the connection and 'name' with 'connection' in the context suggests a connection name.
* "name" is shorter.
* "name" is in English, "con-name" or "conn-name" isn't, while "connection-name" is even longer.
* Even if we choose "connection-name", we're just duplicating the 'connection': nmcli *connection* add *connection*-name something.
* The user should be warned if he forgets "ifname" anyway. Then the original problem doesn't exist.

Still this is a minor issue and can be solved backwards complatibly at any time, so no need to be stressed about it.
Comment 4 Dan Williams 2013-04-30 21:04:06 UTC
ifname * would work; the kernel does allow that character in an interface name, but I can't imagine why anyone would ever name an interface simply "*".
Comment 5 Dan Winship 2013-05-02 15:59:37 UTC
NM bugzilla reorganization... sorry for the bug spam.
Comment 6 Jiri Klimes 2013-06-10 14:01:47 UTC
(In reply to comment #1)
> Actually, there was 'ifname any', but after some discussions the special value
> 'any' was trashed in the end. Also 'name is now 'con-name', so it should not be
> confusing.
(In reply to comment #4)
> ifname * would work; the kernel does allow that character in an interface name,
> but I can't imagine why anyone would ever name an interface simply "*".

Well, after some feedback and discussions I re-implemented it in
jklimes/cli-ifname-bgo698113.
'ifname' will be mandatory for all connection types (expect bond,bridge,vlan).
If a user required "unbound" connection he has to explicitly express that via
ifname "*" (nmcli con add con-name "My any ethernet" type eth ifname "*").

A small drawback of using * is that it has to be quoted to suppress the shell expansion. (I put the quotes to docs and stress it in man).
Comment 7 Dan Winship 2013-06-12 19:50:31 UTC
looks right
Comment 8 Jiri Klimes 2013-06-13 08:31:49 UTC
Pushed to master: a91eafdf95bcbcc1bd2ba5aa991ac6a8f0d14446