Forum Discussion
marshje_58292
Nimbostratus
Dec 11, 2007UDP Health Monitoring with fixed SOURCE port?
Is is possible to configure LTM to use a fixed SOURCE port number when doing UDP health monitoring?
I have a UDP application that I am Load Balancing that does not normally "respond" as such - it's function is simply to replicate/forward traffic. I can write a rule in the forwarding application to send a "response" back to LTM (in response to an LTM monitor UDP packet), if I had a fixed port to respond to.
- JRahm
Admin
If you wrote an external monitor, you could easily write a sockets application in perl or otherwise...use IO::Socket::INET; $MySocket=new IO::Socket::INET->new( LocalPort=>1000, PeerPort=>$2, Proto=>'udp', PeerAddr=>'$1' );
- marshje_58292
Nimbostratus
It's not clear to me how the snippet of code you suggest fits into the larger picture. My sense is that an external monitor program would have to handle both the transmission and receipt of the "health" packet. And further must be able to send a status back to LTM. - JRahm
Admin
The external monitor is a script running on the LTM, called by the external monitor configured to your pool. I suppose with receive-only traffic you will have to be careful with your interval and timeout settings. This script should get you started:!/usr/bin/perl use strict; use warnings; use IO::Socket::INET; my $port = getservbyname 'bootps', 'udp'; my $socket = IO::Socket::INET -> new (LocalPort => $port, Broadcast => 1, Proto => 'udp') or die "Failed to bind to socket: $@"; my $mess; while ($socket -> recv ($mess, 1024)) { print "Saw a bootp request.\n"; }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects