[Swan-dev] What happened to "ipsec show" ?

Brady Johnson bradyjoh at redhat.com
Fri Oct 27 15:54:44 EEST 2023


Ok, I made some progress with this.

Here is the output of the existing "ipsec connectionstatus" command:

000 Connection list:
000
000 "vpnclient.gwn02.xyz.com": 172.16.20.0/24===172.22.18.102[O=XYZ, CN=
vpnclient.gwn02.xyz.com]...172.22.18.101[O=XYZ, CN=vpnserver.gwn01.xyz.com
]===172.16.10.0/24; routed-tunnel; my_ip=unset; their_ip=unset;
000 "vpnclient.gwn02.xyz.com":   host: oriented; local: 172.22.18.102;
remote: 172.22.18.101;
000 "vpnclient.gwn02.xyz.com":   mycert=vpnclient.gwn02.xyz.com;
my_updown=/bin/ipsec_tunnel_tool_updown.xfrm.sh;
000 "vpnclient.gwn02.xyz.com":   xauth us:none, xauth them:none,
 my_username=[any]; their_username=[any]
000 "vpnclient.gwn02.xyz.com":   our auth:rsasig(RSASIG+RSASIG_v1_5), their
auth:RSASIG+ECDSA+RSASIG_v1_5, our autheap:none, their autheap:none;
000 "vpnclient.gwn02.xyz.com":   modecfg info: us:none, them:none, modecfg
policy:push, dns:unset, domains:unset, cat:unset;
000 "vpnclient.gwn02.xyz.com":   sec_label:unset;
000 "vpnclient.gwn02.xyz.com":   CAs: 'CN=xyzca.xyz.com, O=XYZ'...'%any'
000 "vpnclient.gwn02.xyz.com":   ike_life: 86400s; ipsec_life: 3600s;
ipsec_max_bytes: 2^63B; ipsec_max_packets: 2^63; replay_window: 128;
rekey_margin: 540s; rekey_fuzz: 100%;
000 "vpnclient.gwn02.xyz.com":   retransmit-interval: 500ms;
retransmit-timeout: 60s; iketcp:no; iketcp-port:4500;
000 "vpnclient.gwn02.xyz.com":   initial-contact:no; cisco-unity:no;
fake-strongswan:no; send-vendorid:no; send-no-esp-tfc:no;
000 "vpnclient.gwn02.xyz.com":   policy:
IKEv2+RSASIG+ECDSA+RSASIG_v1_5+ENCRYPT+TUNNEL+PFS+UP+IKE_FRAG_ALLOW+ESN_NO+ESN_YES;
000 "vpnclient.gwn02.xyz.com":   v2-auth-hash-policy:
SHA2_256+SHA2_384+SHA2_512;
000 "vpnclient.gwn02.xyz.com":   conn_prio: 24,24; interface:
ipsec1 at eno12409.4028; metric: 0; mtu: unset; sa_prio:auto; sa_tfc:none;
000 "vpnclient.gwn02.xyz.com":   nflog-group: unset; mark: unset;
vti-iface:unset; vti-routing:no; vti-shared:no; nic-offload:auto;
000 "vpnclient.gwn02.xyz.com":   our idtype: ID_DER_ASN1_DN; our id=O=XYZ,
CN=vpnclient.gwn02.xyz.com; their idtype: ID_DER_ASN1_DN; their id=O=XYZ,
CN=vpnserver.gwn01.xyz.com
000 "vpnclient.gwn02.xyz.com":   liveness: active; dpddelay:5s;
retransmit-timeout:60s
000 "vpnclient.gwn02.xyz.com":   nat-traversal: encaps:auto; keepalive:20s
000 "vpnclient.gwn02.xyz.com":   routing: routed-tunnel; established IKE
SA: #1; established Child SA: #4;
000 "vpnclient.gwn02.xyz.com":   conn serial: $1;
000 "vpnclient.gwn02.xyz.com":   IKE algorithms:
AES_CBC_256-HMAC_SHA1-MODP2048+MODP3072+MODP4096+MODP8192+DH19+DH20+DH21+DH31
000 "vpnclient.gwn02.xyz.com":   IKEv2 algorithm newest:
AES_CBC_256-HMAC_SHA1-MODP2048
000 "vpnclient.gwn02.xyz.com":   ESP algorithms: AES_CBC_256-HMAC_SHA1_96
000 "vpnclient.gwn02.xyz.com":   ESP algorithm newest:
AES_CBC_256-HMAC_SHA1_96; pfsgroup=<Phase1>
000
000 Total IPsec connections: loaded 1, active 1

And here is the output of the new command I added:

ipsec briefconnectionstatus
000 Connection list:
000
000 "vpnclient.gwn02.xyz.com": 172.16.20.0/24===172.22.18.102[O=XYZ, CN=
vpnclient.gwn02.xyz.com]...172.22.18.101[O=XYZ, CN=vpnserver.gwn01.xyz.com
]===172.16.10.0/24;
000
000 Total IPsec connections: loaded 1, active 1

This still seems a little verbose, but I think it provides just enough
info. If somebody wants more info, they can just use the "ipsec
connectionstatus" command.

Regards,

Brady


On Wed, Oct 25, 2023 at 4:18 PM Andrew Cagney <andrew.cagney at gmail.com>
wrote:

> > How about I add "whack --briefconnectionstatus", which would be wrapped
> by "ipsec briefconnectionstatus"? This would show (at least) what you
> listed above.
>
> It would somehow display both:
>     host<->host kernel state
>     selector<->selector kernel policy
> ?
>
> I suspect more useful than the reqid are the type of policy(1) and/or
> routing
>
> Andrew
>
> (1) There's a bear trap here, pluto has three words - reject, drop,
> hold - that all mean block(linux) / discard(bsd); I'd ignore it
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libreswan.org/pipermail/swan-dev/attachments/20231027/8b585c29/attachment.htm>


More information about the Swan-dev mailing list