LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 10-18-2006, 11:51 PM   #1
Basel
Member
 
Registered: Feb 2004
Location: United States
Distribution: Ubuntu 10.10
Posts: 319

Rep: Reputation: 30
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:
Code:
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.
 
Old 10-19-2006, 02:23 AM   #2
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
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!
 
Old 10-19-2006, 08:05 AM   #3
Basel
Member
 
Registered: Feb 2004
Location: United States
Distribution: Ubuntu 10.10
Posts: 319

Original Poster
Rep: Reputation: 30
boot.local says:
Code:
# 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?
 
Old 10-19-2006, 09:30 AM   #4
ok4life
LQ Newbie
 
Registered: Oct 2006
Posts: 24

Rep: Reputation: 15
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)
 
Old 10-19-2006, 10:20 AM   #5
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
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.
 
Old 10-19-2006, 11:01 AM   #6
andrewdodsworth
Member
 
Registered: Oct 2003
Location: United Kingdom
Distribution: SuSE 10.0 - 11.4
Posts: 347

Rep: Reputation: 30
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.
 
Old 10-20-2006, 12:23 AM   #7
Basel
Member
 
Registered: Feb 2004
Location: United States
Distribution: Ubuntu 10.10
Posts: 319

Original Poster
Rep: Reputation: 30
Thank you everyone it worked
 
  


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
how to change MAC address cain_eve Linux - Software 11 02-05-2009 01:52 PM
How to change MAC address automatically on boot rollo Debian 4 10-16-2006 05:22 PM
OpenBSD: Adding a "lladdr" command to netstart to change MAC address at boot Voltar *BSD 2 04-14-2006 12:41 AM
change mac address possible? kahn Linux - Networking 4 04-22-2005 04:43 AM
MAC address change? w9q Linux - Networking 3 09-10-2004 02:42 AM


All times are GMT -5. The time now is 08:52 AM.

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