Operating System - HP-UX
1821245 Members
3032 Online
109632 Solutions
New Discussion юеВ

How to make an ARP entry persistent even after boot?

 
SOLVED
Go to solution
Jorge Fabregas
Regular Advisor

How to make an ARP entry persistent even after boot?

Hi,

I need to assign a particular mac address to a host. I know how to manually register the mac address with ip address I want (using the arp command with the "-s" switch). However, as soon as I reboot the server these association will be lost.

I looked in /etc/rc.config.d/netconf and couldn't see any option for this. Is there an elegant way to accomplish this? Or do I need to create a one-line script (using the arp command) and place the script on one of the runlevel directories?

Thanks,
Jorge
5 REPLIES 5
Rajeev  Shukla
Honored Contributor
Solution

Re: How to make an ARP entry persistent even after boot?

Hi Jorge,

I am afraid but thats the way to go. I guess thats because the way ARP works is, it is dynamic and changes as and when required so the only option you'll find in /etc/rc.config.d is to define how long you want to keep the ARP cache.
Anyway the best way to add any customized stuff to your server is create a script say localapps having entry to add the static ARP entry using option "s" as you stated and place it in /sbin/init.d and link it to runlenel 3
vinod_25
Valued Contributor

Re: How to make an ARP entry persistent even after boot?

Hi jorge

Follow the Procedure:

1. run lanscan command

[ABCD]/etc/rc.config.d >lanscan
Hardware Station Crd Hdw Net-Interface NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
8/16/6 0x080009CB98FD 0 UP lan0 snap0 1 ETHER Yes 119
10/12/1/0 0x00306E035E2E 3 UP lan3 snap3 2 ETHER Yes 119
8/12/1/0 0x0060B0C15B9F 2 UP lan2 snap2 3 ETHER Yes 119

2. note the Hardware Station address of the lan card to be changed and the net-interface name PPA number ( for eg lan0 is termed as 0, lan3 is termed as 3)

3. Run lanadmin command (add 0x prior to your 12 digit MAC address)

Syntax:-lanadmin -A 0x(new 12digit MAC Address)

[ABCD]/etc/rc.config.d > lanadmin -A 0x00FFFFFF0000 0
Old Station Address = 0x080009cb98fd
New Station Address = 0x00ffffff0000

4. To revert back to factory set mac address
# lanadmin -A DEFAULT 0

5. Your mac address is changed.Anyone correct me if I am wrong

Regards

Vinod K
vinod_25
Valued Contributor

Re: How to make an ARP entry persistent even after boot?

hi jorge

you can manually edit either one of this files in /etc/rc.config.d

hpbtlanconf, hpetherconf, hpfcmsconf, hpfddi4conf, hpgelanconf

depending on your lan card and add

HP_ETHER_INTERFACE_NAME[0]=lan0
HP_ETHER_STATION_ADDRESS[0]=0x00FF00FF00FF

and re run the script under /sbin/init.d/

hpbtlan, hpether, hpfcms, hpgelan, hppcifddi

depending on the lan card...

your mac address is changed...permanently

Goodluck

Vinod
Jorge Fabregas
Regular Advisor

Re: How to make an ARP entry persistent even after boot?

Hello vinod,

Thanks for the comments. I'm not trying to change the mac address of one of my network cards. I'm trying to assign a specific mac address to another host on my same subnet.

For some strange reason, (the network guy is working on this), my system is assigning the wrong mac address to this particular host. Some other server on my network is responding to my ARP broadcasts (as if that other server had the same IP of the server I need to communicate with).

The communication with this host is working properly (after manually setting the mac address). I don't know how much time the problem is going to persist...therefore I would like to make my changes permament. I wanted to know if there was a more elegant way to hard-code the entry before trying to place a script on /sbin/init.d and then creating the symlink in runlevel 3.

It seems this is the only way to go.Rajeev just confirmed that (thanks).

I'll close the thread in the afternoon and I"ll assign points then :) Thanks.
Jorge Fabregas
Regular Advisor

Re: How to make an ARP entry persistent even after boot?

Answer provided.