ifconfig
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
No comments:
Post a Comment