Find the answer to your Linux question:
Results 1 to 6 of 6
Okay so. I was trying to set up my network card configuration on FC5 (I know, old but it's what I'm stuck with for these systems) and I'm not sure ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    24

    Fixing Network Configuration - modprobe.conf, hwconf, ifcfg-ethn changes..?


    Okay so. I was trying to set up my network card configuration on FC5 (I know, old but it's what I'm stuck with for these systems) and I'm not sure that I'm going about it quite right. Well, truth be told I know I didn't go about it the standard way, I'm just not sure how wrong it is or isn't.

    My explanation is long, painful, but if anyone can help it would be IMMENSELY appreciated more than I can express. ESPECIALLY if someone can really explain to me what I did wrong where.

    Someone suggested to me trying ifrename, but that didn't go very well for whatever reason.. Maybe it's something about FC5, I don't know. And 70.persistent doesn't exist in FC5 either, so I resorted to trying to edit the absolute crap out of some system files:

    Here's basically what I tried:

    Steps taken to swap network cards such that a desired NIC becomes the default NIC and packets are by default sent via that card:

    -- Collect good notes before changing anything, and back up copies of the original files!


    1. Edit the modprobe.conf file (located in /etc/modprobe.conf) so that the aliases we want to use match the drivers (modules) we're going to use.

    For example, if the current set up is:

    alias eth0 forcedeth
    alias eth1 forcedeth
    alias eth2 e1000


    And we desire to use the e1000 card as our primary NIC, we can rotate them such that we have them like this:

    alias eth0 e1000
    alias eth1 forcedeth
    alias eth2 forcedeth


    Now the devices which are aliased to eth1 and eth2 will use the forcedeth driver, and the device aliased to eth0 will use the e1000 driver.


    2. View the hwconf file (located in /etc/sysconfig/hwconf).


    Before swapping the network cards, the setup is most likely along these lines:
    class: NETWORK
    bus: PCI
    detached: 0
    device: eth0
    driver: forcedeth
    desc: "nVidia Card"
    network.hwaddr: 00:XX:XX:XX:XX:CC
    ....


    class: NETWORK
    bus: PCI
    detached: 0
    device: eth1
    driver: forcedeth
    desc: "nVidia Card"
    network.hwaddr: 00:XX:XX:XX:XX:CD
    ....


    class: NETWORK
    bus: PCI
    detached: 0
    device: eth2
    driver: e1000
    desc: "Intel Card"
    network.hwadd: 00:XX:XX:XX:XX:81
    ...


    To change is to that the Intel card is eth0 ( the first used and default card ), change the file to read as follows (after changing the modprobe.conf so that the aliases and drivers will match.



    class: NETWORK
    bus: PCI
    detached: 0
    device: eth2
    driver: forcedeth
    desc: "nVidia Card"
    newtork.hwaddr: 00:XX:XX:XX:XX:CC



    class: NETWORK
    bus: PCI
    detached: 0
    device: eth1
    driver: forcedeth
    desc: "nVidia Card"
    network.hwaddr: 00:XX:XX:XX:XX:CD


    class: NETWORK
    bus: PCI
    detached: 0
    device: eth0
    driver: e1000
    desc: "Intel Card"
    network.hwaddr: 00:XX:XX:XX:XX:81


    Assuming we have matched the modprobe.conf and the hwconf files, the aliases and drivers now match, and are tied to the MAC addresses of the NICs that we desire them to (we're only really concerned about forcing the Intel card to eth0).




    3. Update the ifcfg-ethn files (where ethn is an alias established in modprobe.conf).
    These should be changed so that the alias matches the hwaddr in the hwconf file, and the filename contains the correct ethn name.

    For example:

    If we were changing eth0 and eth1, we could swap the files ifcfg-eth0 and ifcfg-eth1, and then within the files, change the alias line to match the file name. Then ensure the IP addresses are assigned correctly for what we desire them to be, and configure any onboot settings (if we don't want certain cards to be started on boot, for example).

    When the network is restarted (via /sbin/service network restart, or a reboot), the ifcfg-ethn files will be copied to /etc/sysconfig/networking/profiles/default and /etc/sysconfig/network-scripts, however they can also be manually copied.

    This at first actually seemed to work great. The Intel gigabit cards were being used as eth0 and this persistently held through reboots. However, we noticed a problem with some graphics synchornization cards we are using in the same systems, and we considered the possibility that maybe something when awry while switching the network cards this way.

    So, I went and restored the old backup files, but I must not have done something right because now I'm getting errors complaining that expected MAC addresses don't match the configured MAC addresses, MAC addresses in some of the ifcfg-eth* files that don't even exist in the hwconf files, the modprobe.conf file does NOT match the backup file I KNOW I restored...

    My questions are this:

    1. Is there a way to throw EVERYTHING out network related and get FC5 to redetect it from scratch somehow? This seems to be FUBAR'd something royally.

    2. Where did I go wrong? I know most people would say don't go into those files manually, and probably for this very reason, but ifrename went terribly - the system slowed to an absolute crawl after I ran ifrename on one machine. Needless to say, I was pretty hesitant to try it on another. Maybe I did something horribly wrong, but I do know the hwconf and modprobe.conf and ifcfg-* files were all a bit odd to begin with (aliases such as dev180453256 rather than eth0 or eth1)...

    What should I do doing to clean up this mess? If anyone can suggest something, I'd really appreciate the help.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Quick and dirty, rename all ifcfg-eth# to ifcfg-eth#.old then use the following as a template;

    Code:
    DEVICE=eth0
    BOOTPROTO=static
    BROADCAST=192.168.x.x
    HWADDR=00:xx:xx:xx:xx:xx
    IPADDR=192.168.x.x
    NETMASK=255.255.255.0
    NETWORK=192.168.x.0
    ONBOOT=yes
    TYPE=Ethernet
    Replace the x's with your network information
    Replace the HWADDR with the MAC address of the the nic card you want to be first.

    By placing the MAC addresses into the config files it will used that card for the interface you want.

    As to where you went wrong, you used a utility you didn't understand how it worked or what you were doing. I understand that this is sometimes the best way to learn but you need to plan in advance of this type of learning. Start by reading everything you can get a hold of on line and in the man pages about the utility you are going to use. Second, backing up every file you plan on touching before you touch it. That way should you muck something up you can back out easily.

    As to touching files directly, I don't see this as a problem unless you don't understand what you are doing or what the file is used for and how it is formatted. If you know these things you should be fine.

    I touch my files all the time and don't rely on utilities much when I don't have to.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Oct 2009
    Posts
    24
    Quote Originally Posted by Lazydog View Post
    Quick and dirty, rename all ifcfg-eth# to ifcfg-eth#.old then use the following as a template;

    Code:
    DEVICE=eth0
    BOOTPROTO=static
    BROADCAST=192.168.x.x
    HWADDR=00:xx:xx:xx:xx:xx
    IPADDR=192.168.x.x
    NETMASK=255.255.255.0
    NETWORK=192.168.x.0
    ONBOOT=yes
    TYPE=Ethernet
    Replace the x's with your network information
    Replace the HWADDR with the MAC address of the the nic card you want to be first.

    By placing the MAC addresses into the config files it will used that card for the interface you want.

    As to where you went wrong, you used a utility you didn't understand how it worked or what you were doing. I understand that this is sometimes the best way to learn but you need to plan in advance of this type of learning. Start by reading everything you can get a hold of on line and in the man pages about the utility you are going to use. Second, backing up every file you plan on touching before you touch it. That way should you muck something up you can back out easily.

    As to touching files directly, I don't see this as a problem unless you don't understand what you are doing or what the file is used for and how it is formatted. If you know these things you should be fine.

    I touch my files all the time and don't rely on utilities much when I don't have to.

    I backed up all the files before I edited anything and restored from there, and but I'm not sure they were ever quite right from the beginning.

    Is changing the ifcfg-eth# files going to fix anything that might be out of whack in modprobe.conf or hwconf? Does anything need to be done with them?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    If you backed up everything before you played then you should be able to restore the original files and have everything back to the state it was before you played. Changing the ifcfg-* files is not going to fix other config files. If you mess with them then you need to un-mess them. If all else fails rebuild your system and learn from this.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  6. #5
    Just Joined!
    Join Date
    Oct 2009
    Posts
    24
    Okay.. I really really really appreciate your help so far, but I'm still struggling a bit. I'm officially begging for this to just be explained to me in slow stupid-proof logic on how these files relate because I'm having some problems.

    I don't understand the relationship between modprobe.conf, hwconf, and the ifcfg-eth# files.

    modprobe.conf has
    "alias eth# drivername"
    hwconf has stuff like (most relevant details)
    "device: eth#
    driver: drivername
    network.hwadd: 00:xx:xx:xx:xx:##"
    ifcfg-eth# has stuff like (most relevant details)
    "DEVICE=eth#
    HWADDR=00:xx:xx:xx:xx:##
    IPADDR=192.168.0.###"
    I understand how the HWADDR and network.hwaddr relate, that part's obvious. But from ifcfg-eth#'s DEVICE line to hwconf's device: line to modprobe's line where it has some alias that's an eth#, how can I draw a line between all of these?

    I'm actually not worried about which one eth0,1,2, whatever anymore, because I finally realized that I could just ifdown everything but the one I wanted to use and ifup the one I was going to.

    But.. I'm still having some trouble. Everyone says just set HWADDR in the ifcfg-eth# files to one of the MAC addresses. But I STILL have problems. Sometimes it tells me that "forcedeth device eth# does not seem to be present"... well this is strange because in that eth#'s ifcfg file I put the HWADDR of the device that should be using e1000. Well I wander over to hwconf and look and it's got eth# assigned to a forcedeth device (and the nvidia's MAC address as well.. right device / driver pairing in hwconf at least).

    Then I've been told I could change the DEVICE name in ifcfg-eth# to something else.. this worked on one machine but weirdly. I changed the DEVICE=intel for the ifcfg-eth# file which I had given the HWADDR of my Intel card. Then when I looked in hwconf and it had changed the device:name of the device with the MAC address that I had specified in ifcfg-eth# to that Intel.

    So right now, I have ZERO idea how these files interact anymore.

    I feel like a complete and utter Linux idiot because I usually understand things a LOT better than this. I've read man files, half of the entire internet, asked on forums, and right now I just need someone to completely wipe my mental slate clean and give me a slow, stupid oriented explanation because I've thought I understood this SO many times, just to find out again and again I don't.

  7. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Quote Originally Posted by qwertygeek View Post
    I understand how the HWADDR and network.hwaddr relate, that part's obvious. But from ifcfg-eth#'s DEVICE line to hwconf's device: line to modprobe's line where it has some alias that's an eth#, how can I draw a line between all of these?
    OK, an alias is just that, an Alias. Just another name to call it by. modprobe is just saying when you want to use the eth# you are really looking to call the module it is assigned to. You can think of it like DNS. Names are easier to remember then IP Addresses. DNS Aliases an IPAddress to a name making it easier to remember.

    The DEVICE line is just a marker saying this is how the decive is configured and where it is accessed.

    But.. I'm still having some trouble. Everyone says just set HWADDR in the ifcfg-eth# files to one of the MAC addresses. But I STILL have problems. Sometimes it tells me that "forcedeth device eth# does not seem to be present"... well this is strange because in that eth#'s ifcfg file I put the HWADDR of the device that should be using e1000. Well I wander over to hwconf and look and it's got eth# assigned to a forcedeth device (and the nvidia's MAC address as well.. right device / driver pairing in hwconf at least).
    I would ask then are you sure you have placed the correct MAC ADDR in there?


    Then I've been told I could change the DEVICE name in ifcfg-eth# to something else.. this worked on one machine but weirdly. I changed the DEVICE=intel for the ifcfg-eth# file which I had given the HWADDR of my Intel card. Then when I looked in hwconf and it had changed the device:name of the device with the MAC address that I had specified in ifcfg-eth# to that Intel.
    Never done this. I have had no issues placing the MAC ADDR into the config file of eth#.

    So right now, I have ZERO idea how these files interact anymore.
    I'm no expert on this and I am not sure they interact with one another, but I would assume that the hwconf is used when the system starts up to address all the hardware and where it is located. modeprobe.conf tell the system what alias you are using to access what modules. ifcfg-eth# is stating that you want eth# to be assigned to HWADDR and configure it as listed in that file.

    I feel like a complete and utter Linux idiot because I usually understand things a LOT better than this. I've read man files, half of the entire internet, asked on forums, and right now I just need someone to completely wipe my mental slate clean and give me a slow, stupid oriented explanation because I've thought I understood this SO many times, just to find out again and again I don't.
    No reason to feel that way. Only idiots will not ask a question.

    As I have stated above I'm not an expert and I have never really had any reason to dive into this sort of thing this deeply. So I could be completely wrong and I'm sure someone will correct me.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

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