Skip to content

Tunnel state is not returned correctly using govici api's #49

@isha-369

Description

@isha-369

Hi Team
We are using version strongSwan swanctl 5.9.6

We are trying to fetch state of ipsec tunnel periodically in go routine after every 60 seconds through govici api using streamedCommandRequest of list-sas. But encountering one issue wherein state is returned empty randomly after few days..it is an intermittent issue
we tried running bash script along with go program and that bash script prints tunnel status in a file using swanctl --list-sas command. we observed that at same time tunnel status was actually ESTABLISHED but govici api returned empty at same time.

{
<IKE_SA config name> = {
uniqueid = <IKE_SA unique identifier>
version = <IKE version, 1 or 2>
state = <IKE_SA state name>
local-host =
local-port =
local-id =
remote-host =
remote-port =
remote-id =
remote-xauth-id = <remote XAuth identity, if XAuth-authenticated>
remote-eap-id = <remote EAP identity, if EAP-authenticated>
initiator = <yes, if initiator of IKE_SA>
initiator-spi = <hex encoded initiator SPI / cookie>
responder-spi = <hex encoded responder SPI / cookie>
nat-local = <yes, if local endpoint is behind a NAT>
nat-remote = <yes, if remote endpoint is behind a NAT>
nat-fake = <yes, if NAT situation has been faked as responder>
nat-any = <yes, if any endpoint is behind a NAT (also if faked)>
if-id-in =
if-id-out =
encr-alg =
encr-keysize = <key size for encr-alg, if applicable>
integ-alg =
integ-keysize = <key size for encr-alg, if applicable>
prf-alg =
dh-group =
established =
rekey-time =
reauth-time =
local-vips = [
<list of virtual IPs assigned by the remote peer, installed locally>
]
remote-vips = [

]
tasks-queued = [

]
tasks-active = [

]
tasks-passive = [

]
child-sas = {

  • = {
    name =
    uniqueid =
    reqid =
    state =
    mode = <IPsec mode, tunnel|transport|beet>
    protocol = <IPsec protocol AH|ESP>
    encap =
    spi-in =
    spi-out =
    cpi-in = <hex encoded inbound CPI, if using compression>
    cpi-out = <hex encoded outbound CPI, if using compression>
    mark-in =
    mark-mask-in =
    mark-out =
    mark-mask-out =
    if-id-in =
    if-id-out =
    label =
    encr-alg = <ESP encryption algorithm name, if any>
    encr-keysize = <ESP encryption key size, if applicable>
    integ-alg = <ESP or AH integrity algorithm name, if any>
    integ-keysize = <ESP or AH integrity key size, if applicable>
    prf-alg = <CHILD_SA pseudo random function name>
    dh-group = <CHILD_SA PFS rekeying DH group name, if any>
    esn = <1 if using extended sequence numbers>
    bytes-in =
    packets-in =
    use-in = <seconds since last inbound packet, if any>
    bytes-out =
    packets-out =
    use-out = <seconds since last outbound packet, if any>
    rekey-time =
    life-time =
    install-time =
    local-ts = [

]
remote-ts = [

]
}
}
}
}

To Reproduce
Bug can be reproduced by running go routine which periodically prints state of tunnel for few days..and after some time state is printed as empty

Expected behavior
as swanctl client returns correct behavior at the same time..wondering why govici is not able to fetch correct status

Can someone please help me. Any pointers are highly appreciated.
Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions