Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19
OS: SLES 10 One nic installed # hwinfo --netcard . . . Device File: eth2 . . how can I change "eth2" to "eth0" Regards Needee...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248

    how to change ethX to ethY


    OS: SLES 10
    One nic installed
    # hwinfo --netcard
    .
    .
    .
    Device File: eth2
    .
    .
    how can I change "eth2" to "eth0"
    Regards
    Needee

  2. #2
    Linux Newbie
    Join Date
    May 2006
    Location
    Kansas
    Posts
    187
    It looks like you probably have two other network adapters in your computer. Linux names them starting with eth0, then eth1, etc. as it finds the adapters. If your wireless is eth2, you can't rename it to eth0 because that already exists. The only way that I've ever been able to "rename" them, is to physically remove the first two.

  3. #3
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248
    Thanks Kahoona for help, and sorry for replying late.
    >It looks like you probably have two other network adapters in your computer.
    no I once had, but remove the all other NICs, else this "eth2".. so what I want is that, this eth2, becomes eth0

    >The only way that I've ever been able to "rename" them, is to physically remove the first two.
    i dont agree with you dear, because, as I have said that I have removed other NICs, but still this remaining, and alone NIC exist in the system as "eth2"

    Anyways thanks for help/reply
    Regards
    Needee

  4. #4
    Linux Newbie
    Join Date
    May 2006
    Location
    Kansas
    Posts
    187
    Ahhh..... so you had other NICs that you removed. That makes it different. You need to remove all the NICs from your configuration and then reboot. The remaining NIC should be found and return as eth0. I'm not sure how to remove adapters from the configuration on Linux though.

  5. #5
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248
    kahoona ... once again thanks for the reply/help
    Regards

  6. #6
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248

    Thumbs up

    say you have two nics installed on the system, eth0, and eth1.
    At some times latter, you removed eth0 from the system.
    Now eth1 is the only nic in your machine... and you want to rename this nic(eth1) as eth0.

    following are the steps:

    # rcnetwork stop
    # vi /etc/udev/rules.d/30-net_persistent_names.rules

    here you find a line as
    SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth1"

    simply change eth1, as eth0,
    SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth0"

    save and exit


    Now execute the following command
    # /lib/udev/rename_netiface <old> <new>
    i.e
    # /lib/udev/rename_netiface eth1 eth0

    # rcnetwork start

    DONE

    even we can give any valid name to our nic, say e.g we want to name our eth0 as lan0, then
    # rcnetwork stop
    # vi /etc/udev/rules.d/30-net_persistent_names.rules
    here you find a line as
    SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth0"

    simply change eth1, as lan0,
    SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k lan0"

    Now execute the following command
    # /lib/udev/rename_netiface eth0 lan0

    NOTE:
    say we gave our nic a name as lanX, nicX, or intX(i.e non ethX name), and then want to change the name from lan0 to eth0, all the above steps are required, and reboot too.

    Regards
    Needee

  7. #7
    Just Joined!
    Join Date
    May 2007
    Posts
    1
    needee,

    Thanks a lot!!!
    Looking for this for hours....

  8. #8
    Just Joined!
    Join Date
    Jun 2007
    Posts
    1
    Needee,

    This answer helped me a lot as well thank you very much!

    Cheers,
    Lucas

  9. #9
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248
    My Pleasure

  10. #10
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248
    I also have post this TIP on novell coolsolutions ....
    Cool Solutions: Renaming a NIC
    [ SO PLZ RATE THIS TIP .. thanx in anticipation ]

    Greedee
    Needee

Page 1 of 2 1 2 LastLast

Posting Permissions

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