LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-04-2010, 02:26 AM   #1
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Rep: Reputation: 16
NIC Card Mapping


Hi all,
I have two NIC cards in my system. However, NIC1 is assigned to eth1 and NIC2 is assigned to eth0. Beside manually swap MAC address from /etc/udev/rules.d/70-persistent-net.rules to make it change NIC1 to eth0 and NIC2 to eth2, there is another way? When and where the system detect the nic card at boot up and assign to the port? I am running Fedora 10. Thanks in advance.
 
Old 02-04-2010, 02:44 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
I don't know what you have against udev, but if you the two nics use different drivers, you would try modprobe'ing the drivers in the order that you want the devices named. Another option is a tool called ifrename: that is what I used to use back in the dark ages.

Evo2.
 
Old 02-04-2010, 02:46 AM   #3
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
I just reread your post:

Quote:
Beside manually swap MAC address from /etc/udev/rules.d/70-persistent-net.rules
Using udev in this way does *not* swap your mac address.

Evo2.
 
Old 02-04-2010, 05:42 AM   #4
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
The udev way is the easiest one, it can't get easier than that. Just edit a text file, and reboot (rebooting perhaps not needed?). Or you're looking for a point-and-click interface for that?
 
Old 02-04-2010, 06:44 AM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Just restarting udev should be enough.

Cheers,

Evo2
 
Old 02-04-2010, 10:51 AM   #6
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by evo2 View Post
I just reread your post:


Using udev in this way does *not* swap your mac address.

Evo2.
What I am saying is modify etc/udev/rules.d/70-persistent-net.rules how it's eth order to MAC address. I also have to modify ifcfc-eth file to the right MAC address that was assign in 70-persistent-net.rules file.
 
Old 02-04-2010, 06:30 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,361

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Set the MAC addresses in the eth cfg files. What distro is this?
 
Old 02-05-2010, 02:11 AM   #8
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by nodopro View Post
What I am saying is modify etc/udev/rules.d/70-persistent-net.rules how it's eth order to MAC address. I also have to modify ifcfc-eth file to the right MAC address that was assign in 70-persistent-net.rules file.
Sorry, I don't follow what you are talking about. What are you trying to do related to the mac address? Are you spoofing the mac address with calls like?

Code:
ifconfig eth0 hw ether 00:11:22:33:44:55
If so, this is unrelated to the udev rule which should be run before the above and use the real mac address of the device.

Evo2.
 
Old 02-06-2010, 02:17 AM   #9
nodopro
Member
 
Registered: Oct 2008
Posts: 48

Original Poster
Rep: Reputation: 16
I finally use ifrename with specific config. The reason I like to setup this way is because I am going to setup multiple units having the same hardware. Thanks all for your comments and suggestions.

-nodopro
 
  


Reply



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
eth0 NIC Card Not Working! 3com 3c501 NIC. Mustard010 Linux - Networking 16 08-15-2007 02:22 AM
NIC Of NIC/Graphics Card Combo Not Detected username132 Linux - Hardware 2 04-04-2006 10:16 PM
NIC and Interface Device mapping info? dileepkk Linux - Networking 3 07-20-2004 05:33 AM
Mapping between interface and nic jes Linux - Hardware 1 11-10-2003 09:00 PM
Mapping between interface and nic jes Linux - Networking 1 11-10-2003 05:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:36 PM.

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