Comments (6)
Unless you're using libipsec, all data traffic is processed by the kernel, so instrumenting strongSwan won't help you at all.
You can get packet dumps as shown here, and then once the packets are in Netfilter, you can use the TRACE target in *raw (iptables) or use nftables meta nftrace to get information in the kernel log regarding the processing of the packets within your rule set.
Regarding 3), it happens the other way around,. The kernel steals away all non-IKE (in that case with the NONESP-Marker in the beginning instead of the SPI) before they could be passed to the socket.
I suspect it's just either your iptables/nftables rule set or a misconfiguration of the TS. If you'd share the information as listed in #196, I could tell you more.
from strongswan.
Thanks @Thermi , my router is using lantiq hardware acceleration module for ipsec, I'm afraid it is different from the iptables/nftables, because the firewall using OpenRG jungo firewalls.
I traced the code the xfrm part, but still don't know which part is wrong,
some log is as below: xfrm4_transport_input(61): udp sport=32529, dport=152, src=17.148.17.148, dst=0.188.0.0
this line looks the address is wrong. May this is the problem ?
Jan 1 00:03:00 kern.warning [S=2027] kernel: [ 273.724000] Richard - __udp4_lib_rcv(1702): udp sport=4500, dport=4500, src=10.50.50.54, dst=10.50.50.50
Jan 1 00:03:00 kern.warning [S=2028] kernel: [ 273.724000] Richard - udp_queue_rcv_skb(1494) encap_rcv
Jan 1 00:03:00 kern.warning [S=2029] kernel: [ 273.724000] Richard - xfrm4_udp_encap_rcv(81)
Jan 1 00:03:00 kern.warning [S=2030] kernel: [ 273.724000] Richard - xfrm4_udp_encap_rcv(150)
Jan 1 00:03:00 kern.warning [S=2031] kernel: [ 273.724000] Richard - xfrm4_rcv_encap(44)
Jan 1 00:03:00 kern.warning [S=2032] kernel: [ 273.724000] Richard - xfrm_input(107) encap_type=2, spi=0, nexthdr=50
Jan 1 00:03:00 kern.warning [S=2033] kernel: [ 273.724000] Richard - xfrm_input(150) spi=c2b263ac
Jan 1 00:03:00 kern.warning [S=2034] kernel: [ 273.724000] Richard - xfrm_input(157) family=2, spi=c2b263ac, nexthdr=50, daddr=104.199.233.28
Jan 1 00:03:00 kern.warning [S=2035] kernel: [ 273.724000] Richard - xfrm_input(198) nexthdr=-150
Jan 1 00:03:00 kern.warning [S=2036] kernel: [ 273.724000] Richard - xfrm_input(200) return 0
Jan 1 00:03:00 kern.warning [S=2037] kernel: [ 273.724000] Richard - udp_queue_rcv_skb(1497) ret=0
Jan 1 00:03:00 kern.warning [S=2038] kernel: [ 273.724000] Richard - xfrm_input(107) encap_type=-1, spi=0, nexthdr=17
Jan 1 00:03:00 kern.warning [S=2039] kernel: [ 273.724000] Richard - xfrm4_transport_input(45)
Jan 1 00:03:00 kern.warning [S=2040] kernel: [ 273.724000] Richard - xfrm4_transport_input(61): udp sport=32529, dport=152, src=17.148.17.148, dst=0.188.0.0
Jan 1 00:03:00 kern.warning [S=2041] kernel: [ 273.724000] Richard - xfrm4_transport_finish(53)
from strongswan.
code of function xfrm4_transport_input.
static int xfrm4_transport_input(struct xfrm_state *x, struct sk_buff *skb)
{
printk("Richard - %s(%d) \n", __FUNCTION__, __LINE__);
int ihl = skb->data - skb_transport_header(skb);
if (skb->transport_header != skb->network_header) {
memmove(skb_transport_header(skb),
skb_network_header(skb), ihl);
skb->network_header = skb->transport_header;
}
ip_hdr(skb)->tot_len = htons(skb->len + ihl);
__be32 saddr, daddr;
saddr = ip_hdr(skb)->saddr;
daddr = ip_hdr(skb)->daddr;
struct udphdr *uh;
uh = udp_hdr(skb);
printk("Richard - %s(%d): udp sport=%d, dport=%d, src=%pI4, dst=%pI4\n", __FUNCTION__, __LINE__, uh->source, uh->dest, &saddr, &daddr);
skb_reset_transport_header(skb);
return 0;
}
from strongswan.
It'd make no sense for the IPsec acceleration to be usable for delivering skbs to sockets, but not be able to integrate it into Netfilter.
So the debugging options are still available for you.
Take a look at /proc/net/xfrm_stat. If that pseudofile is available, you can see decryption failures and other error counters.
from strongswan.
Did you figure it out?
from strongswan.
Did you figure it out?
Yes, it's the sdk's problem
from strongswan.
Related Issues (20)
- Support for X.509 nameConstraints in the openssl plugin
- Support for X.509 nameConstraints of type iPAddress
- Adopt subjectKeyIdentifier of CA certificate as authorityKeyIdentifier if available
- IPsec set two IP address on 'left' options. Tunnel hints are always built on the first IP, but are actually built on the second IP HOT 5
- AndroidTV / FireTV App Problems HOT 1
- Segmentation fault in x509_ocsp_response.c:896 HOT 5
- Maybe add support for SHA2_512 in pubkey_authenticator.c ? HOT 2
- no NDK aarch64-linux-android-gcc on $PATH at (eval 10) line 142. HOT 3
- Add ssl=on parameter to mysql plugin. HOT 6
- FORTIFY: pthread_mutex_lock called on a destroyed mutex HOT 1
- charon-systemd Preemptively Exiting on Kernel alg Debugging Messages HOT 1
- segfault when compiled with leak-detective enabled and systemd >=254 HOT 3
- potential automatic mangle rules issues w.r.t. mark_in and mark_out settings HOT 3
- StrongSwan 6 beta 5 | Failed to generate a common proposal even though there is an acceptable choice HOT 3
- StrongSwan 6 Beta 5 integration with liboqs 0.9.1 | Getting error "negotiated key exchange method KYBER_L3 not supported" HOT 2
- Allow comparing connection/child configuration with reported status HOT 1
- Restart router A. The process is successfully started and the configuration parameters are correct. However, the connection to IPsec server B fails. HOT 1
- Incomplete logging of log messages containing newlines when using `swanctl --initiate --loglevel 3/4` HOT 1
- Support systemd socket activation for charon HOT 3
- swanctl listing wrong data HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from strongswan.