From nobody Sat Jan 14 23:48:13 2023 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NvZjZ5YtVz2pBGc for ; Sat, 14 Jan 2023 23:48:18 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE Root Certificate Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NvZjZ0Xykz3HN7; Sat, 14 Jan 2023 23:48:18 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 2a01:4f8:13b:39f::9f:25 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net; dmarc=none Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id CD88C8D4A142; Sat, 14 Jan 2023 23:48:16 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D2BBF5C3A833; Sat, 14 Jan 2023 23:48:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id Ntvor75Gc6zA; Sat, 14 Jan 2023 23:48:14 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 3F6D85C3A830; Sat, 14 Jan 2023 23:48:14 +0000 (UTC) Date: Sat, 14 Jan 2023 23:48:13 +0000 (UTC) From: "Bjoern A. Zeeb" To: Matthew Seaman cc: freebsd-net@freebsd.org Subject: Re: Bind fails in jail with assigned IP address In-Reply-To: <0fa79b55-c175-0729-7dfb-f16497a00d70@FreeBSD.org> Message-ID: References: <68c52405-1071-db04-0874-f6dac2bacceb@s14u.de> <0fa79b55-c175-0729-7dfb-f16497a00d70@FreeBSD.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1098556516-1085601412-1673740094=:27118" X-Spamd-Result: default: False [-2.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; CTYPE_MIXED_BOGUS(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.996]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:39f::9f:25:c]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-net@freebsd.org]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; ARC_NA(0.00)[]; DMARC_NA(0.00)[zabbadoz.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; RCVD_COUNT_FIVE(0.00)[5]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4NvZjZ0Xykz3HN7 X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1098556516-1085601412-1673740094=:27118 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Fri, 13 Jan 2023, Matthew Seaman wrote: > On 08/01/2023 18:52, Steffen Christgau wrote: >>> ip4.addr >>> A list of IPv4 addresses assigned to the jail.  If this is set, the jail >>> is restricted to using only these addresses. [...] Attempts to use I think someone needs to add the word "unicast" to these sentences. In classic plain old IP jails there is no MC support. You need, as Matthew points out below, a vnet enabled jail for that. >>> wildcard addresses silently use the jailed address instead. For IPv4 the >>> first address given will be used as the source address when >>> source address selection on unbound sockets cannot find a better match. >> The effect of the silently changed wildcard address in my case is that the >> changed address prevents the required binding of the second/sending socket. >> This is inconsistent with the behavior outside a jail. Is this actually >> intended? If so, what can be done to bind both sockets to their required >> ports? >> >> I also tried to set ip4.saddrsel = 1 in the jail config, but it appeared >> that nothing changed. If the IP address configuration is omitted for the >> jail, the service does not encounter the error of an address that is >> already in use. >> >> If there is a solution to have the daemon run in a jail, I would be happy >> to discuss this. If jails are not suitable for this use case, let me know >> as well. 😉 >> > > Did you try using vnet style jails? These have their own, separate, loopback > interface and a separate network interface, typically using epair(4) so you > should avoid the silent rewriting of wildcard addresses that is causing you > such difficulty. > > See: https://wiki.freebsd.org/Jails/VNET > /usr/src/share/examples/jails/jib > > Cheers, > > Matthew > > -- Bjoern A. Zeeb r15:7 --1098556516-1085601412-1673740094=:27118--