-   Linux - Networking (
-   -   How can I change/set the MAC address at boot time under SuSE? (

Basel 10-19-2006 12:51 AM

How can I change/set the MAC address at boot time under SuSE?
Currently I use ifconfig to change the MAC address after booting the machine as follows:

openSUSE:~ # ifconfig eth1 down
openSUSE:~ # ifconfig eth1 hw ether yy:yy:yy:yy:yy:yy
openSUSE:~ # ifconfig eth1 up

I tried setting the LLADDR to "yy:yy:yy:yy:yy:yy" in /etc/sysconfig/network/ifcfg-eth-id-xx:xx:xx:xx:xx:xx as hinted by ifcfg.template but it did not work. Under Slackware I would simply add HWADDR to rc.inet1.conf but I am not sure as of how to do it under SuSE.

andrewdodsworth 10-19-2006 03:23 AM

I agree with you - the ifcfg-template says it should work and when I've needed to use special stuff (wireless cards usually) putting it in eth-xx works. However, there's nothing stopping you putting your ifconfig commands in a script and putting them in /etc/init.d/boot.local.

Not as elegant but it works!

Basel 10-19-2006 09:05 AM

boot.local says:

# Here you should add things, that should happen directly after booting
# before we're going to the first run level.

Does that mean the script would run before dhcpcd?

ok4life 10-19-2006 10:30 AM

I would say yes. considering the your run level will start or not start the Network which this may just set a MAC add then change it back on you. I may play with it on my laptop I got Suse 10.0 on it. If you find it works or another elegant way post it up this is a common thing for me to have to do for offsite configuration. (to many MAC changes my ISP locks me down, MAC+IP binding)

andrewdodsworth 10-19-2006 11:20 AM

Sorry you're right! Had a look at startup log and boot.local gets run before the network stuff is started.

I'll have a play with scripts in /etc/init.d and let you know.

andrewdodsworth 10-19-2006 12:01 PM

Well I tried just putting the ifconfig statements in boot.local, rebooted (twice just to make sure) and it worked!

Let me know if it works for you.

Basel 10-20-2006 01:23 AM

Thank you everyone it worked :)

All times are GMT -5. The time now is 03:27 PM.