FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Feb 2013
    Location
    china
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to change network device name p4p1 to eth0 in Fedora 18?

    How to change network device name p4p1 to eth0 in Fedora 18?
    Please give a detailed description, because I am a newbie.

  2. #2
    Join Date
    Dec 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    Try going to /etc/udev/rules.d. Edit the file 70-persistent-net.rules. There will be a line that has NAME="p4p1". Change it to NAME="eth0" and reboot.

    Afterthought: You may also need to disable the routine "biosdevname" . Best way to do this is to edit the file /etc/default/grub to add "biosdevname=0" to the line GRUB_CMDLINE_LINUX. Then rebuild your grub.cfg file by executing the command "grub2-mkconfig -o /boot/grub2/grub.cfg" followed by a reboot.
    Last edited by leehol; 22nd February 2013 at 05:16 PM.

  3. #3
    Join Date
    Feb 2013
    Location
    china
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    Quote Originally Posted by leehol
    Try going to /etc/udev/rules.d. Edit the file 70-persistent-net.rules. There will be a line that has NAME="p4p1". Change it to NAME="eth0" and reboot.

    Afterthought: You may also need to disable the routine "biosdevname" . Best way to do this is to edit the file /etc/default/grub to add "biosdevname=0" to the line GRUB_CMDLINE_LINUX. Then rebuild your grub.cfg file by executing the command "grub2-mkconfig -o /boot/grub2/grub.cfg" followed by a reboot.
    Thank you very much.

  4. #4
    dobbi Guest

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    3.3. Networking
    3.3.1. Consistent network device naming
    Fedora 18 continues the previous releases' use of biosdevname to set network device names in a deterministic manner. Ethernet ports embedded on server motherboards will be named emport_number, while ports on PCI cards will be named pslot_numberpport_number, corresponding to the chassis labels. This feature may be disabled by passing biosdevname=0 on the kernel command line, in which case, behavior will revert to using ethX names.
    https://docs.fedoraproject.org/en-US...r_Desktop.html

    You may continue to write rules in /etc/udev/rules.d/70-persistent-net.rules to change the device names to anything you wish. Such will take precedence over this physical location naming scheme. Such rules may look like:

    Code:
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:11:22:33:44:55", ATTR{type}=="1", KERNEL=="eth*", NAME="public"
    This feature may be disabled by passing "biosdevname=0" on the kernel command line, in which case, behavior will revert to using ethX names.

    Upgrading from an earlier version of Fedora (including 15-Alpha or -Beta) to Fedora 15 may result in a change of network device names from an earlier biosdevname naming scheme to the final naming scheme described here. Configuration files must be manually adjusted accordingly.
    https://fedoraproject.org/wiki/Featu...rkDeviceNaming

    WARNING: Every single time you read "REMOVE", "DELETE" or the like translate it to "RENAME" or "Comment out", never delete anything without making a backup of it first, if things go wrong you can at least go back to the way things were.

    Resources:
    https://alteeve.ca/w/Changing_Ethern...d_Fedora_15%2B
    http://www.debianadmin.com/rename-ne...-in-linux.html
    http://www.science.uva.nl/research/a...InterfaceNames

  5. #5
    Join Date
    Feb 2013
    Location
    china
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    Quote Originally Posted by dobbi
    https://docs.fedoraproject.org/en-US...r_Desktop.html


    https://fedoraproject.org/wiki/Featu...rkDeviceNaming

    WARNING: Every single time you read "REMOVE", "DELETE" or the like translate it to "RENAME" or "Comment out", never delete anything without making a backup of it first, if things go wrong you can at least go back to the way things were.

    Resources:
    https://alteeve.ca/w/Changing_Ethern...d_Fedora_15%2B
    http://www.debianadmin.com/rename-ne...-in-linux.html
    http://www.science.uva.nl/research/a...InterfaceNames
    I can not find the file: 70-persistent-net.rules, please provide further help.

  6. #6
    Join Date
    Jan 2010
    Posts
    8,687
    Mentioned
    41 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    I don't think Fedora has the net rules by default anymore, at least my install doesn't have it.

    I fix it by first removing biosdevname


    yum remove biosdevname


    I then manually rename /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0 (or whatever interface is in question)

    I then edit the file itself, replacing the biosdev name with eth0 in the Name= line.

    Then reboot.

    This works for me. I make no claims that it's a good way or won't break something else, but it's what I've been doing since they made the decision to do the biosdevname thing. For what it's worth, I also make sure that I have NM_CONTROLLED=no in my /etc/sysconfig/network-scripts/ifcfg-whatever file.

  7. #7
    Join Date
    Jan 2010
    Posts
    8,687
    Mentioned
    41 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    Note that in F19, this no longer works. Easiest way seems to be to run rpm -e biosdevname, and also add net.ifnames=0 to the end of the kernel line in /etc/default/grub. I then edited /etc/sysconfig/network-scripts/ifcfg-<ifname> as mentioned above.

    The other method which also works is to create an /etc/udev/rules.d/70

    http://rackerhacker.com/2011/09/25/g...-in-fedora-15/
    gives a good explanation.

    Unfortunately, this seems to be another instance where we'll have to get used to it--I suspect it will continue to get harder and harder to work around.

  8. #8
    Join Date
    Jan 2010
    Posts
    8,687
    Mentioned
    41 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    Well, on a test of TC4, the ifnames=0 doesn't seem to work. Only thing working now is to use the udev rules that I link in the post above.



    EDIT.

    Ok, I may have made a typo somewhere, but I don't think so. It looks as if even adding a udev rules file isn't working.

    Maybe a bug, maybe yet another RH feature, no more time to check right now.

    EDIT again
    Oh....kay. Adding both biosdevnames=0 and net.ifnames=0 seems to have fixed the problem. The udev rules.d file isn't necessary.
    Last edited by smr54; 4th April 2013 at 04:01 PM.

  9. #9
    Join Date
    Feb 2013
    Location
    china
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    Quote Originally Posted by smr54
    I don't think Fedora has the net rules by default anymore, at least my install doesn't have it.

    I fix it by first removing biosdevname


    yum remove biosdevname


    I then manually rename /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0 (or whatever interface is in question)

    I then edit the file itself, replacing the biosdev name with eth0 in the Name= line.

    Then reboot.

    This works for me. I make no claims that it's a good way or won't break something else, but it's what I've been doing since they made the decision to do the biosdevname thing. For what it's worth, I also make sure that I have NM_CONTROLLED=no in my /etc/sysconfig/network-scripts/ifcfg-whatever file.
    Thank you smr54!!! it solved my problem.

  10. #10
    Join Date
    Jan 2010
    Posts
    8,687
    Mentioned
    41 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    Glad to hear it, but I am finding that after doing all this, I still need to put (on F19 and probably 18) net.ifnames=0 in /etc/default/grub on the kernel line, and then running grub2-mkconfig -o /boot/grub2/grub.cfg

  11. #11
    stevea Guest

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    In the immortal words of Dan, "Why ?"

    The biosdevname feature is a major imrovement over eth0, 1 .. .wher ethe order and name have no relation to the physical interfaces and ames like ethh0 <-> eth1 can swap anytime the kernel or udev config changes.

    So what exactly is the advantage of switching to eth0 .. ? I don't see it at all.

    ==

    Having said that - to change the interface name you can use ....
    ip link set p4p1 down
    ip link set p4p1 name eth0
    ip link set p4p1 up

    or the ancient and possibly deprecated 'ifrename' utility is simple and effective.

  12. #12
    Join Date
    Aug 2009
    Posts
    11,390
    Mentioned
    98 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    actually, they had changed the udev rules where eth* was pretty well ironed out and didn't change. They had it where udev would detect the network cards, and look in it's own udev rules file to determine how to name them. If it had assigned a device name for the adapter before, it would be in it's rules file with a specific hardware address, and udev would use that to name it, if it had never been detected before, then udev would assign a new device name, and add it to it's rules file.

    This pretty much kept the device naming consistent over reboots, with the only glitch occurring if you ever removed a network adapter. It wouldn't go back and change it's rules file, so if you removed eth1 and installed a new adapter, it would get named eth2 (if you didn't already have an eth2) skipping eth1. If you wanted it to go back and reuse the eth* names, you had to delete the old entries from the rules file.

    Fedora 19 has changed up the device naming once again, and it's even weirder names

  13. #13
    Join Date
    Jan 2013
    Location
    The Netherlands
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    Quote Originally Posted by stevea
    In the immortal words of Dan, "Why ?"
    the answer for me is: Matlab! their activation system relies on a network device named eth?


    Just to be clear, I've used a combination of the tips posted by smr54,
    for me (FC19) the solution was:
    1) yum remove biosdevname
    2) add net.ifnames=0 to GRUB_CMDLINE_LINUX in /etc/default/grub
    3) grub2-mkconfig -o /boot/grub2/grub.cfg
    4) rename /etc/sysconfig/network-scripts/ifcfg-whatever to ifcfg-eth0
    5) change to NAME=eth0 inside ifcfg-eth0
    Last edited by Jann5s; 7th July 2013 at 04:41 PM.

  14. #14
    Join Date
    Jun 2010
    Location
    Lost...
    Posts
    1,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    The naming is done by udev, and only if the interface does not have a name yet.
    So, you just have to write a custom rule. What I did in FC19 is to create the file '/etc/udev/rules.d/75-persistent-net.rules' with the content:
    Code:
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="<THE MAC ADDRESS>", NAME="eth0"
    Replace <THE MAC ADDRESS> by the mac address of the card.
    Create a line by interface. The name will be set at the next boot.
    :confused:

  15. #15
    Join Date
    Jul 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to change network device name p4p1 to eth0 in Fedora 18?

    Excellent solution skull; worked perfectly. Thanks.

Page 1 of 2 12 LastLast

Similar Threads

  1. cannot activate network device eth0
    By serge88102 in forum Installation, Upgrades and Live Media
    Replies: 18
    Last Post: 28th September 2014, 10:51 PM
  2. [SOLVED] udev renames eth0 to p4p1 (?)
    By matth45 in forum Servers & Networking
    Replies: 4
    Last Post: 28th March 2012, 09:10 PM
  3. Fedora 16: Need to Change p4p1 to eth0
    By BECKConfused in forum Installation, Upgrades and Live Media
    Replies: 4
    Last Post: 12th January 2012, 05:28 AM
  4. Cannot activate network device eth0!
    By teknowcat in forum Installation, Upgrades and Live Media
    Replies: 15
    Last Post: 22nd August 2008, 08:11 PM
  5. fedora 5 cannot activate network device eth0
    By TScorpion in forum Installation, Upgrades and Live Media
    Replies: 2
    Last Post: 10th April 2006, 06:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •