[RADIATOR] Tunnel-Preference Round-Roubin

Fabio Prina Fabio.Prina at easynet.com
Mon Feb 10 08:25:07 CST 2014


Hi All,

I've to spread connections between N l2tp tunnel:

Tunnel-Server-Endpoint="1:10.0.0.1"
Tunnel-Server-Endpoint="2:10.0.0.2"
Tunnel-Server-Endpoint="3:10.0.0.3"
Tunnel-Type="1:L2TP"
Tunnel-Type="2:L2TP"
Tunnel-Type="3:L2TP"
[ ... ]
Tunnel-Preference="1:1"
Tunnel-Preference="2:2"
Tunnel-Preference="3:3"

Till now I've added the Server-Endpoint and the other attrs via a DefaultReply and the Tunnel-Preference via a Hook like:

my $rr  = 1; 
sub {
	$rad_output->get_reply->add_attr("Tunnel-Preference", "1: ".($rr++%3));
	$rad_output->get_reply->add_attr("Tunnel-Preference", "2: ".($rr++%3));
	$rad_output->get_reply->add_attr("Tunnel-Preference", "3: ".($rr++%3));
	$rr++
}

... now I'm wondering if there is a more simple and clever implementation to do that 
Do you have any idea/suggestion ?

Thanks 
--
Fabio





More information about the radiator mailing list