1752786 Members
5892 Online
108789 Solutions
New Discussion юеВ

Changing MAC address

 
SOLVED
Go to solution
Arunvijai_4
Honored Contributor

Changing MAC address

Hi All,

I need to change a Ethernet card's MAC address to 00:00:00:00 and test few things. What is the best way to do? I will have to revert it back after testing.
"A ship in the harbor is safe, but that is not what ships are built for"
15 REPLIES 15
Pete Randall
Outstanding Contributor

Re: Changing MAC address

The -A option of the lanadmin command will change MAC address on a temporary basis. Permanent changes would have to be made to the appropriate /etc/rc.config.d/hp*conf file, but it sounds like you just need temporary.


Pete

Pete
Arunvijai_4
Honored Contributor

Re: Changing MAC address

Thanks Pete. Can you please tell the exact syntax? This is my output of lanscan,

# lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
0/0/0/0 0x001083F515F1 0 UP lan0 snap0 1 ETHER Yes 119
0/5/0/0 0x001083F6CD7E 1 UP lan1 snap1 2 ETHER Yes 119
0/12/0/0 0x00306E0672D1 2 UP lan2 snap2 3 ETHER Yes 119


I want to change for lan1 or lan2. How do i do that?
"A ship in the harbor is safe, but that is not what ships are built for"
Jestin John Chacko
Regular Advisor

Re: Changing MAC address

Dear

I think we can change the station address using sam.
Hakki Aydin Ucar
Honored Contributor

Re: Changing MAC address

you can change the MAC address in SAM by selecting Networking and Communications, then selecting the interface, then Action, Modify, Advanced Options. HP-UX refers to the MAC address as the "station address".
Pete Randall
Outstanding Contributor
Solution

Re: Changing MAC address

For lan1:

lanadmin -A 0x00000000 1

where "1" is the PPA number from lanscan. Also, note this warning from the man page:

"Set the new station address of the interface corresponding to PPA. The station_addr must be entered in hex format with a '0x' prefix. You must have superuser privileges. When station_addr is DEFAULT, the factory default physical address will be restored. WARNING: To ensure the interface and the system work correctly, the interface MUST be brought down before setting the new station address. After the new station address is set, the interface should be brought up in order to be functional. See ifconfig(1M) for bringing down and bringing up the interface."


Pete

Pete
Arunvijai_4
Honored Contributor

Re: Changing MAC address

Excellent! Thanks folks.
"A ship in the harbor is safe, but that is not what ships are built for"
santosh_12_1
Occasional Contributor

Re: Changing MAC address

HI Arun,
We both are trying to zero-in on the same issue.
You may find assitional info here:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1364524&admit=109447626+1250620267464+28353475
rick jones
Honored Contributor

Re: Changing MAC address

OK, I'll ask the elephant in the middle of the room question - why do you want to set an HP-UX's NIC's MAC address to all zeros?
there is no rest for the wicked yet the virtuous have no pillows
Arunvijai_4
Honored Contributor

Re: Changing MAC address

I brought down the interface and tried to change MAC address using SAM, but getting this error

├в ERROR: lan1 interface | PPA 1 : error: expected primitive 0x06, got ├в ├в d├в
├в ├в ├в ├в DL_ERROR_ACK ├в ├в ├в ├в
├в ├в ├в dl_error_primitive = 0x33 ├в ├в ├в
├в ├в ├в dl_errno = 0x04 ├в ├в ├в
├в ├в ├в ├в dl_unix_errno = 22 ├в ├в ├в
├в ├в ├в ├в change_phys_addr: unable to change physical address ├в ├в ├в
├в ├в ├в ├в Old Station Address = 0x001083f6cd7e

"A ship in the harbor is safe, but that is not what ships are built for"