LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-02-2012, 05:18 AM   #1
kumawat10
LQ Newbie
 
Registered: Aug 2011
Posts: 28

Rep: Reputation: Disabled
Question Setting MAC Address using ip utility


Hello everyone, need some help.. I want to set a MAC Address to my device using the ip utility.. Is there any option available for it?? I use ip addr to set the IP, and ip route to set the gateway but not able to find anything for MAC Address setting.. Pls help

Thanks,
Pratik
 
Old 02-02-2012, 05:49 AM   #2
cbtshare
Member
 
Registered: Jul 2009
Posts: 569

Rep: Reputation: 42
Only way I know to change mac is, I use the command:

Quote:
ifconfig eth0 hw ether new mac address
 
Old 02-02-2012, 05:50 AM   #3
elvinhaak
LQ Newbie
 
Registered: Jan 2012
Posts: 14

Rep: Reputation: Disabled
Hi,
For as far as I know, the MAC-address on a network-card cannot normally be changed, only on some routers and modems there are some ways to change it.
Maybe there are some EEPROM-rewrites possible but therefore you need special software for the network-card you have.
Ok, I'm also pretty new here so there might be a way - actually, why would you like to change the MAC-address?
 
Old 02-02-2012, 06:14 AM   #4
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,246

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
Code:
ip link set dev eth0 address YOUR_MAC_HERE
@elvinhaak
MAC can be freely changed, rather you mean that it can not be usualy stored on EEPROM, but for normal usage this is not needed. The reasons for changing MAC are few, for example: your Interbet provider may give you access to net depending on MAC and you changed motherboard with onboard net card or your card has been broken.

Last edited by eSelix; 02-02-2012 at 06:17 AM.
 
Old 02-02-2012, 04:44 PM   #5
jefro
Guru
 
Registered: Mar 2008
Posts: 12,095

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
Not all nic's and drivers for nic's support mac changes.

See this.

I read that the mac address can also be changed using just the ip command from the cml. It would be issued link ip link show eth0 to display the mac address.

Then shutting it down with ip link set dev eth0 down.
Changing the mac ip link set dev eth0 address XX:XX:XX:XX:XX:XX
Restarting it ip link set dev eth0 up


From here. http://techie-buzz.com/foss/change-m...ess-linux.html
 
Old 02-03-2012, 10:55 PM   #6
kumawat10
LQ Newbie
 
Registered: Aug 2011
Posts: 28

Original Poster
Rep: Reputation: Disabled
Thanks everyone for yr help..
 
Old 02-04-2012, 12:15 AM   #7
kumawat10
LQ Newbie
 
Registered: Aug 2011
Posts: 28

Original Poster
Rep: Reputation: Disabled
Just a few more clarifications needed from u all.. I want the substitute rules using ip for setting the default gateway for my interface.. I used ip route to set the gateway value but couldnt set the default gateway still.. pls help
 
Old 02-04-2012, 12:20 AM   #8
kumawat10
LQ Newbie
 
Registered: Aug 2011
Posts: 28

Original Poster
Rep: Reputation: Disabled
Got it..
Its like this
ip route add default via <GW IP>
 
  


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 do I find what MAC address web pages see as my MAC address rob.rice General 20 05-29-2010 03:08 AM
[SOLVED] Setting MAC address on "Intel Corporation PRO/Wireless 2200BG" evo2 Linux - Hardware 2 12-19-2009 02:08 AM
Setting mac-address restrictions in dhcpd custangro Linux - Server 4 08-19-2008 07:33 PM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 05:33 AM


All times are GMT -5. The time now is 06:17 PM.

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