LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Fixing Network Configuration - modprobe.conf, hwconf, ifcfg-ethn changes..? (https://www.linuxquestions.org/questions/linux-networking-3/fixing-network-configuration-modprobe-conf-hwconf-ifcfg-ethn-changes-799658/)

threepointonefour 04-02-2010 03:49 PM

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:

Quote:

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 and if I could just get it back to the onboard cards being eth0 / eth1 and the PCI gigabit card being eth2, I can probably start working from there again (and MAYBE even get ifrename to work).

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.

halon1301 04-02-2010 06:01 PM

Forgive me if I'm not understanding you correctly but I believe you're trying to swap which NICs are being used by default?

I have had a similar problem and managed to solve this by just swapping around the routes in the route table. Don't know if that would work for your though. Am I understanding your problem correctly?

nimnull22 04-02-2010 07:03 PM

To original poster:

This might be a silly question, but can you explain what did you intend to do with your ethernet cards?

threepointonefour 04-02-2010 07:10 PM

Quote:

Originally Posted by nimnull22 (Post 3922322)
To original poster:

This might be a silly question, but can you explain what did you intend to do with your ethernet cards?

The intent was to use the PCI Intel gigabit card as eth0 (the default card) to get higher performance for an application we're running.

I'd be happy to totally REMOVE the other one, but it's onboard.

Quote:

Forgive me if I'm not understanding you correctly but I believe you're trying to swap which NICs are being used by default?

I have had a similar problem and managed to solve this by just swapping around the routes in the route table. Don't know if that would work for your though. Am I understanding your problem correctly?
Yes pretty much. We need the PCI card to be eth0..

nimnull22 04-02-2010 07:34 PM

If you do not want to see cards with certain driver, just add it to blacklist file.

If you want to configure just one cars, but leave otherS as is, you can remove or change STARTMODE to "manual" or ONBOOT= no. And it never goes to UP, then you can just use "ifup" to bring necessary one UP. There should be ifcfg-ethN file with options.

I do not think that FC5 is the same as Fedora 12, but some might be similar.

nimnull22 04-02-2010 07:39 PM

Actually what do get if execute:
man -k ifcfg

Is there man page for ifcfg in FC5?

threepointonefour 04-02-2010 08:25 PM

Does bringing them all down other than that one card effectively make it eth0?

And.. I'd still ideally like to restart everything.. I really feel like I've jumbled something up somewhere (like seeing MAC addresses that don't exist, although I've found in some backup files that those existed prior to my working on this, so it's not ALL my doing...) but I think it could do with a bit of cleaning if it's possible somehow... I just don't know how to go about it.

nimnull22 04-02-2010 08:48 PM

Eth0 or eth1 - this doesn't make any difference. Because neither one program or service will use its name. What important is its IP and routing.

Card configuration in file called - ifcfg-ethN.
Remove from if any unnecessary settings, and you will get defaults. Anyway one can change only MAC and IP addresses.
Can you post here content of ifcfg-eth0, ifcfg-eth1, ifcfg-eth2 ?

threepointonefour 04-02-2010 09:05 PM

Quote:

Originally Posted by nimnull22 (Post 3922397)
Eth0 or eth1 - this doesn't make any difference. Because neither one program or service will use its name. What important is its IP and routing.

Card configuration in file called - ifcfg-ethN.
Remove from if any unnecessary settings, and you will get defaults. Anyway one can change only MAC and IP addresses.
Can you post here content of ifcfg-eth0, ifcfg-eth1, ifcfg-eth2 ?

I can't post those until Monday morning (when I'll be back at work).

What about all of the settings in hwconf and modprobe.conf?

nimnull22 04-02-2010 09:15 PM

hwconf - is just information about hardware.
modprobe.conf - makes aliases, and honestly I do not know why, because normally I personally do not really care what is my card name is - eth0 or eth1, it doesn't make any difference, as long as you can define which one to bring UP. If you remove LLADDR from ifcfg-ethN (it is my opensuse) your card get its original MAC address, and then executed "ifconfig -a" you will see all cards and then you can bring UP what you need.

threepointonefour 04-02-2010 11:45 PM

Quote:

Originally Posted by nimnull22 (Post 3922415)
hwconf - is just information about hardware.
modprobe.conf - makes aliases, and honestly I do not know why, because normally I personally do not really care what is my card name is - eth0 or eth1, it doesn't make any difference, as long as you can define which one to bring UP. If you remove LLADDR from ifcfg-ethN (it is my opensuse) your card get its original MAC address, and then executed "ifconfig -a" you will see all cards and then you can bring UP what you need.

Right but I had edited hwconf manually to make eth0 match what I wanted it to and all that and ... yeah. I mean all I had done was move a few eth*s around (and the drivers)..

I guess I'm really confused about all of this. There's eth0/1/2 all that in modprobe.conf.. then again in hwconf.. then again in the ifcfg-eth* files.. and I THOUGHT they ALL had to match but.. I have systems where they don't and it still works? :/

So I guess I just don't understand...


All times are GMT -5. The time now is 04:34 AM.