Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have changed my MAC address in my Linux machine using ifconfig. Now the problem is I have not saved my original MAC address. I want to restore it without rebooting.

Is there a way to do it?

share|improve this question
    
Any reason no to reboot? –  new123456 Jun 16 '11 at 15:12
    
Running half a dozen applications. Dont want to close them. –  narayanpatra Jun 16 '11 at 15:14
1  
Run this?: sudo ifdown interface && sudo ifup interface Or maybe: sudo /etc/init.d/networking restart –  evan.bovie Jun 16 '11 at 15:25
    
@emb : did not work. –  narayanpatra Jun 16 '11 at 15:30
add comment

3 Answers 3

Assuming eth1:

grep "eth1" /var/log/*log | egrep "([0-9a-fA-F]{2}:){5}"

could find something in the logs {daemon,kern,syslog}.log on my system.

share|improve this answer
add comment

[rooted] assuming wlan0

...(to find driver)
airmon-ng | awk '/wlan0/ {print $4}' ...or

airmon-ng | awk '/wlan0/ {print $3}' ...or just

airmon-ng ..and look under 'driver'

...(to restart driver)
ifconfig wlan0 down

modprobe -r rt2800usb <=Replace (rt2800usb) with your driver

modprobe rt2800usb <=Replace (rt2800usb) with your driver

ifconfig wlan0 up

This is how I do it. I made a script for this and use it with a couple of my programs. If that's the route you take, put a 'time.sleep(3)' {or whatever sleep command} before bringing the interface back up.

share|improve this answer
add comment

Maybe try removing then installing the module again?

sudo rmmod <NICmodule>
sudo insmod <NICmodule> 

Or maybe dropping the interface and bringing it back up?

sudo ifdown <interface> && sudo ifup <interface>
share|improve this answer
    
can you elaborate the first method. The second one did not work. –  narayanpatra Jun 16 '11 at 15:31
    
The <NICmodule> would be what ever kernel module the NIC is using. e.g. e1000 You can see what you have with this guide. –  evan.bovie Jun 16 '11 at 15:36
    
Do you know what module your network card uses? This will just remove the module and then put it back (hopefully with the right MAC) –  sealz Jun 16 '11 at 15:38
    
@narayanpatra Did you replace interface with what you use to access the internet? In most cases it's eth0 –  paradd0x Jun 16 '11 at 15:39
    
@thiago : Ya, i did that. –  narayanpatra Jun 16 '11 at 15:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.