LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Closed Thread
  Search this Thread
Old 10-29-2007, 09:37 AM   #1
Unregistered
Member
 
Registered: Apr 2007
Posts: 63

Rep: Reputation: 15
changing mac address on every bootup


how do I change the mac address on bootup but still be able to connect to a network (without mac filtering enabled)? The network I'm testing uses dhcp and usually an ip address is associated with my wireless interface. Should I edit the rc.local file? If so, how would I go about it? If it means anything, I'm using a laptop so usually I would first have to activate a wifi button to switch on the radio.
 
Old 10-29-2007, 09:41 AM   #2
reikyv
Member
 
Registered: Oct 2007
Location: Malaysia
Distribution: Slackware
Posts: 80

Rep: Reputation: 15
I think you can't change the MAC address... unless you plan to use another networking device. The MAC is hardcoded into the device and each device has a unique MAC address... or I misunderstood your question?
 
Old 10-29-2007, 10:01 AM   #3
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
You would probably want to do that before the network is configured. I'm not at my slackware computer right now, but I believe the dhcpcd is runned from /etc/rc.d/rc.M. There is a program called macchanger that can change mac address, but I don't know how to make a mac generator with a bashscript, so further then this I can't help you.
 
Old 10-29-2007, 02:39 PM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
In /etc/rc.d/rc.inet1.conf add a "HWADDR" parameter to your card's configuration settings. Look further down in that file:
Code:
HWADDR[?]="00:01:23:45:67:89"  # Overrule the card's hardware MAC address
Change the '?' to the correct index number and substitute the MAC address you want the card to have. On every boot your card will now get the custom MAC address.

For most cards this will work. I just tested it as an example on my madwifi-driven wireless card.

Eric
 
Old 10-31-2007, 02:48 AM   #5
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Quote:
Originally Posted by reikyv View Post
I think you can't change the MAC address... unless you plan to use another networking device. The MAC is hardcoded into the device and each device has a unique MAC address... or I misunderstood your question?
You can, there's just no legitimate reason for doing this.
 
Old 10-31-2007, 04:17 AM   #6
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
You can, there's just no legitimate reason for doing this.
I'd say "you can, but there's usually no reason for doing this." MAC addresses aren't unique (as in "every single device that exists has a unique MAC address"), they just need to be unique within the (sub)network they're connected to (because two devices can't, as far as I understand, have identical MAC addresses within the same network where they can "see" each other). So it's possible, though very unprobable, that you happen to bump into a network where "your" MAC address is already in use and needs to be changed. I'd say it's so rare you'll never have to do that..

But really, changing MAC address every boot sounds a little peculiar. Why are you doing it? If you're being paranoid or thinking that your machine can't be "detected" if you change your IP and MAC address every boot, you're probably wrong; there are other means for that, and it's general knowledge (or should be) that it's not possible, in a secure/"bullet-proof" way, to know a certain machine based on it's IP and/or MAC (so when a machine is tracked, nobody who's got brains tries to do that based on IP/MAC address only, other means would be used). So for example if you were downloading illegal content off the web or p2p networks or torrents or something, changing IP and MAC addresses, your machine's name and such wouldn't prevent you from getting caught.

Last edited by b0uncer; 10-31-2007 at 04:18 AM.
 
Old 10-31-2007, 04:50 AM   #7
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by evilDagmar View Post
You can, there's just no legitimate reason for doing this.
I can think of at least one legitimate reason (and a lot of home broadband routers offer it as a feature): it is called "MAC address cloning".
If your ISP ties your IP address and provisioning information for the broadband connection to the MAC address of your home computer, it is regarded as a good idea to keep using the same MAC address for the network component that is facing the ISP. That way you can swap hardware inside your home network without the need to go back to your ISP's provisioning web page and change the MAC address of the computer that is currently attached to the ISP's modem. With some ISP's, changing the registered MAC address can be a pain, and in the meantime you do not have Internet access.

Like it was said earlier, when network hardware is branded with a MAC address by the card manufacturer, it is guaranteed to be unique. But for your own small network, there is no problem at all when you modify a card's MAC address as long as all computers that talk to each other have unique MAC addresses.
I play safe on my physical LAN and re-use MAC addresses from cards that I scrapped before (so that these addresses are guaranteed not to appear again), but for my virtual machines, I use random MAC addresses all the time.

Eric
 
Old 10-31-2007, 04:54 AM   #8
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Except this is a wireless network segment he's talking about. I've yet to see any wireless equipment do a MAC lock like the typical cablemodem.

It's rather more likely he's just pilfering wireless access from someone's unsecured AP and is attempting to make it look like he's not the same person doing it day after day (or is attempting to be sure his real MAC address never shows up in any logs).
 
Old 10-31-2007, 05:00 AM   #9
reikyv
Member
 
Registered: Oct 2007
Location: Malaysia
Distribution: Slackware
Posts: 80

Rep: Reputation: 15
Quote:
Originally Posted by evilDagmar View Post
You can, there's just no legitimate reason for doing this.
Hi, yup I know somehow we can fake the MAC address. :-)
 
Old 10-31-2007, 05:09 AM   #10
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Quote:
Originally Posted by reikyv View Post
Hi, yup I know somehow we can fake the MAC address. :-)
Well, congratulations on being able to read a man page, I guess.
 
Old 10-31-2007, 05:09 AM   #11
reikyv
Member
 
Registered: Oct 2007
Location: Malaysia
Distribution: Slackware
Posts: 80

Rep: Reputation: 15
Quote:
Originally Posted by evilDagmar View Post
Except this is a wireless network segment he's talking about. I've yet to see any wireless equipment do a MAC lock like the typical cablemodem.

It's rather more likely he's just pilfering wireless access from someone's unsecured AP and is attempting to make it look like he's not the same person doing it day after day (or is attempting to be sure his real MAC address never shows up in any logs).
I will agree with this. So far, this is one of the reason I know why we need to manipulate our network device's MAC - to 'hide' in someone else wireless network, or to pretend to be someone else. So a normal MAC filtering in the AP won't block that user from stealing the wireless network. For the ISP case, this is the first time I heard that some ISP will use your MAC to allocate the IP address, at least this doesn't happened in my country. :-p

Last edited by reikyv; 10-31-2007 at 05:11 AM.
 
Old 10-31-2007, 05:11 AM   #12
reikyv
Member
 
Registered: Oct 2007
Location: Malaysia
Distribution: Slackware
Posts: 80

Rep: Reputation: 15
Quote:
Originally Posted by evilDagmar View Post
Well, congratulations on being able to read a man page, I guess.
Nope, haven't have time to dig in the man page. Just recall something that I've forgotten :-p
 
Old 10-31-2007, 05:31 AM   #13
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
Quote:
Originally Posted by reikyv View Post
I will agree with this. So far, this is one of the reason I know why we need to manipulate our network device's MAC - to 'hide' in someone else wireless network, or to pretend to be someone else. So a normal MAC filtering in the AP won't block that user from stealing the wireless network. For the ISP case, this is the first time I heard that some ISP will use your MAC to allocate the IP address, at least this doesn't happened in my country. :-p
Most cablemodems (mainly to keep people from just connecting their home switch to it and screwing everything up) will bind to the first MAC address (to request an IP) they see when they power up. This isn't anything like a security measure--it's meant to reduce confusion on the user's part and to reduce the number of support calls. Once the cablemodem has bound to that MAC, it won't accept packets from any other device (so someone's printer can't grab the one lease your the cablemodem ISP provides) unless you perform a hard reset. Linksys and some other manuf's go the extra mile and their setup programs will clone the MAC address of the device when you're doing the setup tasks so that the cablemodem still thinks it's talking to the old device when you put the router/AP online. They do this because it's a lot simpler than trying to explain to someone how to hard-reset their cablemodem, and a hard-reset of a cablemodem tends to mean you're offline for several minutes or more while the cablemodem resynchs, gets a new TFTP image, etc etc.
 
Old 10-31-2007, 04:18 PM   #14
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
How can it be illegitimate? I hate when people talk like this. It's illegitimate to change MAC, it's illegitimate to reverse BIOS, it's illegitimate to decrypt DVDs, it's illegitimate to reflash with RPC-1 firmware, it's illegitimate to make backup CDs, it's illegitimate to craft your own TCP/IP packets, it's illegitimate to use P2P, it's illegitimate to use "analog hole". What else? Soon it will be illegitimate to use your pc without MPAA, RIAA and Microsoft tracking your daily work.

You can do whatever you want with your own hardware. If providers rely on MAC address to limit pcs connectivity, that's their own problem.

Last edited by Alien_Hominid; 10-31-2007 at 04:21 PM.
 
Old 10-31-2007, 11:14 PM   #15
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
amen, Alien_Hominid!
 
  


Closed Thread

Tags
trolling



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
Changing Mac Address on Network Card? neopiper Linux - Networking 10 11-21-2007 02:14 AM
Changing your MAC address kamransoomro84 Linux - General 3 04-22-2006 06:42 AM
DNS Problems After Changing a MAC Address barns Linux - Networking 1 10-26-2005 08:32 PM
Changing my Mac address griggt Linux - Networking 3 07-26-2005 05:34 AM
changing nic mac address bishal Linux - Hardware 4 07-16-2004 04:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:17 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration