LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-02-2010, 03:49 PM   #1
threepointonefour
LQ Newbie
 
Registered: Oct 2009
Posts: 22

Rep: Reputation: 15
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.
 
Old 04-02-2010, 06:01 PM   #2
halon1301
LQ Newbie
 
Registered: Jul 2008
Location: Auckland, New Zealand
Distribution: Free/Open BSD and Ubuntu
Posts: 9

Rep: Reputation: 1
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?
 
Old 04-02-2010, 07:03 PM   #3
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
To original poster:

This might be a silly question, but can you explain what did you intend to do with your ethernet cards?
 
Old 04-02-2010, 07:10 PM   #4
threepointonefour
LQ Newbie
 
Registered: Oct 2009
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by nimnull22 View Post
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..

Last edited by threepointonefour; 04-02-2010 at 07:11 PM.
 
Old 04-02-2010, 07:34 PM   #5
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
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.

Last edited by nimnull22; 04-02-2010 at 07:36 PM.
 
Old 04-02-2010, 07:39 PM   #6
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Actually what do get if execute:
man -k ifcfg

Is there man page for ifcfg in FC5?
 
Old 04-02-2010, 08:25 PM   #7
threepointonefour
LQ Newbie
 
Registered: Oct 2009
Posts: 22

Original Poster
Rep: Reputation: 15
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.
 
Old 04-02-2010, 08:48 PM   #8
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
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 ?
 
Old 04-02-2010, 09:05 PM   #9
threepointonefour
LQ Newbie
 
Registered: Oct 2009
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by nimnull22 View Post
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?
 
Old 04-02-2010, 09:15 PM   #10
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
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.
 
Old 04-02-2010, 11:45 PM   #11
threepointonefour
LQ Newbie
 
Registered: Oct 2009
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by nimnull22 View Post
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gateway setting ./network-scripts/ifcfg-eth1 and ./network joshfields Linux - Networking 1 04-29-2012 04:27 AM
modprobe doesn't work; why is modprobe.conf deprecated in slack 12? aquilolumen Slackware 13 08-26-2007 02:05 AM
Questions re - /etc/modprobe.d/modprobe.conf The_Outlander Slackware 9 12-12-2006 08:28 PM
[FC2] How to write a modprobe.conf from a module.conf??? Coume Fedora 0 05-31-2004 03:40 AM
ifcfg-eth0 configuration problem shyam Linux - Networking 2 08-06-2003 06:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration