Date: Wed, 18 Mar 2020 22:35:44 +0700 From: Victor Sudakov <vas@sibptus.ru> To: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> Cc: freebsd-questions@freebsd.org, freebsd-net@freebsd.org Subject: Re: IPv6 in jails Message-ID: <20200318153544.GA65497@admin.sibptus.ru> In-Reply-To: <069AA173-29F1-4F9F-B7D6-31BF2C559C17@lists.zabbadoz.net> References: <20200318151556.GA64871@admin.sibptus.ru> <069AA173-29F1-4F9F-B7D6-31BF2C559C17@lists.zabbadoz.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Bjoern A. Zeeb wrote: > >=20 > > Is IPv6 in jails supposed to work? Does not work for me, what am I doing > > wrong? > >=20 > > Here is a test jail: > >=20 > > test4 { > > path =3D /d02/jails/test4 ; > > mount.devfs; > > ip4 =3D new; > > ip6 =3D new; > > ip4.addr =3D 192.168.4.204/24; > > ip6.addr =3D 2001:470:ecba:3::4/64; >=20 > I usually do something like this: >=20 > ip6.addr +=3D "lo0|2001:db8:1234:5678::ef/128"; >=20 > to add the single address out of a /64 to the loopback interface on the h= ost > 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. But the same syntax for IPv4 (192.168.4.204/24) works fine! The address 192.168.4.204 is successfully assigned to the jail. >=20 > 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). Why is that? I can assign an IPv4 /24 to the jail but cannot assign an IPv6= /64 ? The prefix length should be irrelevant, as it is irrelevant in the IPv4 case. >=20 > > host.hostname =3D test4.vas.sibptus.ru ; > > interface =3D re1 ; > > allow.raw_sockets =3D true ; > > exec.start =3D "/bin/sh /etc/rc"; > > exec.stop =3D "/bin/sh /etc/rc.shutdown"; > > } > >=20 > > However when I look from inside the jail, I see the daemons listening > > only on IPv4: > >=20 > > 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 *:* > >=20 > > 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). >=20 > One thing to check first is ifconfig inside the jail does see the address? Yes, it does: root@test4:/ # ifconfig re1 re1: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 description: Inside options=3D8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,W= OL_MAGIC,LINKSTATE> ether c4:12:f5:33:c9:7c inet 192.168.4.204/24 broadcast 192.168.4.255 inet6 2001:470:ecba:3::4/64 media: Ethernet autoselect (none) status: no carrier nd6 options=3D21<PERFORMNUD,AUTO_LINKLOCAL> root@test4:/ #=20 --=20 Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJecj/QAAoJEA2k8lmbXsY0m8YH/ij3ft/MAARs0Mnl+MPCWAFu 9yPOQXoLTsyHVx9Pvfp7YXHFEUwjoHx8e3+9jLkKMCy3O1aLi95Ztn344YWISdl/ DTpQFiromtWflvkeIf8obzhHrVEzOMBEWnYX340rQ/UFDc+Z2ya++7MuIU9Czac7 0qRe+b6owGWR6Jfn/GgRXYPuEoKMvxT6cnQJSbdsTKRw6a1tfeVMNvKzIcz0AhBp DeJoX7f5CNKNoPlwEMsM2ZsrgAryAv9aT+tuLnZtsgt62FBtUxyb1Dp/4gEozW/Z f1ngQ7RI/sFVgG9IFrqKVZixWmSJHPeDeUBivRw1EfLooLblJ9drg2TSRBO8dAc= =O2Nl -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200318153544.GA65497>