[strongSwan] Traffic selector modification ignored when rekeying SA [follow-up]

FRECHIN and Co regis.frechin22 at orange.fr
Fri Sep 1 11:40:13 CEST 2017


Hi,

Thanks - it helped me a lot. 

I encounter now problems with the child SA management where a call to terminate() fails - and I don't  why :-( . 

Here is what I do:
1a- I create a vici connexion with 1 child (child1) & a set a traffic selectors (TS1)
1b - Create a tunnel IKE2 with a remote device corresponding to this vici connexion
2a - Dynamically I create a new child (child2) in the  vici connexion configuration with one additional traffic selector TS2 (no overlap TS1 as it seems to be impossible)
2b - I call the vici python intiate() function to instanciate child2 SA -> it runs OK : using swanctl --list-sas, I check that the two SA are here.
3a - Dynamically I modify child2 in the vici connexion configuration to add one additional traffic selector TS3 to TS2 
3b - I call vici python terminate() & to initiate() functions to get a new child2 SA -> it runs OK but using swanctl --list-sas, I can see two different child1 SAs (with the same parameters?!?) and one child2 SA.
4a - Dynamically I modify child2 in the  vici connexion configuration to add one additional traffic selector TS4 to TS3 & TS2 
4b - I call vici python terminate() & to initiate() functions to get a new child2 SA -> it FAILS and tries to restart the tunnel with new parameters (& new reauthentication). The exception happens during the call to terminate(). I get an exception : 
  File "/usr/local/lib/python2.7/dist-packages/vici/session.py", line 362, in streamed_request
    errmsg=command_response["errmsg"]
    CommandException: Command failed: terminating SA failed
The problem may happen in a 5b iteration if not in 4b. 

The problem is not the exception but why the call to terminate() fails, of course. 
Do I miss something in the child SAs management? 

thanks,

Régis

 

 

 

 

> Message du 28/08/17 17:48
> De : "Noel Kuntze" 
> A : "FRECHIN and Co" , "Sarefrech" , users at lists.strongswan.org
> Copie à : 
> Objet : Re: [strongSwan] Traffic selector modification ignored when rekeying SA [follow-up]
> 
>     def unloadConn(self, id):         return self.session.unload_conn({                 "name" : str(id)             })     def initiateConn(self, id):         uniqueid=None         for i in self.session.initiate(             {                 "child" : str(id)             }             ):             uniqueid = i["ikesa-uniqueid"]         return uniqueid             def terminateConn(self, id):         for i in self.session.terminate(             {                 "ike" : (id)             }             ):             pass On 28.08.2017 17:40, FRECHIN and Co wrote: > >   > > Hi all, > >   > > I'm now looking for the right syntax to call "terminate()" & "initiate()" functions through vici with python.  I succeed in making calls to load_conn() but not to these 2 functions. > >   > > Would you have a code extract to share I could reuse? > >   > > thanks, > >   > > Régis > >   > >   > >   > >   > >   > > > Message du 25/08/17 17:59 > > De : "Sarefrech"  > > A : users at lists.strongswan.org > > Copie à : > > Objet : [strongSwan] Traffic selector modification ignored when rekeying SA [follow-up] > > > > > > > Hi all, > > >   > > > I think my previous emails got blocked because I did not use my strongswan registered email address. I'll then try to summarize what I did. > > > As a reminder  : > > > - the main issue is that traffic selector list update for a given running SA is not taken into account at rekeying time. :-( > > > - I use Vici with python > > >   > > > I followed a suggestion that was : > > > - to setup a tunnel with its default SAs (child1) -> works fine with a basic config file. > > > - to create a second child SA (child2) with the updated TS list in the connexion list -> I use the vici python load_conn function : works fine. > > > - to activate this "child2" SA -> I'm supposed to use the activate function  I guess. here I have 2 pbs :  > > >         I am unable to use the python vici function that seems to accept only 1 parameter (the child name). I think I need to fill the connexion name somewhere else. > > >         Using the "swanctl --initiate ..." command (as a wokaround), I got one step further but got the error " unable to install policy... " as the same TS are used for child1 & child2. As a result the command fails and the tunnel is restarted. > - to terminate the initial SA -> I did no manage to use the python vici terminate function. > > >   > > > Does somebody out there use python vici interface & could help me? > > >   > > > thanks, > > >   > > > Régis > > >   > > >   > > >   > > >   > > > ------------------------------ > > > Hi all, > > >   > > > I'm using vici to define & dynamically change traffic selectors associated with a connexion (using ikev2). > > >   > > > I observe that traffic selector list modifications are not taken into account at rekey time but only at reauthentication time. > > > I used  "Linux strongSwan U5.5.3/K3.16.0-4-amd64" version and recently switched to "Linux strongSwan U5.5.0/K3.16.0-4-amd64". > > > Is there a way to force TS modification at rekeying time ? >   > > > thanks - Best regards, > > Régis > 
>
> [ signature.asc (0.8 Ko) ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/users/attachments/20170901/df3727d9/attachment.html>


More information about the Users mailing list