change eth1 to eth0 ?
Hello Red Hat users!
I'd like to ask you all for a simple thing on Slackware that I dont know how to do under RHEL 5.4. Under Slackware 12.2 it is easy to change eth0 to eth1. This should be done in file: /etc/udev/rules.d/75-network-devices.rules: Code:
KERNEL=="eth?", ATTR{address}=="00:0c:29:a3:ed:27", NAME="eth1" Code:
# /etc/rc.d/rc.udev restart 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 need to change "X" in ethX both on the file itself AND inside. The "DEVICE=ethX" is actually used to identify what file is for what interface.
So if you change ifcfg-eth0 with: Code:
DEVICE=eth0 Code:
DEVICE=eth1 |
Redhat does use udev, but not for this purpose AFAIK.
Also, see this howto. |
DrLove73... come on!
I have just written that ifcfg-ethX (where X = 1,2,3,4,5,6,7,8,9...n). The scripts ifcfg-ethX doesnt work well after reboot. I have machine with 20 network interfaces (eth0 to eth19). Its a real problem to me. I have also find that MAC addr are set in /etc/sysconfig/hwconf file which is managed by kudzu. Is this good idea to make changes there ? Come on Red Hat users! On Slackware it's a pice of cake ;) |
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. |
You wrote:
Quote:
Quote:
|
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 ? Does anyone is Red-Hat expert here ? |
All times are GMT -5. The time now is 04:41 AM. |