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

FAQ
It is currently Wed Aug 23, 2017 8:56 am


Internet Protocol, Transport Control Protocol, Network protocols, Routing, Routers, IP aliases, Routes, Ethernet

Author Message
debuser
Post  Post subject: Linux How to change hardware MAC address of an interface  |  Posted: Sat Dec 03, 2011 9:18 pm

Joined: Thu Aug 06, 2009 2:48 am
Posts: 105

Offline
 

Linux How to change hardware MAC address of an interface

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





Top
Zettie49
Post  Post subject: Re: Linux How to change hardware MAC address of an interface  |  Posted: Tue Dec 06, 2011 6:26 am

Joined: Tue Dec 06, 2011 6:11 am
Posts: 3

Offline
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


Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Linux How to change hardware MAC address of an interface"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. KVM: List MAC address table and interface that learned them.

mandrei99

0

1263

Sun Feb 01, 2015 6:26 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux script for interface network bandwidth monitoring

admin

0

1245

Mon Feb 09, 2015 7:05 pm

admin View the latest post

There are no new unread posts for this topic. Linux list the outgoing interface for packets to a specific IP destination

mandrei99

0

931

Mon Jul 22, 2013 10:17 am

mandrei99 View the latest post

There are no new unread posts for this topic. "OSPF not enabled on this interface" FreeBSD Quagga ospfd interface status

debuser

1

2450

Thu Apr 01, 2010 5:55 am

debuser View the latest post

There are no new unread posts for this topic. FreeBSD find pid that opened TCP/UDP socket without lsof using address of protocol control block(PCB

mandrei99

0

1161

Wed Dec 11, 2013 4:56 am

mandrei99 View the latest post

There are no new unread posts for this topic. How Does OSPF Neighbor State Change

vl1111

1

665

Fri Jun 17, 2011 3:31 am

denyalmartin View the latest post

There are no new unread posts for this topic. TCP receive window size doesnt change

michael

0

252

Wed May 25, 2016 3:36 pm

michael View the latest post

There are no new unread posts for this topic. FreeBSD show network interface statistics

mandrei99

0

2161

Wed Sep 25, 2013 9:30 am

mandrei99 View the latest post

There are no new unread posts for this topic. FreeBSD list interface multicast group membership

mandrei99

0

1573

Tue Dec 03, 2013 9:02 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to accept IPv6 Router Advertisements on interface in FreeBSD

mandrei99

0

1092

Wed Apr 29, 2015 3:54 am

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News 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