LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 01-03-2010, 12:56 PM   #1
vastvet
LQ Newbie
 
Registered: Jan 2010
Posts: 20

Rep: Reputation: 0
how to permanent spoof "fake" mac address for eth0 & eth1? in NEW linux distro"s...


Hello, i tried several linux distros now like the new 2010 ubuntu ,debian,fedora,STUX 2 and mandriva but none of them let me change the mac address permanently ,have to login as root etc and go to path of the interface i did and set like hwaddress ether eth* 00:00:00:00:0B:E0
I tried some programs also, but when i set it manually in interface file and do an reboot than i cant connect to my router and internet.
Can u explain it to me for the following linux distros, ubuntu,debian,fedora,STUX 2 and mandriva, i like these distro because they have alot of packages to choose from and i want to try them all so i need to know for each one how to permanently change "spoof" the mac address for each interface ecept the loopback.
I use cable internet from upc the netherlands is dchp. also local is dchp.
Thanks in advanced ,and all the best wishes for 2010!

p.s. the mac spoofing networktool in ubuntu is buggy, when change the mac address it makes an new the same nic config ,when do this gain with new name it make the same name and when do again the tool crashes, and than my mind crashes to :P ...

Last edited by vastvet; 01-03-2010 at 01:11 PM. Reason: forgot something
 
Old 01-03-2010, 01:31 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
On almost any Linux distribution, you can edit /etc/sysconfig/network-scripts/ifcfg-eth0 (replace 'eth0' with your interface) and add:

Code:
HWADDR=31:32:33:34:35:36
Set your desired MAC address in place of '31:32:33:34:35:36' obviously.
 
1 members found this post helpful.
Old 01-03-2010, 01:33 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
The lazy man's answer:

Put the commands you need to change your MAC address into the file /etc/rc.local on the line before the final exit 0

This file is run at every boot, as root, (so you need to be root to edit it) and you do not need to precede any commands with stuff like sudo

After those line(s) (but still before the final exit 0 )you might have to give the (distro-specific) command to restart networking, for Debian-based distros it's /etc/init.d/networking restart

For Fedora / Mandriva, it may be different, but similar.

The sane man's question: Why do you need to spoof your MAC address? Can't you just tell your ISP your MAC address has changed? Or get a modem/router?
 
1 members found this post helpful.
Old 01-03-2010, 01:42 PM   #4
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
The problem is that /etc/init.d/networking, /etc/network/interface, ifconfig are deprecated by Network Manager and /etc/sysconfig/ exist only in RedHat/Fedora.

That's the problem with modern distro when it come to "advanced" networking. The best way to revert to the old system is to create /etc/network, /etc/network/interfaces, /etc/init.d/networking and remove network manager. It's bad for laptop, but fine for desktop. After that, the old way of doing it will start working again.
 
1 members found this post helpful.
Old 01-03-2010, 01:48 PM   #5
vastvet
LQ Newbie
 
Registered: Jan 2010
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks for the reply!stay replying :))i want to know everything :)

Quote:
Originally Posted by tredegar View Post
The lazy man's answer:

Put the commands you need to change your MAC address into the file /etc/rc.local on the line before the final exit 0

This file is run at every boot, as root, (so you need to be root to edit it) and you do not need to precede any commands with stuff like sudo

After those line(s) (but still before the final exit 0 )you might have to give the (distro-specific) command to restart networking, for Debian-based distros it's /etc/init.d/networking restart

For Fedora / Mandriva, it may be different, but similar.

The sane man's question: Why do you need to spoof your MAC address? Can't you just tell your ISP your MAC address has changed? Or get a modem/router?
Hi thanks for reply so far, more is welcome!i wanna know everything!About the isp ,well first of all ur client mac is always send to router,server and ispand to other pc"s wich is an security threat, the second thing is i dont want to buy an network card everytime the isp throws it out, and calling the provider is very expensive here,so those are the head reasons.

The point with spoofing mac address is that when in does nt really matter wich new distro, if u go to the file by gui and try to change it u dont have the root priveleges, u cant save the new manual mac address, so u have to open an shell/command prompt to do it, soem distro have shellroot and soem dont than u have to do SU than give root password, than do gedit /etc/network/interfaces of whatever i have to do..i still nbeed to test because sometimes when spoof and try to browse the internet is not their.
 
Old 01-03-2010, 01:54 PM   #6
vastvet
LQ Newbie
 
Registered: Jan 2010
Posts: 20

Original Poster
Rep: Reputation: 0
Thank u also for the reply

Quote:
Originally Posted by macemoneta View Post
On almost any Linux distribution, you can edit /etc/sysconfig/network-scripts/ifcfg-eth0 (replace 'eth0' with your interface) and add:

Code:
HWADDR=31:32:33:34:35:36
Set your desired MAC address in place of '31:32:33:34:35:36' obviously.
I see, can u give this info in some more easyer steps.

Last edited by vastvet; 01-03-2010 at 02:26 PM.
 
Old 01-03-2010, 02:04 PM   #7
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
As Elv13 pointed out, if you're using NetworkManager that method won't work. So give us a little more information. What distribution are you trying to set this on? Are you using NetworkManager? If so, it might be easier to use the method in tredegar's post.
 
1 members found this post helpful.
Old 01-03-2010, 02:16 PM   #8
vastvet
LQ Newbie
 
Registered: Jan 2010
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Elv13 View Post
The problem is that /etc/init.d/networking, /etc/network/interface, ifconfig are deprecated by Network Manager and /etc/sysconfig/ exist only in RedHat/Fedora.

That's the problem with modern distro when it come to "advanced" networking. The best way to revert to the old system is to create /etc/network, /etc/network/interfaces, /etc/init.d/networking and remove network manager. It's bad for laptop, but fine for desktop. After that, the old way of doing it will start working again.
can network manager be removed by the packagemanager? if /etc/network, /etc/network/interfaces, /etc/init.d/networking are allready their?like in most distro do i have to make it again?if yes how do i make these patch/maps/file like u said?
 
Old 01-03-2010, 02:22 PM   #9
vastvet
LQ Newbie
 
Registered: Jan 2010
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by macemoneta View Post
As Elv13 pointed out, if you're using NetworkManager that method won't work. So give us a little more information. What distribution are you trying to set this on? Are you using NetworkManager? If so, it might be easier to use the method in tredegar's post.
I tried suse and mandriva, those wont reboot on my dell inspiron laptop, i tried debian that worked installing,now am trying fedora,some downloaded iso dont match in md5/sha checksum so that maby explains why, however debian worked ok but i think fedora wil lwork also,and i tried ubuntu and stux also, i prefer an GNU/Linux to instal because its freeware and has most packages ,the goal is to use winehq to play mp games etc and do everything i did on my windows like msn ,mail etc. thats the goal,who can give advise to what to instal now?wich distro?and should it be gnome ,kde or?i als oprefer new and fast kernels as optional.
I may shorten or remove unnessary questions of myown lateron to make the topic better viewable for newbies like me.
Ive read something about gnome is better with doing stuff like su and spoof mac addr.
For now its an desktop /laptop distro wich i want to set up

Last edited by vastvet; 01-03-2010 at 02:40 PM.
 
Old 01-03-2010, 04:29 PM   #10
vastvet
LQ Newbie
 
Registered: Jan 2010
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by macemoneta View Post
On almost any Linux distribution, you can edit /etc/sysconfig/network-scripts/ifcfg-eth0 (replace 'eth0' with your interface) and add:

Code:
HWADDR=31:32:33:34:35:36
Set your desired MAC address in place of '31:32:33:34:35:36' obviously.
I use to test the new debian 2010 desktop, i tried what u said but it didnot totally work because some commands where missing,maby this easyly works on other distros but not on debian at least not when i try it, so i have to further test this on another distro before i can say if work,if work i will set the distro at it that worked with it,its probertly just forgotten commands or maby the wrong distro.
 
Old 01-03-2010, 11:38 PM   #11
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
The distribution doesn't matter that much, all of them use Network Manager by now, and you will have to remove it if you want to hack deeper in your card and have more control than the, perfect for most users, NetworkManager offering.
 
1 members found this post helpful.
Old 01-04-2010, 12:19 AM   #12
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,591

Rep: Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244Reputation: 1244
If you are using a standard Debian network setup you just need to add a line to your /etc/network/interfaces file. Eg
Code:
iface eth0 inet dhcp
   hwaddress ether 00:11:22:33:44:55
BTW, what is "new debian 2010 desktop"?

Cheers,

Evo2.
 
2 members found this post helpful.
Old 01-04-2010, 03:13 AM   #13
Brains
Member
 
Registered: Apr 2009
Distribution: Debian testing
Posts: 258

Rep: Reputation: 42
I like to spoof my mac addresses, for reasons I don't need to explain.
I install macchanger from repositories and put commands in /etc/rc.local file as such:
Code:
macchanger -r eth0
macchanger -r eth1
These commands will produce a different random mac address upon every bootup for both my Ethernet and Wireless device, you can also configure it to use a specific address as such:
Code:
macchanger -m 00:00:00:00:00:00 eth0
macchanger -m 00:00:00:00:00:00 eth1
The above will spoof the mac address of both to "00:00:00:00:00:00" upon every bootup when placed in /etc/rc.local file.

Last edited by Brains; 01-04-2010 at 03:16 AM.
 
1 members found this post helpful.
Old 01-04-2010, 02:36 PM   #14
vastvet
LQ Newbie
 
Registered: Jan 2010
Posts: 20

Original Poster
Rep: Reputation: 0
This network manager is getting on my nurfs, when i go to services and put it of and stop service than i dont get internet at all, so how do i deletethe network manager without loosing connection forever, by teh way at that hours i was using debian the latest one, i guess i call it desktop because it isnt an server distro at that point, also my question is when i put the new macs, wich commands universal commands can i use on all distro to get the nics eth0/1 back online again? i remember sawing the macchange and in network manager sti lthe old mac andn ot getting online, now i am installing stux 2.0 cd and going to try these commands out, on debian and fedora both latest ones no luck changing the mac address maby all because of the networkmanager i dunno for sure yet... to be continued see this link to see what i meen by eeprom mac change http://www.sdadapters.com/change-mac-address-faq.htm

My reason of mac changing is because my isp locks mac addresses, so when i buy news nics the gigabytes ones they are pritty expensive to buy new each time, i also read that there is cards solled with EEPROM program that runs from dos and can change hardware in the nic itself, i was wondering if i can use and do this in all nics i got? without buying this special card? to change the mac hardware matically [is different from spoofing in linux "oftopic"] :P

Last edited by vastvet; 01-04-2010 at 02:45 PM.
 
Old 01-04-2010, 03:44 PM   #15
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
You have to create /etc/network/ and /etc/network/interfaces, fill them as specified above, REMOVE network manager (apt-get purge networkmanager) and them restart the network
sudo /etc/init.d/networking restart

It -might- work if everything is configured correctly, unfortunately, it can also fail if your configuration is not right.
 
1 members found this post helpful.
  


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
"...Device eth0 has different MAC address than expected,.." lothario Linux - Networking 11 08-05-2014 11:24 PM
Occasionally-- "connected with self-assigned address," "deactivating device eth0" MaxIBoy Debian 4 10-04-2009 11:50 AM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 08:11 PM
"Installing non-distro Linux on USB key" or "Using syslinux to boot a jffs2" lymae Linux - Newbie 6 12-31-2006 11:00 PM


All times are GMT -5. The time now is 01:54 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration