Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Well, under Red Hat it looks slight diffrent. It looks like RHEL does not use udev ( correct me if i am wrong but there is no simillar file in /etc/udev/rules.d and cant see any script in /etc/init.d/).
I have found that all NIC configuration is stored in /etc/sysconfig/netwotk-scripts/ifcfg-ethx.
On this file it is possible to place varible: HARDWARE=
However after reboot it doesnt work.
So, my question is - how to assign eth[number] to specified MAC-addr ?
You can always create a bash script to change them. And you only really need to change the DEVICE=ethX line (2 letters max) and file name ( also 2 letters max).
Those files can carry MUCH more informations then meets the eye, and they do not require HWADDR line. You can place it in only 1-2 files and the rest will get them in order kernel finds them and enumerates them.
Combined with ifcfg-ethX files are route-ethX where you can set your entire static routing.
Since you can also have ifcfg-br0 files, you can create bridges from files and by only changing insides of the ifcfg-eth0 you can make them members of those bridges.
Another good thing is that you can (for laptops mostly) many different ifcfg-XXXXXXXX files all with similar but different contents and activate them as you see fit. File names are not important for deciding the interface name, just are handy for human recognition. For example, if you are in your office, run "ifup ifcfg-eth0_office". When you reach your home, run "ifdown ifcfg-eth0_office; ifup ifcfg_eth0_home". Since GATEWAY=xxx.xxx.xxx.xxx can also be the part of the ifcfg-ethX file, you effectively should change your default route also (Most of us use NetworkManager and network profiles to do this for us (/etc/sysconfig/networking/profiles).
Virtual IP's are also easy to create. You just create/copy file ifcfg-ethX:0(1,2,...), change IP information and remove all the necessary lines and activate those interfaces or entire network service and that is it.
I also bet they it is much harder to change MAC address on the Windows you are writing from then from the Linux-es we are writing from
DrLove73 - why u r still writing about ifcfg-eth scripts ?
I have answered u that it doesnt work after reboot. AI have also written that at beginning of this topis.
Please stop repeating what ifcfg scripts can do.
Im looking for a file where I can assign MAC addr to ethX.
That is why I have shown example with Slackware.
On this file it is possible to place varible: HARDWARE=
However after reboot it doesnt work.
Variable is HWADDR, not HARDWARE. Check my examples.
Quote:
Originally Posted by czezz
DrLove73 - why u r still writing about ifcfg-eth scripts ?
I have answered u that it doesnt work after reboot. AI have also written that at beginning of this topis.
Please stop repeating what ifcfg scripts can do.
Im looking for a file where I can assign MAC addr to ethX.
That is why I have shown example with Slackware.
I successfully changed the order of the eth interfaces by changing the HWADDR line in ifcfg-ethX many times. That is why I am still writing about it. As far as I know, this is the ONLY way to pair up MAC address to a speific ethX interface on RHEL/CentOS/Fedora.
DrLove73 - once again. Please stop repeating about ifcfg scripts. I told u many times above that it DOESNT WORK AFTER REBOOT (for sure - not for 20 int.). Also please note - Im not asking about ifcfg syntax.
I am looking for working solution.
Anyone know it ?
I also asked for /etc/sysconfig/hwconf which is for kudzu - is this good way ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.