Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Wed Oct 04, 2023 10:07 pm


Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
Font size:
 
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Disable BBCode
Disable smilies
Do not automatically parse URLs
Confirmation code
Confirmation code:
In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.
     

Topic review - Linux How to change hardware MAC address of an interface
Author Message
Post subject: Re: Linux How to change hardware MAC address of an interface  |  Post Posted: Tue Dec 06, 2011 6:26 am
I am wondering how to change the MAC address of my ethernet adaptor(eth0) under Linux. Since the LAN's IP address need register in my college, and I want to use my laptop in Lab. I think the way to do it is to change my MAC to the Lab computer's.


Waiting for your help
Post subject: Linux How to change hardware MAC address of an interface  |  Post Posted: Sat Dec 03, 2011 9:18 pm
The mac address is also referred to as physical address and it is used in Ethernet network via ARP and DHCP to map a layer 3 IPv4 address.

Change interface mac address in Linux


To change the mac address of an interface in Linux, the interface needs to be brought down first, otherwise a "device or resource busy" error will occur. This can be done if logged in via ssh to an interface not serving the ssh traffic (otherwise reachability will be lost) or if connected through a console port.

Code:
root@server:~# ip a l eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:16:3e:3a:0a:1a brd ff:ff:ff:ff:ff:ff
    inet6 fe80::216:3eff:fe3a:a1a/64 scope link
       valid_lft forever preferred_lft forever

root@server:~# ifconfig eth0 hw ether '00:16:3e:3a:0a:1b'
SIOCSIFHWADDR: Device or resource busy - you may need to down the interface
root@server:~# ifconfig eth0 down
root@server:~# ifconfig eth0 hw ether '00:16:3e:3a:0a:1b'
root@server:~# ifconfig eth0 up
root@server:~# ip a l eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:16:3e:3a:0a:1b brd ff:ff:ff:ff:ff:ff
    inet6 fe80::216:3eff:fe3a:a1b/64 scope link
       valid_lft forever preferred_lft forever
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO