LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 11-21-2012, 05:18 AM   #1
kankan55
Member
 
Registered: Nov 2012
Posts: 32

Rep: Reputation: Disabled
Question


I use ksdevice=<Mac Address> for pxe boot parameter kickstart installation and I want this mac address to be detected as "eth0" as well.

But it appears to be eth4 all the time.

Is there any way to force that mac address 's name to eth0. just like SLES , they has an boot option udev.rule="mac=<MAC>,name=eth0".

I'm not sure I need to re-order the order of loading module of the initrd.img to make the nic i want appear to be eth0.


Could you please help on this?
Thank you in advance.

Kan

anyone here...

Last edited by unSpawn; 11-21-2012 at 09:15 AM. Reason: //Merged: be patient!
 
Old 11-21-2012, 11:41 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,206

Rep: Reputation: 229Reputation: 229Reputation: 229
Try create a simple text file, and put this line into it:

Code:
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="xxx", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
make sure it is single straight line, observe the spaces per entry: change the "xx:xx:xx:xx:xx:xx" into your MAC address, also ATTR{dev_id}=="xxx" change that to your card's dev_id, (check back if you don't know how to get this argument, or you may try to go without that parameter --just delete that single entry) then save that file as "70-persistent-net.rules" in /etc/udev/rules.d. This manner:

Code:
/etc/udev/rules.d/70-persistent-net.rules
Be sure it is readable:

Quote:
~# chmod 664 70-persistent-net.rules
Reload udevd:

Code:
~# udevadm control --reload
or you may reboot if you wish.

Hope that works.

Good luck.

Last edited by malekmustaq; 11-21-2012 at 11:46 AM.
 
Old 11-21-2012, 12:05 PM   #3
kankan55
Member
 
Registered: Nov 2012
Posts: 32

Original Poster
Rep: Reputation: Disabled
Thanks malekmustaq

But the issue I mentioned is in the installation phase (boot process and the OS is not ready yet).

Let say like How can I manage the nic naming at the first time of the kickstart installation that anaconda start asking for the nic that will be use for load the OS image? I want that NIC to be eth0 instead of eth4 by default.
 
Old 11-21-2012, 09:24 PM   #4
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,206

Rep: Reputation: 229Reputation: 229Reputation: 229
yes am sorry I truly missed your intention, probably I am sleepy.

Well if it is pre-kernel load you can fix that from either the initrd.img (if it can sync) or from the bootloader option, as well as from the server side.

What is the boot loader it got?

Last edited by malekmustaq; 11-21-2012 at 09:25 PM.
 
Old 11-21-2012, 10:01 PM   #5
kankan55
Member
 
Registered: Nov 2012
Posts: 32

Original Poster
Rep: Reputation: Disabled

That is what I looking for , the boot loader option to force the mac address to eth[x]. Like SLES OS that can put below option to the kernel boot paramater
udev.rule="mac=<MAC>,name=eth0"

Is there any equivalent option on REDHAT?

ps, I use grub as bootloader to load kernel and initrd.img. I've try to use udev.rule option but it's not working on REDHAT.

timeout=20
title RHEL 6.3 x86_64
kernel /isolinux/vmlinuz ks=nfs:192.168.0.1:/rhel/ks-63.cfg text nofb edd=off biosdevname=0 ksdevice=00:22:64:77:13:55
udev.rule="mac=00:1a:64:bd:13:86,name=eth0"
module /isolinux/initrd.img

 
Old 11-22-2012, 04:24 AM   #6
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,206

Rep: Reputation: 229Reputation: 229Reputation: 229
You may compile a tailored grub pxe_boot_img using the environment option ‘net_pxe_mac’ grub allows you that. In this pre boot execution you can bind the mac to the protocol and the boot server, yes, no quetions, but... whether you can bind the MAC necessarily to use a link named "eth0" I do not know if this can be done under Grub2; is this not premature yet as udev and inet are not yet running as daemonized? You will fix the mac from the boot server point. I think if there are other ether devices contesting against your mac from the client point, the most practical way is to disable them first and observe what's coming up the loading.

You can gather more info from here and here.

Hope that helps and good luck.
 
Old 11-23-2012, 03:53 AM   #7
kankan55
Member
 
Registered: Nov 2012
Posts: 32

Original Poster
Rep: Reputation: Disabled
I have a work around solution now.
At the %pre section in kick start file.
1. I replace mac address based net udev rule with the pci rule
2. remove all ifcfg-eth* file and copy only ifcfg-eth0 to /etc/sysconfig/network-scripts/
3. reload net module to reload the udev rule
4. down all interface and up only eth0
5. now I got eth0 with the correct nic

Not sure this is the best solution. The hostname is wiped out to localhost when the doing step above.
 
  


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
beginning interface eth0 : device eth0 has different MAC address to expected.FAILED petrofrontier Linux - Software 2 02-28-2011 11:09 AM
vnStat - if pointed to eth0 will it aggregate eth0 and eth0:1 alias stardotstar Linux - Networking 0 07-20-2010 07:49 PM
Production server with static IPs on eth0 and eth0:1 - need private LAN on eth1 stardotstar Linux - Networking 8 07-03-2010 12:27 AM
[SOLVED] OEL5.4 OS, eth0 has private IP, eth0:0 has routable IP, internet access don't work Hiroshi Linux - Networking 7 06-02-2010 12:49 PM
Kickstart Error Error opening kickstart file (null): bad address Latitude Linux - Networking 0 06-03-2009 11:20 AM


All times are GMT -5. The time now is 07:02 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration