cancel
Showing results for 
Search instead for 
Did you mean: 

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
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"
Arunvijai_4
Honored Contributor

Re: Changing MAC address

Tried with lanadmin, didn't succeed though

# lanadmin -A 0x000000000000 1
Old Station Address = 0x001083f6cd7e
error: expected primitive 0x06, got DL_ERROR_ACK
dl_error_primitive = 0x33
dl_errno = 0x04
dl_unix_errno = 22
change_phys_addr: unable to change physical address
"A ship in the harbor is safe, but that is not what ships are built for"
Arunvijai_4
Honored Contributor

Re: Changing MAC address

I am trying to simulate and test a customer issue.
"A ship in the harbor is safe, but that is not what ships are built for"
Roland Piette
Regular Advisor

Re: Changing MAC address

Hi Arunvijai,

Before using lanadmin -A command you need to bring down your interface with ifconfig command. After setting the new address the interface will be bring up.

To get back the factory address you can use -A DEFAULT keywords in lanadmin command.

Regards
rick jones
Honored Contributor

Re: Changing MAC address

I suspect this bringing down the interface would include an "unplumb" ifconfig command.

The only place I would initially see a MAC address of all zeros would be a broken NIC, which would seem to be a HW replacement issue?
there is no rest for the wicked yet the virtuous have no pillows
Arunvijai_4
Honored Contributor

Re: Changing MAC address

Yes, I brought down and unplumb the interface and tried changing using lanadmin -A; still the same error persists.

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

Re: Changing MAC address

It is quite possible that the code in the kernel is making some sanity checks of the MAC address and deciding it does not like the MAC address at all (not surprising since all zeros used to be - long long long ago - a broadcast address). You might try changing just a single bit or two from the existing MAC address and try setting the card to that - I would change a couple bits in the middle somewhere.
there is no rest for the wicked yet the virtuous have no pillows