From owner-freebsd-net@freebsd.org Thu Jul 20 16:32:30 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54203C7BB0C for ; Thu, 20 Jul 2017 16:32:30 +0000 (UTC) (envelope-from vegeta@tuxpowered.net) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F143A6FDDE for ; Thu, 20 Jul 2017 16:32:29 +0000 (UTC) (envelope-from vegeta@tuxpowered.net) Received: by mail-wm0-x231.google.com with SMTP id w126so29104321wme.0 for ; Thu, 20 Jul 2017 09:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxpowered-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:organization:user-agent :mime-version; bh=hkr4E3XXvwVngsZe1pqstPiK8tWwT7b9PXIGU1KQ/KA=; b=T4bwlFDehd+N57OBtm821wH8+7i2pHQxNyD7ogleeiHxeVHPCah/XGy3/xlkn6XeCB HJEbR9BQ5yyDyb9G/5Xu1kXN1Gq1vSjPvS9HFOx05mGU0fao3bJraTmM/rj/ZcUHsjhM Mu75GAw6kV4Ja9SrovInSnuUF+z0Nb20qSrBfEpnSrSH9IDw90TSssK5937jX6uRRny3 WtB/vE8AXdqEChUTzQ50lrAMYpieZswOo5/E9gkDSd5lgg20hheBDdhEeZ8Up0BRVbes /HM7Lx1xW66iG+pg75NqnmZ5JSpU8KzyxHaz2jYzcWT0pZhroYcdKSN0qj9+h9ekTbv1 RbZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:organization :user-agent:mime-version; bh=hkr4E3XXvwVngsZe1pqstPiK8tWwT7b9PXIGU1KQ/KA=; b=bOZkP0BEEIxLwAaFsnzX5VHsLOhHtXx0C7SkzMD50gBf0/DH4TP+FKb1sgHiLEdwxu YPuSa7Uo0AroFUljXEeom74QfG8EjapIZs3aHyBstiQmo6FmbQH7gW6K/tX/lHSc1Ngs xxKOSqugLBPhVliuaKF9HcQzUFdM1i5SOtVeMjOki0ub2X3gSl/Zs9XHvEN88IsT+uBM jG1O/z+Ot3N5XLmaC9jQZj+dyznJfTs2c3aBJuhvaYgeKXhbKZ+7yt10FHrQTGBkk1uP OQ0yG94W3S82igDmZBhBXP7VYWiX8CC4X/NWtofKsVGsdzZebqHyPgBU7WfnoDpbNyPz mDlg== X-Gm-Message-State: AIVw111E9QPlGI7ue+ExAsyzTFgNFDl3Nh1rmdhk8kZu7M+LsTEaxd17 ESxkkjpYgkvKKHb0WcnAEg== X-Received: by 10.80.139.149 with SMTP id m21mr3427843edm.38.1500568347305; Thu, 20 Jul 2017 09:32:27 -0700 (PDT) Received: from energia.localnet ([2a00:1f78:fffb:220:c7f7:2dda:4b51:2d6b]) by smtp.gmail.com with ESMTPSA id c11sm2028002eda.0.2017.07.20.09.32.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jul 2017 09:32:25 -0700 (PDT) From: Kajetan Staszkiewicz To: FreeBSD Net Subject: ipsec encryption only via given route Date: Thu, 20 Jul 2017 18:17:43 +0200 Message-ID: <3526072.muFbfPklCK@energia> Organization: tuxpowered.net User-Agent: KMail/5.2.3 (Linux/4.11.0-3.3-liquorix-amd64; KDE/5.28.0; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2315736.B3RDAlX0kH"; micalg="pgp-sha1"; protocol="application/pgp-signature" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2017 16:32:30 -0000 --nextPart2315736.B3RDAlX0kH Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" Hey group, Across a few data centers I have a some routers running IPsec+BGP tunnels t= o=20 Azure. Microsoft side is nicely following BGP sessions. My routers are unfortunately not. Routes in route table are updated just fi= ne=20 from=20BIRD but unfortunately they are overridden by IPSec policy which is=20 static. That means that all hosts in given data center will route to Azure = via=20 tunnel on this data center's router whenever the IPsec tunnel is establishe= d,=20 disregarding BGP. That seems to work for now, but I already see problems wi= th=20 failover, that is IPsec timeout is way longer than BGP timeout and I expect= =20 more problems with balancing traffic. Routers are running FreeBSD 11.0 with Bird as routing daemon. IPsec daemon = of=20 choice is Strongswan. Tunnels are IKEv2 with single static subnet on Azure side and one big subne= t=20 on my side covering all datacenters and a few extra ones covering some othe= r=20 locations that route through datacenters. Can I somehow make IPsec encryption to happen AFTER routing decision and=20 ensure that it happens only when traffic leaves via specified interface? =2D-=20 | pozdrawiam / greetings | powered by Debian, FreeBSD and CentOS | | Kajetan Staszkiewicz | jabber,email: vegeta()tuxpowered net | | Vegeta | www: http://vegeta.tuxpowered.net | `------------------------^---------------------------------------' --nextPart2315736.B3RDAlX0kH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSOEQZObv2B8mf0JbnjtFCvbXs6FAUCWXDXpwAKCRDjtFCvbXs6 FJgtAJwPdcgoSM3Jr5xNYXOH9JQ+iLLQ0wCg9RZg2MPCkllxvGWaTrc2x/5Y/ho= =FrV+ -----END PGP SIGNATURE----- --nextPart2315736.B3RDAlX0kH--