Can i Change My LAN Card Mac Address in Linux Redhat 9.0

Discussion of programming on Linux, including shell scripting, perl, python, c/c++, mono, java. Whatever tickles your fancy.
Posts: 6
Joined: Fri Feb 18, 2005 7:27 pm
Location: peshawar

Can i Change My LAN Card Mac Address in Linux Redhat 9.0

Postby malikgr8 » Wed Feb 08, 2006 12:59 am

sallam i am using linux in Compaq network card is 3com ......

i wanna change my mac address bec i have internet service by cable in windows system when i put that cable to linux it works for atleast 5 minutes then down .. cable opperator told me that i dont know about this our software takes ip username password and mac address and he dont know how to adjust this mac to my ip to work properly.........................

so please tell me how could i change my linux Mac address as same with my windows mac address to work properly bec i wanna use one system at time and i can not change the network card every time in linux..........
i wanna be a linux administrator

Major General
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Location: Lahore

Postby kbukhari » Wed Feb 08, 2006 11:35 am

yes u can
if u r using redhat than goto
vi /etc/sysconfig/network-scripts/ifcfg-eth0

there u can cheange mac address ok device
Syed Kashif Ali Bukhari

Posts: 355
Joined: Sat May 07, 2005 11:54 am
Location: Lahore

Postby ranatanveer » Wed Feb 08, 2006 1:37 pm

Dear Malik

try to do as Kashif Bukharee wrote

down written is copy pased from

To make sure problems like this are not experienced, the IEEE group split the MAC address in half, and used the first half to identify the vendor, and the second half is for the vendor to allocate as serial numbers:

The Vendor code is specified by RFC - 1700. You might find a particular vendor having more than just one code; this is because of the wide range of products they might have. They just apply for more, as they need !

like 00-00-00-00-00-00-00

00-00-00 00-00-00

Keep in mind that even tho the MAC address is "burnt-in" to the network card's memory, some vendors will allow you to download special programs to change the second half of the MAC address on the card. This is because the vendors actually reuse the same MAC addresses for their network cards because they create so many that they run out of numbers ! But at the same time, the chances of you buying two network cards which have the same MAC address are so small that it's almost impossible !

Rana Tanveer
Linux Student

For Affordable Web Development

Posts: 65
Joined: Sat May 31, 2003 11:34 pm
Location: karachi

changing mac address

Postby dajazzguy » Wed Feb 08, 2006 3:07 pm

Its a simple trick use the command at startup script or anytime

ifconfig interface(eth0 or eth1) hw ether macaddress(00:37:58:3f:e2:37)

the command description is
ifconfig interface hw ether macaddress

where interface is the name of the interface u want to modify mac address eg eth0 or eth1 in ur case.
macaddress is the macaddress u want to give to the lan card. in the 00:00.. format.

before changing mac you may also need to execute commands
ifconfig eth0 down
then change mac and then
ifconfig eth0 up

add these commands to the startup script.
eg rc.local
Farhan Diwan
RHCE, Certified MySQL DBA

Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest