Can I change my interaface "p3pl" to "eth0"?

Issues related to configuring your network
voyager
Posts: 15
Joined: 2010/11/02 04:25:14

Can I change my interaface "p3pl" to "eth0"?

Postby voyager » 2012/03/03 23:29:44

In my just installed CentOS 6.2, my ethernet interface is now named "p3pl". Anyone know what's the reason for this?

Also, is there a way I can change the name of interface back to the traditional "eth0" ?

Below is my ifconfig output. Thanks.

Code: Select all

15:19:03 eric> ifconfig -a
lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2160 (2.1 KiB)  TX bytes:2160 (2.1 KiB)

p3p1      Link encap:Ethernet  HWaddr 18:03:73:DD:4A:EF 
          inet addr:192.168.1.202  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::1a03:73ff:fedd:4aef/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:89817 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42991 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:99365696 (94.7 MiB)  TX bytes:3833900 (3.6 MiB)
          Interrupt:19

virbr0    Link encap:Ethernet  HWaddr 52:54:00:A1:1D:85 
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:95 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:7500 (7.3 KiB)

virbr0-nic Link encap:Ethernet  HWaddr 52:54:00:A1:1D:85 
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

User avatar
TrevorH
Forum Moderator
Posts: 19147
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can I change my interaface "p3pl" to "eth0"?

Postby TrevorH » 2012/03/04 00:44:02

It's the new ethernet naming convention that appeared in Fedora 15 and recently turned up in CentOS 6.2 where it's used for new installs. The convention does actually make a little sense as it now names network ports on the motherboard as interface "emX" where X is a digit starting at 0. It then names ethernet ports that are on plugin cards as pYpZ where Y is the PCI slot number and Z is the port number on that card. It's meant to make the naming of devices more consistent and to alleviate the occurrences of people complaining that their eth0 is now eth1 etc.

Since the old naming convention is used on upgrades from 6.1 to 6.2+ it is possible to continue to use the old naming convention. If you have console access then I guess you can try editing /etc/sysconfig/network-scripts/ifcfg-ethX and amending the name of the file and the interface name inside it. I'd also check /etc/modprobe.* for alias lines. There may be other places that need to be changed that I don't know about - /etc/udev/rules.d perhaps.

voyager
Posts: 15
Joined: 2010/11/02 04:25:14

Re: Can I change my interaface "p3pl" to "eth0"?

Postby voyager » 2012/03/04 06:56:10

Thanks very much for your explanation.

Now I know "p3p1" is not an error, but rather an amazing engineering decision. Why, as an user, do I need to remember which PCI slot my network card inserted into? And my company's IT need to remember all the card slots in all our PCs now. There will be a big impact. (I'm not complain to you, but to the decision makers in the backend.) This is going to make Linux even less user-friendly.

I wish they provide a mechanism for port aliases so we can still use "eth0", "eth1",... Otherwise there will be many broken applications and code as well.

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

Re: Can I change my interaface "p3pl" to "eth0"?

Postby jlehtone » 2012/03/04 11:48:22

voyager wrote:
I wish they provide a mechanism for port aliases so we can still use "eth0", "eth1",... Otherwise there will be many broken applications and code as well.

First, any application hardcoded to use a name like "eth0" is IMHO broken from start and deserves "dd if=/dev/zero of=sourcecode" treatment.

There are two "rename interfaces" methods and they have been around for years. The older RH method uses the HWADDR variable. The udev rules are the other method.

User avatar
TrevorH
Forum Moderator
Posts: 19147
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can I change my interaface "p3pl" to "eth0"?

Postby TrevorH » 2012/03/04 13:29:07

Actually I think the change is a good thing(tm). Who cares what the interface is called - it's not needed by any applications - you bind to network addresses not to port names. What it does do is easily differentiate between embedded devices (emX) and plugin devices and for plugin devices it tells you which slot the malfunctioning card is plugged into when you need to replace it.

voyager
Posts: 15
Joined: 2010/11/02 04:25:14

Re: Can I change my interaface "p3pl" to "eth0"?

Postby voyager » 2012/03/04 19:49:30

Regardless whatever technical merit this naming scheme may have, any well known interfaces should not be changed easily. The "eth..." names are used all over the places. I just check the man page for iptables. Surely enough, the examples it gives are all like "iptables -A PREROUTING -t mangle -i eth1 ..." which need an update now. I guess you guys just have no idea what this little change may impact.

I'm not going to debate with you and would like to end this thread here.

User avatar
TrevorH
Forum Moderator
Posts: 19147
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Can I change my interaface "p3pl" to "eth0"?

Postby TrevorH » 2012/03/04 20:40:57

It has no effect on iptables except that you substitute that interface name for the other. Iptables doesn't care whether you use eth0, br0, bond0, p3p0 or em0.

For your information, I didn't make this change nor did anyone within CentOS. Redhat made the change and it only affects new installs of 6.2 and does not affect upgrades so existing installs will continue to run exactly as they did before. I already told you that since this is possible, it must therefore be possible to make the 6.2 new install do the same thing and I was kind enough to point you to the 2 or 3 files that I could think of that you might need to change to make this happen. Remind me next time you ask for help not to even bother to answer you.

hawkmage
Posts: 160
Joined: 2011/12/17 00:00:11

Re: Can I change my interaface "p3pl" to "eth0"?

Postby hawkmage » 2012/03/05 04:43:15

voyager wrote:
Regardless whatever technical merit this naming scheme may have, any well known interfaces should not be changed easily. The "eth..." names are used all over the places. I just check the man page for iptables. Surely enough, the examples it gives are all like "iptables -A PREROUTING -t mangle -i eth1 ..." which need an update now. I guess you guys just have no idea what this little change may impact.

I'm not going to debate with you and would like to end this thread here.

Since I run a number of Virtual systems and most of the time I so a kernel update and have have to update the Guest utilities the interface name changes from eth0 to eht1 to eth2 etc. I for one am glad of this change to keep the name the same.

Then again since I work with RedHat, Debian and BSD based Linux as well as Solaris I don't have an issues with having interfaces not named eth*

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

Re: Can I change my interaface "p3pl" to "eth0"?

Postby jlehtone » 2012/03/05 08:00:14

voyager wrote:
I'm not going to debate with you ...

Answering to the question: "Is is possible to rename interfaces and how?" is not a debate.

Looking more closely to the ifup* scripts it does now look like the "rename-interfaces during ifup"
routine has been purged and the interface naming relies on the udev. There is a file

Code: Select all

/etc/udev/rules.d/70-persistent-net.rules
that sets the names. That file has been generated on install/firstboot. Pre-6.2 installs have
created the file with eth*-style names and updates won't touch it. 6.2 installs will generate
names according to the new scheme. There is a twist though. The persistent rule generating
script (which is run only once) appears to use variable HWADDR from
/etc/sysconfig/network-scripts/ifcfg-*.


Bottomline:
Edit the /etc/udev/rules.d/70-persistent-net.rules

scottro
Forum Moderator
Posts: 2293
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Can I change my interaface "p3pl" to "eth0"?

Postby scottro » 2012/03/06 21:34:29

Wow, I can't believe that this one made it into CentOS--which means, it made it into RHEL.

Though some like it, others, like a commentor on slashdot, feel it's "overcomplicated and unnecessary". Not to mention whatever scripts it will break.

I'm not arrogant enough to believe that just because I dislike it doesn't mean it is definitely no good, but, at least unlike many Fedora inspired changes, it's easy enough to
change.

http://fedoraproject.org/wiki/Features/ ... viceNaming


Return to “CentOS 6 - Networking Support”

Who is online

Users browsing this forum: No registered users and 1 guest