LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-05-2017, 05:11 AM   #1
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 239

Rep: Reputation: 30
nmcli connection questions


Hi,

Anyone knows the difference between the NAME and the DEVICE when i run 'nmcli connection'?

can i change the NAME to anything I want and it wont effect any best practice? and when I need to stop or restart interfaces do i call them with their NAME or DEVICE?
 
Old 11-05-2017, 09:42 AM   #2
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

DEVICE is what is file in the /dev folder, such as eth1 in /dev/eth0.

NAME can be whatever you want. But default for the first automatically configured connection nmcli set NAME to the same value as DEVICE.
I have never really tried to rename an existing connection.
I usually create an new one (pointing to the same device), and delete the old one.
You can also try to nmcli con edit, or nmcli con mod, or even nmcli con clone.
 
Old 11-06-2017, 11:39 AM   #3
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 239

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by tshikose View Post
Hi,

DEVICE is what is file in the /dev folder, such as eth1 in /dev/eth0.

NAME can be whatever you want. But default for the first automatically configured connection nmcli set NAME to the same value as DEVICE.
I have never really tried to rename an existing connection.
I usually create an new one (pointing to the same device), and delete the old one.
You can also try to nmcli con edit, or nmcli con mod, or even nmcli con clone.
thank you for the information. Do you think it is possible to change the device name?
 
Old 11-07-2017, 11:10 AM   #4
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Hi,

Yes, theoretically it is possible to change the device name.
But for which real purpose? You really rarely need that.
Maybe, if you tell us what problem you are trying to solve, we might be able to propose a more suitable solution.

That said, you should bear in mind that the device names under /dev/devicename are managed by the kernel.
So I would not advise in changing or modifying the way the kernel thought it should have named a device.
But playing with udev rules (I have done it once and long time ago for a USB drive), you can add alias device names for your network interface with names of your choice.
 
Old 11-07-2017, 03:13 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You can change a connection name with nmcli by editing the connection.id field, eg:
Code:
nmcli con edit id "Wired connection 1"
set connection.id Wired
save
quit
 
Old 11-08-2017, 02:39 AM   #6
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 239

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by suicidaleggroll View Post
You can change a connection name with nmcli by editing the connection.id field, eg:
Code:
nmcli con edit id "Wired connection 1"
set connection.id Wired
save
quit
thank you;

i used this:

nmcli connection modify ens224 connection.id net.hb
 
Old 11-08-2017, 02:40 AM   #7
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 239

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by tshikose View Post
Hi,

Yes, theoretically it is possible to change the device name.
But for which real purpose? You really rarely need that.
Maybe, if you tell us what problem you are trying to solve, we might be able to propose a more suitable solution.

That said, you should bear in mind that the device names under /dev/devicename are managed by the kernel.
So I would not advise in changing or modifying the way the kernel thought it should have named a device.
But playing with udev rules (I have done it once and long time ago for a USB drive), you can add alias device names for your network interface with names of your choice.
Ok understood. Alias is an option.

Oh its nothing; just an OC problem where in one of your 10 servers didn't get the same device name as the others and we wanted to find a way to fix that without having to reinstall linux.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nmcli d Shows 3 interfaces 1 unavailable? 907_N8tiv Linux - Server 2 08-25-2017 02:23 PM
Can't set up ethernet on eth1 using nmcli DerMinze Linux - Networking 3 10-06-2015 06:22 PM
[SOLVED] Need nmcli commands in the correct sequence nix84 Fedora 2 08-20-2015 12:20 AM
CentOS 7 nmcli teaming andrewm659 Linux - Server 0 02-11-2015 06:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration