From owner-freebsd-net@freebsd.org Wed Mar 18 15:24:56 2020 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 A725B263344; Wed, 18 Mar 2020 15:24:56 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48jDP25SM2z4PQM; Wed, 18 Mar 2020 15:24:54 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 6961D8D4A165; Wed, 18 Mar 2020 15:24:46 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D862AE707FE; Wed, 18 Mar 2020 15:24:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id ctVEeAPK4ABZ; Wed, 18 Mar 2020 15:24:45 +0000 (UTC) Received: from [169.254.231.217] (unknown [IPv6:fde9:577b:c1a9:4902:d1ed:d97:f150:a4e5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id F10ABE707C6; Wed, 18 Mar 2020 15:24:44 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Victor Sudakov" Cc: freebsd-questions@freebsd.org, freebsd-net@freebsd.org Subject: Re: IPv6 in jails Date: Wed, 18 Mar 2020 15:24:42 +0000 X-Mailer: MailMate (2.0BETAr6146) Message-ID: <069AA173-29F1-4F9F-B7D6-31BF2C559C17@lists.zabbadoz.net> In-Reply-To: <20200318151556.GA64871@admin.sibptus.ru> References: <20200318151556.GA64871@admin.sibptus.ru> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Rspamd-Queue-Id: 48jDP25SM2z4PQM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=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 X-Spamd-Result: default: False [-4.75 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; NEURAL_HAM_MEDIUM(-0.91)[-0.909,0]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:39f::9f:25]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[zabbadoz.net]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-2.55)[ip: (-8.58), ipnet: 2a01:4f8::/29(-2.57), asn: 24940(-1.56), country: DE(-0.02)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2020 15:24:56 -0000 On 18 Mar 2020, at 15:15, Victor Sudakov wrote: > Dear Colleagues, > > Is IPv6 in jails supposed to work? Does not work for me, what am I > doing > wrong? > > Here is a test jail: > > test4 { > path = /d02/jails/test4 ; > mount.devfs; > ip4 = new; > ip6 = new; > ip4.addr = 192.168.4.204/24; > ip6.addr = 2001:470:ecba:3::4/64; I usually do something like this: ip6.addr += "lo0|2001:db8:1234:5678::ef/128"; to add the single address out of a /64 to the loopback interface on the host and then pass it through to the jail. The /64 however is actually routed to my host so might not work if you have the /64 on the physical interface. Given it is a jail without vnet you cannot assign a /64 to the jail, you want to just specify the address usually (plainly or as /128). > host.hostname = test4.vas.sibptus.ru ; > interface = re1 ; > allow.raw_sockets = true ; > exec.start = "/bin/sh /etc/rc"; > exec.stop = "/bin/sh /etc/rc.shutdown"; > } > > However when I look from inside the jail, I see the daemons listening > only on IPv4: > > root@test4:/ # sockstat -l > USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN > ADDRESS > root sendmail 17178 3 tcp4 192.168.4.204:25 *:* > root sshd 17175 3 tcp4 192.168.4.204:22 *:* > root syslogd 17110 5 udp4 192.168.4.204:514 *:* > > If I "ssh 2001:470:ecba:3::4" from outside, I get into the host > instead > of the jail (because 2001:470:ecba:3::4 *is* assigned to re1, but not > available inside the jail). One thing to check first is ifconfig inside the jail does see the address? /bz