From nobody Mon Jan 15 15:30:18 2024 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 4TDGLG184xz579hc for ; Mon, 15 Jan 2024 15:30:30 +0000 (UTC) (envelope-from trashcan@ellael.org) Received: from mx1.enfer-du-nord.net (mx1.enfer-du-nord.net [IPv6:2001:41d0:20a:800::464]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TDGLF4q2Lz4sWR for ; Mon, 15 Jan 2024 15:30:29 +0000 (UTC) (envelope-from trashcan@ellael.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ellael.org header.s=dkim header.b=Xe9RX+Xn; dmarc=pass (policy=quarantine) header.from=ellael.org; spf=pass (mx1.freebsd.org: domain of trashcan@ellael.org designates 2001:41d0:20a:800::464 as permitted sender) smtp.mailfrom=trashcan@ellael.org Received: from smtpclient.apple (p200300fb4F0b1b01B9f92D71Fa95cA53.dip0.t-ipconnect.de [IPv6:2003:fb:4f0b:1b01:b9f9:2d71:fa95:ca53]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.enfer-du-nord.net (Postfix) with ESMTPSA id 4TDGLD3dwBzG5P for ; Mon, 15 Jan 2024 16:30:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellael.org; s=dkim; t=1705332628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AZ7f9aa02xBa26cWATvXcRyDIR3T8ZnTmA7gPZyqrnU=; b=Xe9RX+XnAAsFXKjx/3vqd6Mfj0EF7U7zRipwrxuLOe7vKo3+xvgsc6QaC4/P9nTiyqcqHP YwCXtwSKSWwT9RorEq5Ps1vOfNkVcCQrSHDDDMOYvcDPpqhyh5s1FnR/AsbuQSt8o2hw8h 8MNMozEjmaddhP8xqvn2+S3RMwIT7+3wZ5o8l/lgo5moMbbv2jGfH/wwCDwQR8EstI5tPY sgYm9OrWWbs5eaJBYyfGYHkLgU/+gZrFvAVrkxEjvcnriBMDBbi7TYU5P7I5hdCvu1F2Rj hgxXjOhWP4UxIX8b7c72ox6nzWRQAd1e/bHn87p3MSemCsK0MXC5eSFXjjZQWA== From: Michael Grimm Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: Howto: ipsec tunnel routing both IPv4 and IPv6? Possible? Date: Mon, 15 Jan 2024 16:30:18 +0100 References: <33923504-0ECC-46D7-9F6C-91D47CEE4594@ellael.org> <9339DE28-07F6-4855-927B-824360603CB2@ellael.org> <36260194-6050-4ed4-a8e2-9697f41b3adf@plan-b.pwste.edu.pl> To: freebsd-net@freebsd.org In-Reply-To: Message-Id: <210D7B3B-8055-4553-B945-17F196F6C9E0@ellael.org> X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.40 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[ellael.org,quarantine]; R_SPF_ALLOW(-0.20)[+ip6:2001:41d0:20a:800::464:c]; R_DKIM_ALLOW(-0.20)[ellael.org:s=dkim]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[ellael.org:+]; ARC_NA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:16276, ipnet:2001:41d0::/32, country:FR]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-net@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: 4TDGLF4q2Lz4sWR Me wrote: > On 15. Jan 2024, at 16:15, Michael Grimm wrote: >=20 > Marek Zarychta wrote: >> W dniu 15.01.2024 o 15:35, Michael Grimm pisze: >=20 >>> route_tunnel0=3D"fd00:a:a:a::/64 fd00:a:a:a::254" >=20 >> Please try: >> route_tunnel0=3D"-6 -net fd00:a:a:a::/64 fd00:a:a:a::254" >=20 > Bingo! That did the trick: >=20 > Internet6: > Destination Gateway = Flags Netif Expire > fd00:a:a:a::/64 fd00:a:a:a::254 = UGS ipsec0 > fd00:a:a:a::254 link#4 UH = ipsec0 > fd00:b:b:b::250 link#3 = UHS lo0 That has been a bit premature, because now, the IPv4 routing has been = lost. Because when having two identical route_tunnel0=3D keywords provided, = the latter wins. FTR: Here is the final solution: /etc/rc.conf: cloned_interfaces=3D"ipsec0" static_routes=3D"tunnel0 tunnel1" create_args_ipsec0=3D"reqid 104" ifconfig_ipsec0=3D"inet 10.2.2.250 10.1.1.254 tunnel 1.2.3.4 = 10.20.30.40" ifconfig_ipsec0_ipv6=3D"inet6 fd00:b:b:b::250 fd00:a:a:a::254 = prefixlen 128 tunnel 1.2.3.4 10.20.30.40" route_tunnel0=3D"10.1.1.0/24 10.1.1.254" route_tunnel1=3D"-6 -net fd00:a:a:a::/64 fd00:a:a:a::254" ifconfig vtnet0: vtnet0: = flags=3D1008843 metric = 0 mtu 1490 tunnel inet 1.2.3.4 --> 10.20.30.40 inet 10.2.2.250 --> 10.1.1.254 netmask 0xffffff00 inet6 fd00:b:b:b::250 --> fd00:a:a:a::254 prefixlen 128 netstat -rn: Internet: Destination Gateway Flags Netif Expire 10.1.1.0/24 10.1.1.254 UGS ipsec0 10.1.1.254 link#4 UH ipsec0 10.2.2.250 link#3 UHS lo0 Internet6: Destination Gateway = Flags Netif Expire fd00:a:a:a::/64 fd00:a:a:a::254 UGS = ipsec0 fd00:a:a:a::254 link#4 UH = ipsec0 fd00:b:b:b::250 link#3 UHS = lo0 > Thanks to all who helped, and to me: lessons learned ;-) Yeah, Michael