show vpn ipsec sa


#1

Dear all,

I have added a custom cipher (HW based) for ESP transform. The tunnel shows active, but when I run the command

show vpn ipsec sa

the VyOS prints ‘invalidTYPE_192’ under the encrypt heading. While the cipher name is correctly saved in configuration and it is visible in log messages also.
Kindly suggest what may be the cause? and where this command is implemented in source code tree?

Thanks!

EDIT: I’ve found it is implemented in package vyatta-op-vpn. It is PERL script OPMODE.pm. but can’t figure out.


#2

what’s the output of “sudo ipsec statusall | grep peer”


#3

Here’s the output.

000 “peer-192.168.1.200-tunnel-1”: 192.168.4.0/24===192.168.1.100[192.168.1.100]…192.168.1.200[192.168.1.200]===192.168.40.0/24; erouted; eroute owner: #4
000 “peer-192.168.1.200-tunnel-1”: ike_life: 28800s; ipsec_life: 3600s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0
000 “peer-192.168.1.200-tunnel-1”: policy: PSK+ENCRYPT+TUNNEL+PFS+UP; prio: 24,24; interface: eth0;
000 “peer-192.168.1.200-tunnel-1”: newest ISAKMP SA: #1; newest IPsec SA: #4;
000 “peer-192.168.1.200-tunnel-1”: IKE proposal: AES_CBC_256/HMAC_SHA1/MODP_1536
000 “peer-192.168.1.200-tunnel-1”: ESP proposal: INVALID_PAYLOAD_TYPE_192/HMAC_SHA1/
000 #3: “peer-192.168.1.200-tunnel-1” STATE_QUICK_R2 (IPsec SA established); EVENT_SA_REPLACE in 3132s
000 #3: “peer-192.168.1.200-tunnel-1” esp.ceb2d374@192.168.1.200 (0 bytes) esp.c3f8ed2d@192.168.1.100 (0 bytes); tunnel
000 #2: “peer-192.168.1.200-tunnel-1” STATE_MAIN_R3 (sent MR3, ISAKMP SA established); EVENT_SA_REPLACE in 28332s
000 #4: “peer-192.168.1.200-tunnel-1” STATE_QUICK_I2 (sent QI2, IPsec SA established); EVENT_SA_REPLACE in 2653s; newest IPSEC; eroute owner
000 #4: “peer-192.168.1.200-tunnel-1” esp.c0c4588f@192.168.1.200 (0 bytes) esp.cee81397@192.168.1.100 (0 bytes); tunnel
000 #1: “peer-192.168.1.200-tunnel-1” STATE_MAIN_I4 (ISAKMP SA established); EVENT_SA_REPLACE in 27612s; newest ISAKMP


#4

the command “show vpn ipsec sa” just parses the command “ipsec statusall” for the encryption type. You can see in the output of that command the INVALID_PAYLOAD_TYPE_192. So it’s actually strongswan that is reporting the hardware encryption type.


#5

Thanks all for your help.
I have found the cause and corrected it. It was a mistake in the ‘esp_transform_name’ enum entry of my cipher name. It is found in /vyatta-strongswan/src/pluto/constants.c file.