Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Sending ARP Broadcasts via Perl?

by dru145 (Friar)
on Sep 26, 2002 at 15:05 UTC ( [id://200916]=perlquestion: print w/replies, xml ) Need Help??

dru145 has asked for the wisdom of the Perl Monks concerning the following question:

Hey Monks,

I would first like to mention that this question might not be a 100% Perl question, but I feel it is Perl related enough to be posted on this forum. Other's might disagree though.

It's been awhile since I've done any coding, but I'm back at it. I'm writing some code that will run on a secondary linux server and peridoically check the primary linux server to see if it's listening on a particular port. If it's not, then run some commands for further troubleshooting and if all else fails bring the backup server online and act as the primary. All that is kosher, but the problem I'm having is with ARP entries. Is there a way with Perl (or even in Linux) to send out an ARP broadcast to tell all machines to update their arp table's with the entry of the backup server? Right now, it seems to be taking up to 5 minutes for the servers/routers to update their ARP tables. I know you can tweak the config. on the routers to a lower ARP updates, but I'm not sure if our WAN team would go for this since it most likely would put an additional strain on their routers. Ideally an ARP broadcast done via Perl would be my preferred solution.

Also, I already looked into Linux HA: http://linux-ha.org/ but it's not really what I want to do.

Thanks,
Dru
Another satisfied monk.

Replies are listed 'Best First'.
Re: Sending ARP Broadcasts via Perl?
by Preceptor (Deacon) on Sep 26, 2002 at 15:13 UTC
    Unfortunately it's not that simple. The reason they don't re-query the mac address is because they have it cached locally. They way to fix this problem is as root on each run an 'arp -d' (since very few machines will 'listen' to an unsolicted ARP broadcast)
    Or as an alternative, it's possible (certainly on solaris) to re-configure a mac address on a card. You 'backup' server would then be able to steal the mac of the master server.
    --
    It's not pessimism if there is a worse option, it's not paranoia when they are and it's not cynicism when you're right.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://200916]
Approved by broquaint
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-23 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found