From owner-freebsd-questions@freebsd.org Wed Dec 23 18:41:52 2020 Return-Path: Delivered-To: freebsd-questions@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 7655D4C86B6 for ; Wed, 23 Dec 2020 18:41:52 +0000 (UTC) (envelope-from ihor@antonovs.family) Received: from mail.antonovs.family (mail.antonovs.family [100.25.240.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.antonovs.family", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1MW32gJ9z3qG2 for ; Wed, 23 Dec 2020 18:41:51 +0000 (UTC) (envelope-from ihor@antonovs.family) Received: by mail.antonovs.family (OpenSMTPD) with ESMTPSA id f647944d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 23 Dec 2020 18:41:43 +0000 (UTC) Subject: Re: Network namespaces in FreeBSD To: freebsd-questions@freebsd.org References: <20201223182227.da6c11d3604eb07bb4f18ce5@sohara.org> From: Ihor Antonov Message-ID: <2581038e-fa0f-231d-ae33-1b42d50c8600@antonovs.family> Date: Wed, 23 Dec 2020 10:40:35 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4D1MW32gJ9z3qG2 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=antonovs.family; spf=pass (mx1.freebsd.org: domain of ihor@antonovs.family designates 100.25.240.195 as permitted sender) smtp.mailfrom=ihor@antonovs.family X-Spamd-Result: default: False [-3.80 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[100.25.240.195:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[100.25.240.195:from:127.0.2.255]; ARC_NA(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[antonovs.family,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14618, ipnet:100.24.0.0/13, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2020 18:41:52 -0000 On 12/23/20 10:32 AM, Kristof Provost wrote: > On 23 Dec 2020, at 19:22, Steve O'Hara-Smith wrote: >> On Wed, 23 Dec 2020 16:48:11 +0000 >> Ameya Deshpande via freebsd-questions >> wrote: >> >>> Hi, >>> >>> I am new to FreeBSD. I was wondering if there is concept like Network >>> Namespaces in FreeBSD, like it is in Linux? >> >>     There is something similar see man setfib for details. >> > I’ve only briefly played with linux network namespaces, but aren’t vnet > jails much closer to that? I have more experience with Linux than with FreeBSD, so I don't know for sure what setfib is about. VNET jails is the closest thing that comes to mind when comparing to Linux network namespaces. Unlike Linux, in a jail you will get all other namespaces separated too (e.g. mount, pid etc.) Unfortunately I don't know if it is possible to get exactly same behavior as in Linux - share all other namespaces except for network stack. I imagine you can get something like this with Capsicum, but it would require making changes to the app. Ihor