From owner-freebsd-pf@FreeBSD.ORG Mon May 14 16:07:29 2007 Return-Path: X-Original-To: freebsd-pf@freebsd.org Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8BDE16A403 for ; Mon, 14 May 2007 16:07:29 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.236]) by mx1.freebsd.org (Postfix) with ESMTP id 8A32D13C45E for ; Mon, 14 May 2007 16:07:29 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so1624898wxc for ; Mon, 14 May 2007 09:07:28 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=sLDHCvAW4V2I36SE4acn3pBtdcFCPTjAgScuJeKIU7HqY4o8KDaS8cHzF+CuP6KPYeGfZJkYVkJM4pfkfi2VqyZFwCVv5wIk8Wezc+fSSSk0jEWGD4aLJKoqfZrwcec6BUYbuaxMaUl2e5f9KuwRFET652rgfVzCe1SziZgJego= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=BS3nDq7jSRLCyEwso2sUgxnW0/kqh+gQRws/BgYU8LMAmnNVaBUnnDVhbrBPwj5pBeiA4NTXim/d0y+1JrD6+LsOJdRfHzZS01vO0QAzVCYtf1E4L9UFudzyjiWvL+AFDPHnQY2WlC06vTIyaUXwnQPcL5bCu7lqInd/y5YyJt0= Received: by 10.70.91.16 with SMTP id o16mr10009526wxb.1179157218748; Mon, 14 May 2007 08:40:18 -0700 (PDT) Received: by 10.70.73.1 with HTTP; Mon, 14 May 2007 08:40:18 -0700 (PDT) Message-ID: <9a542da30705140840y549de4cl23894803db5c44d2@mail.gmail.com> Date: Mon, 14 May 2007 17:40:18 +0200 From: "=?ISO-8859-1?Q?Ermal_Lu=E7i?=" To: rajkumars@gmail.com MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: freebsd-pf@freebsd.org Subject: Re: Load balancing with ratio X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2007 16:07:29 -0000 You can use tagging for that with prob rules and then use route-to on tags. Since PF will use route-to only if the rule when route-to is matched you can do like pass bla.. prob 30% ..bla tag ROUTE1 pass bla.. prob 70% ..bla tag ROUTE2 pass bla route-to ($whatever1) tagged ROUTE1 pass bla route-to ($whatever2) tagged ROUTE2 Sorry about the syntax not being correct but you can use the man page to do that. I have not tested that but anyway it should work. > Hi, > > pf can do outbound load balancing using route-to and provide the ext > interface and gateway ip like { ($ext_if1 $ext_gw1), ($ext_if2 > $ext_gw2) } round-robin. But the algorithm is only round-robin which > may not be appropriate if the two links are asymmetric, say an 1MB > line and 256kbps line. > > Is there any way to provide some ratio like 1:4 where out of 5 > packets/bytes 4 will be via one link and one via other link? > > I have gone through the docs and this feature does not seem to exist > any where, so if some one can give a starting place to look, where I > can do some hacking, that would also be fine. > > raj > >