From owner-freebsd-net@FreeBSD.ORG Sat Aug 11 08:27:43 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17A46106566C for ; Sat, 11 Aug 2012 08:27:43 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9A6A58FC12 for ; Sat, 11 Aug 2012 08:27:42 +0000 (UTC) Received: by wgbds11 with SMTP id ds11so1910763wgb.31 for ; Sat, 11 Aug 2012 01:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=nhnSpLkNFCsZBV/SWw2xnd0iiIq4QxlyWBDqUFzw8KA=; b=K7pFJzg9of1uRRUddSiMk5wGkDBLy7AB9g30sYKeyaznneGnixDJ/MSaz+62cir+Ta 4U1yiJkS13HUDCcX91vpBym2ECgNUw1SOTO9nteSJPiqKPMAed3X5cS4sG5l9rl8U8Pz vwQWzMaD0vcZQP7PX+86jPIC2jgBKnH2Y28/mDBt4Uc/nKbaJVoT/R22ff0cikpjpXNN KTpAi7U7ehCa0cvq9PYs3sLWpwt1WiPvvyiaePOOuMIglVpPrEbHM2s/2sd7bgLtDnc1 mG9GTw93K3D8eNxomlBP/jqpIr3rhxxr31zzt0kMbG5WRq1EQRNQmoAN//eJ2VomGyEn 6rcg== Received: by 10.180.83.106 with SMTP id p10mr2396984wiy.21.1344673661250; Sat, 11 Aug 2012 01:27:41 -0700 (PDT) Received: from [10.0.0.86] ([93.152.184.10]) by mx.google.com with ESMTPS id cu1sm2591910wib.6.2012.08.11.01.27.38 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 11 Aug 2012 01:27:39 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) Content-Type: text/plain; charset=iso-8859-1 From: Nikolay Denev In-Reply-To: Date: Sat, 11 Aug 2012 11:27:37 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <37DC844A-4A65-438D-8DD3-B8EFA7B7FE2A@gmail.com> References: To: h bagade X-Mailer: Apple Mail (2.1485) Cc: freebsd-net@freebsd.org Subject: Re: problem using ng_patch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Aug 2012 08:27:43 -0000 On Aug 11, 2012, at 11:07 AM, h bagade wrote: > Hi all, >=20 > I want to use the node ng_patch, to set the ToS field of special class = of > packets. I try to test the function by a simple test scenario and > encountered problem using it. I have no idea why the problem occurs. >=20 > Here I explain the test scenario I've used. >=20 > I have a topology like this: >=20 > = |A:192.168.8.8|<---->|192.168.8.26--(B)--192.168.7.26|<---->|C:192.168.7.2= 0| > -------------------------------- > A, C: two end stations > B: a router > -------------------------------- > netgraph settings: > kldload ng_ipfw > ngctl mkpeer ipfw: patch 300 in > ngctl name ipfw:300 tos > ngctl msg tos: setconfig {count=3D1 csum_flags=3D1 ops=3D[ {mode=3D1 = value=3D0x05 > length=3D1 offset=3D1}]} > -------------------------------- > ipfw rule: > ipfw add 20 netgraph 300 icmp from any to 192.168.7.20 >=20 > This configuration works well and when A pings C or C pings A, the = packets > destined to 192.168.7.20(station C) gets the ToS: 0x05. > The problem occurs when I change the ipfw rule to the following; >=20 > ipfw add 20 netgraph 300 icmp from 192.168.7.20 to any >=20 > By this rule, neither A can ping C nor C can ping A! the packets sent = to > ng_patch node never comes back to the next ipfw rule! >=20 > I don't know what's the difference between these two scenarios (only = the > checking from destination address is changed to source address), but = it's > what I saw in my tests. I really hope to understand what's happening. >=20 > Any hints or comments would help > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" Hi, Do you have "sysctl net.inet.ip.fw.one_pass=3D0" set? Regards,