From owner-freebsd-net@freebsd.org Sat Feb 6 17:15:18 2021 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84A6352F3E3 for ; Sat, 6 Feb 2021 17:15:18 +0000 (UTC) (envelope-from peter.garshtja@ambient-md.com) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DXzSP5JjDz4rTc for ; Sat, 6 Feb 2021 17:15:17 +0000 (UTC) (envelope-from peter.garshtja@ambient-md.com) Received: by mail-qk1-x733.google.com with SMTP id x81so10289839qkb.0 for ; Sat, 06 Feb 2021 09:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ambient-md-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=m8yU7On4HCDe/QTweGlRgtbudi61t6DlrwnU7XW1LMs=; b=OtMnP0lB1rcYHfhww/QbnFTgRFu5kP3S1b3f0ZCTTQF4ETtLeE1DMEqmUMQiODPBdt pVrGuCGzOVJxxMQCFd330uM4YCEsAwb1Iyj67DHb3J6ln+npB1w6cJNV8kjY5Zu813m3 9DgLl/wlNbGve/DGBSEV1w3QHAZSyzUDopQrmRL+xxPPtO0UQMI0BGKfxFriusUmuAD1 dHjxezP4c+3MK0Ot98mcZBP0lroICzCVMFY94OmLmhRBhCE16kf44rZLRhMDWavlV0C6 eg7LdXdLj7pbulX+KxqPTNQ7rALe/ujvp6jKVeF8dWrdVkju5tNvLoRxVXoPSbVu3/sI QjTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=m8yU7On4HCDe/QTweGlRgtbudi61t6DlrwnU7XW1LMs=; b=LtSGTdprjEGodI2bixcOsrNkQqzd4THEpE4U5OI/F8lgF9qfSczdM1lCkdV2F8gR1I 6wPVm1zzCs9RLcnkDJ6RedYNEd+q0FR45mnkRPf0gItqC/Ox5gw0k+FZWgwT8sTt4nAn 4/A4/pfOiqwhCFaVGajyinlG+vVER74mmlIsahcvdcrxjfnFK/f8Re/56F/6WJvjPqxc VFf0yDHaPo0bFvgRWUDjF2XaPaO+LvoSkkbIoZxLGyDm0whp8Ro2T4BjG8zEE9oDrkdN JKe42reuclTAur/of2nVaffldKUe3IAvNH3MThTCkhotXQr8HvMP88Ah1r8GyJdSnyg8 GnVg== X-Gm-Message-State: AOAM531a1mv06WbwlmpumEW3rxDmCSr25ooXYjhmfxMW/+mX7bH869FH C/DdIKfr3TkQZI98Rzs/17JetzaONbvbWcxK X-Google-Smtp-Source: ABdhPJxmgccsSQuAPnmw7EdQIstKXwTxAYUrDGw/j/VNFOWfL0JqdWfPEkPIHPrsEAHOgweZ+iJNtQ== X-Received: by 2002:a37:8287:: with SMTP id e129mr1169336qkd.134.1612631716403; Sat, 06 Feb 2021 09:15:16 -0800 (PST) Received: from ?IPv6:2001:470:1c:38d::4? ([2001:470:1c:38d::4]) by smtp.gmail.com with ESMTPSA id 62sm13015165qkn.136.2021.02.06.09.15.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 Feb 2021 09:15:16 -0800 (PST) Subject: Re: netgraph with ng_netflow and ng_gridge nodes To: Lutz Donnerhacke Cc: freebsd-net@freebsd.org References: <43cf5dc9-521c-dcc4-f025-398173608062@ambient-md.com> <20210202201649.GA31653@belenus.iks-jena.de> <20210202202651.GA31946@belenus.iks-jena.de> <20210206164854.GA1074@belenus.iks-jena.de> From: petru garstea Message-ID: Date: Sat, 6 Feb 2021 12:15:14 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210206164854.GA1074@belenus.iks-jena.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 4DXzSP5JjDz4rTc X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ambient-md-com.20150623.gappssmtp.com header.s=20150623 header.b=OtMnP0lB; dmarc=none; spf=none (mx1.freebsd.org: domain of peter.garshtja@ambient-md.com has no SPF policy when checking 2607:f8b0:4864:20::733) smtp.mailfrom=peter.garshtja@ambient-md.com X-Spamd-Result: default: False [-3.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[ambient-md-com.20150623.gappssmtp.com:s=20150623]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; DMARC_NA(0.00)[ambient-md.com]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::733:from:127.0.2.255]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ambient-md-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::733:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::733:from]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-net] X-Mailman-Approved-At: Sat, 06 Feb 2021 18:09:15 +0000 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 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, 06 Feb 2021 17:15:18 -0000 > If you like to understand your network, try: > # ngctl dot [-c] > and paste the output to http://www.webgraphviz.com/ I used it when was building the graph :) On 2/6/21 11:48 AM, Lutz Donnerhacke wrote: > On Sat, Feb 06, 2021 at 11:10:29AM -0500, petru garstea wrote: >> Greetings, >> >> I have come up with a graph with no use of ng_tee, ng_hub or ng_one2many. >> >> Also I validated the flows on a collector >> >> In case anybody has the same use case I am sharing the graph >> >> mkpeer re0: netflow lower iface0 >> name re0:lower netflow >> connect re0: netflow: upper out1 >> mkpeer netflow: bridge out0 link0 >> name netflow:out0 re0bridge >> connect re0bridge: netflow: link1 iface1 >> mkpeer re0bridge: eiface link2 ether >> name re0bridge:link2 ng0 >> mkpeer netflow: ksocket export9 inet/dgram/udp >> msg re0: setpromisc 1 >> msg re0: setautosrc 0 >> msg netflow: setconfig {iface=0 conf=11} >> msg netflow: setconfig {iface=1 conf=11} >> msg netflow:export9 connect inet/${collector_ip}:${port} > > bridge.link0 ----- out0.netflow.iface0 --- lower.re0 > \.link1 --- iface1./ \.out1 ----- upper./ > \.link2 ----------------------------- ether.ng0 > > So you collect the data from the outside world to the re0 interface (IP > stack) twice, but you can catch the data from the ng0 interface to re0 > separate from the data to outside. > > If this is your desired setup, fine. > > If you like to understand your network, try: > # ngctl dot [-c] > and paste the output to http://www.webgraphviz.com/ > > HTH