Libreswan's Online Documentation
View the Project on GitHub libreswan/libreswan.github.io
SupportRFC 5685 is a document that specifies guidelines for usage of Redirect Mechanism for Internet Key Exchange Version 2 (IKEv2). Basic idea is that responder peers should be able to redirect the initiators to a new address. RFC suggests that the main usage is intended for server-to-client architectures, where server could (e.g. when he is going down for maintenance or is overloaded) redirect clients to other servers.
Cisco, among the other vendors and implementations, supports this RFC and has a nice explanation of the feature here.
To allow the use of Redirect Mechanism in IKEv2, the following main changes were made:
Four connection options are added for this mechanism:
Examples:
send-redirect=yes
redirect-to=1.2.3.4
accept-redirect=yes
accept-redirect-to=1.1.1.1, 1.2.3.4, server.myserver.org
Two more options are added for config configuration:
Examples:
config setup
global-redirect=on
global-redirect-to=1.2.3.4
config setup
global-redirect=on
global-redirect-to=1.2.3.4,5.6.7.8,9.10.11.12
Redirect during an active session
It is also possible to redirect peers (of specific connection) during an
active session (established IPsec tunnel). For that, the whack command
–redirect-to is used, possibly preceeded by –name
Examples:
ipsec whack --redirect-to 1.2.3.4 # all active peers will be redirected to address 1.2.3.4
ipsec whack --name myconn --redirect-to 1.2.3.4 # active peers of connection myconn will be redirected to address 1.2.3.4
ipsec whack --redirect-to 1.2.3.4,5.6.7.8,9.10.11.12 # all active peers will be (evenly distributed) redirected to addresses 1.2.3.4,5.6.7.8,9.10.11.12
Combining new idea of redirection with network routing logic caused significant problems.
Things that would be nice to have:
1. Figure out a way to enable/disable redirection of peers in IKE_SA_INIT/IKE_AUTH reply based on multiple parameters.
Example: ‘Redirect in IKE_SA_INIT all IKEv2 requests received between 2pm and 4pm to gateway X; redirect in IKE_AUTH all IKEv2 requests (received between 1am and 3am AND peer certificate is issued by Y) to gateway Z’
Code status: merged in master branch, in the meantime it was refactored and heavily improved by main developer D. Hugh Redelmeier.
Code commit can be found here: https://github.com/vukasink/libreswan/commit/cd4dda55fbd15372f1b115f5d9d38b05da6ac50e
Test commit can be found here: https://github.com/vukasink/libreswan/commit/9de3fbf1ee2743e75dd362d52c9852defa6f3936
The main developer of this feature is Vukasin Karadzic. Work on this project was done under the mentorship of Paul Wouters and sponsored by Google as part of Google Summer of Code 2018 Program.