Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Thursday, February 19, 2009

Changing MAC address in Linux

Changing MAC addresses of network adapters on machines have become a mundane thing these days. For those using debian and ubuntu there are multiple ways to achieve the same.

ifconfig hw

Example:

# /etc/init.d/networking stop
# ifconfig eth0 hw ether 00:00:00:A9:0A:3C
# /etc/init.d/networking start

The MAC address set via this way would be temporary and lost next time you reboot. The more better and persistent solution is to add the following line with interface settings in /etc/network/interfaces.

hwaddress

Example:

iface eth0 inet static
address x.x.x.x
netmask 255.x.x.x
gateway x.x.x.x
hwaddress ether 00:00:00:A9:0A:3C

Don't forget to restart network using /etc/init.d/networking restart, or rebooting machine after this. There is another command-line tool available these days named macchanger, a GNU/Linux utility for viewing/manipulating the MAC address of network interfaces, which can also be used apart from the above mentioned two methods.

# /etc/init.d/networking stop
# macchanger -m 00:00:00:A9:0A:3C eth0
# /etc/init.d/networking start

Sunday, February 17, 2008

MAC address keeps chaging after every boot

Hello Everyone,

I recently installed Ubuntu 7.10 Gusty Gibbon and found that the MAC address of my network card keep on changing and the “eth” keeps on incrementing by one (ex: eth1, eth2, eth20)
I really dont know why this happens but I mange to fix that by deleting 2 files,Please be advise that I am not resposible how this might work for you.
Also please make a back up befo\zre you deleted them

cd /etc/udev/rules.d/
mkdir ~/backup
cp 70-persistent-net.rules ~/backup
cp 75-persistent-net-generator.rules ~/backup
sudo rm -rf 70-persistent-net.rules
sudo rm -rf 75-persistent-net-generator.rules

Reboot and that should fix the problem


those are just some of the problem I mange to solve,just have one more to go.
My system hangs every now and then

Notice:
This works only ubuntu 7.10 32 bits and 64 bits,Dont know about the rest but feel free to tell us if it works on anyother.