LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-08-2014, 01:36 PM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Renaming ethernet interface did not work


Running CentOS 7.0 64-bit which is a guest in Virtual Box.

I have one ethernet interface named enp0s3 and I went into /etc/sysconfig/network-scripts and renamed the file where it was getting the name enp0s3 from ifcfg-enp0s3>ifcfg-eth0-1.

Restated network services under /etc/init.d and for some reason the OS is still picking up the old name, enp0s3.

If I do a find command it pulls back alot of places from /proc (I can't copy an past from the guest to here, I don't have Virtual Box Guest Additions installed).

Is there some other place where I need to make this change so the ethernet interface shows up as eth0?

thanks
 
Old 11-08-2014, 02:15 PM   #2
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
The name of the file does *not* determine the name of the interface. Renaming the file would have no impact on the name of the IF. At the very least you will have to change the NAME= line in the file itself, and I believe there are other steps required for bailing on the udev naming conventions in RHEL7/CentOS7.

Here's a guide that 2 seconds of google-time turned up: http://ask.xmodulo.com/change-networ...e-centos7.html

Why not just adopt the standard naming convention? It's not going away, so we should all get used to it (just like journalctl, etc.).
 
Old 11-08-2014, 02:24 PM   #3
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
To get former interface name back add "net.ifnames=0" parameter to kernel boot command line.
It will prevent crazy enp0s3 name.
After that you (probably) have to reconfigure your networking settings to get them configured for eth0
 
Old 11-08-2014, 08:12 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
I'd assume that every distro will eventually go to a naming convention that describes the nic base on location in system rather than arbitrary info like eth0.

It was on BSD and other OS's for a while and has practical advantages.
 
1 members found this post helpful.
Old 11-09-2014, 05:19 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
I'd assume that every distro will eventually go to a naming convention that describes the nic base on location in system rather than arbitrary info like eth0.
15-20 years ago one might have been able to figure out which physical network connection corresponded to such a name, based on the (PCI) bus and slot number. Unless of course you were using a multi-port NIC with a built-in PCI-to-PCI bridge, in which case all bets would be off anyway.

Nowadays, it's usually impossible to tell which logical bus a given NIC is actually connected to, as most NICs are part of the motherboard. This is particularly true for servers, which may have anything from 2 to 5 built-in NICs.
Quote:
Originally Posted by jefro View Post
It was on BSD and other OS's for a while and has practical advantages.
Physical interfaces have retained their logical names on most Linux distributions for years. True, a NIC is given a semi-arbitraty "ethn" name at first bootup, based on the order in which the various NIC drivers are loaded and initialized, but then the init scripts call udev which renames the interfaces based on certain hardware characteristics, usually the MAC address. This is then stored in a persistent udev rule, causing the interface to be permanently associated with that name.

In other words, on older Linux systems, "eth0" will remain "eth0" no matter where the physical card resides. Change the physical NIC, and you get a new name.

On newer (typically systemd based) distros, the same NIC gets a new name if you move it to another PCI(e) slot, and a different make/model NIC in the same slot inherits the old name. Personally, I must say I find the old convention far more logical and less likely to cause confusion, and to me this new naming convention looks like a change being made just for the sake of it.

(Also, replacing the I/F names used by the kernel in order to accommodate a new naming convention has of course obsoleted tons of documentation and broken a lot of software.)
 
1 members found this post helpful.
Old 11-09-2014, 07:59 PM   #6
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
This isn't 15-20 years ago, though...
 
Old 11-09-2014, 08:13 PM   #7
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
useless feature for almost all desktops and laptops that has in general one eth and one wlan interface.
 
Old 11-10-2014, 03:44 PM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,341

Rep: Reputation: Disabled
Quote:
Originally Posted by GaWdLy View Post
This isn't 15-20 years ago, though...
My point exactly.
 
Old 11-10-2014, 04:48 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
There is some way to revert a distro back to the old naming scheme. I did read that someplace.

I've used QNX for decades and they have used names by driver/chipset so it's not so foreign to me.
 
Old 11-12-2014, 08:20 AM   #10
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by GaWdLy View Post
The name of the file does *not* determine the name of the interface. Renaming the file would have no impact on the name of the IF. At the very least you will have to change the NAME= line in the file itself, and I believe there are other steps required for bailing on the udev naming conventions in RHEL7/CentOS7.

Here's a guide that 2 seconds of google-time turned up: http://ask.xmodulo.com/change-networ...e-centos7.html

Why not just adopt the standard naming convention? It's not going away, so we should all get used to it (just like journalctl, etc.).
I didn't realize that the naming standard for Linux network interfaces were changing.

Thanks for the guide.
 
  


Reply



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
[SOLVED] Bridging tap interface with ethernet interface rjm1 Linux - Networking 9 09-13-2013 09:29 AM
Renaming Dummy Interface (dummy0) pigsa Linux - Networking 1 01-31-2012 10:23 AM
Receive Ethernet VLAN frame on the native ethernet interface (raw packet socket) scottbiker Linux - Networking 0 07-13-2009 03:49 AM
Bridge between ethernet interface and tap interface jayadhanesh Linux - Networking 3 04-12-2009 11:32 PM
how can i shutdown the PHYSICAL interface of an ethernet interface markraem Linux - Networking 2 04-12-2007 02:29 PM

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

All times are GMT -5. The time now is 03:26 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