[GH-ISSUE #398] How to setting ikev2.conf on docker image for support sctp protocol #370

Closed
opened 2026-03-02 08:01:42 +03:00 by kerem · 1 comment
Owner

Originally created by @andy112233445566 on GitHub (Sep 4, 2023).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/398

Checklist

Describe the issue

ENV:

  1. two ubuntu22.04 (5.15.0-76-generic) host link directly
  2. using ikev2 and ikev2.conf only change for server ip: 7.7.7.2
    image

test 1: ping via ipsec success
using ping 5.5.5.2 from ipsec client to ipsec server side, VPN work success, i can check docker container interface eth0:172.17.0.2 forward packet to 5.5.5.2, like below:
image

test 2: sctp via ipsec fail
using lksctp-tools for test, but can not capture packet on docker container interface eth0, only get sctp packet on host interface, like below:
(1). server side:
command: "sctp_darn -H 0 -P 2500 -l" for listen
(2). client side:
command: "sctp_darn -H 0 -P 2600 -h 5.5.5.2 -p 2500 -s"
image

docker ikev2.conf:
image

do you have any suggest for config to support sctp, Thanks.

Originally created by @andy112233445566 on GitHub (Sep 4, 2023). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/398 **Checklist** - [V] I read the [README](https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/README.md) - [V] I read the [Important notes](https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/README.md#important-notes) - [V] I followed instructions to [configure VPN clients](https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/README.md#next-steps) - [V] I checked [IKEv1 troubleshooting](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients.md#ikev1-troubleshooting), [IKEv2 troubleshooting](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/ikev2-howto.md#ikev2-troubleshooting), [enabled logs](https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/docs/advanced-usage.md#enable-libreswan-logs) and checked [VPN status](https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients.md#check-logs-and-vpn-status) - [V] I searched existing [Issues](https://github.com/hwdsl2/docker-ipsec-vpn-server/issues?q=is%3Aissue) - [ ] This bug is about the IPsec VPN server Docker image, and not IPsec VPN itself <!--- If you found a reproducible bug for the IPsec VPN, open a bug report at https://github.com/libreswan/libreswan. Ask VPN-related questions on the [Libreswan](https://lists.libreswan.org/mailman/listinfo/swan) or [strongSwan](https://lists.strongswan.org/mailman/listinfo/users) users mailing list, or search e.g. [Stack Overflow](https://stackoverflow.com/questions/tagged/vpn). ---> **Describe the issue** ENV: 1. two ubuntu22.04 (5.15.0-76-generic) host link directly 2. using ikev2 and ikev2.conf only change for server ip: 7.7.7.2 <img width="358" alt="image" src="https://github.com/hwdsl2/docker-ipsec-vpn-server/assets/140498364/cee709b9-1b72-4d43-838b-a943888739d9"> test 1: ping via ipsec success using ping 5.5.5.2 from ipsec client to ipsec server side, VPN work success, i can check docker container interface eth0:172.17.0.2 forward packet to 5.5.5.2, like below: <img width="586" alt="image" src="https://github.com/hwdsl2/docker-ipsec-vpn-server/assets/140498364/e5483865-d0a3-4cfc-b1ea-c2aa0e943350"> test 2: sctp via ipsec **fail** using lksctp-tools for test, but can not capture packet on docker container interface eth0, only get sctp packet on host interface, like below: (1). server side: command: "sctp_darn -H 0 -P 2500 -l" for listen (2). client side: command: "sctp_darn -H 0 -P 2600 -h 5.5.5.2 -p 2500 -s" ![image](https://github.com/hwdsl2/docker-ipsec-vpn-server/assets/140498364/ff37b79d-5e87-4347-8c9b-21603d389de6) docker ikev2.conf: <img width="407" alt="image" src="https://github.com/hwdsl2/docker-ipsec-vpn-server/assets/140498364/6f201848-ec1f-402f-abc6-9f412b3b66ac"> do you have any suggest for config to support sctp, Thanks.
kerem closed this issue 2026-03-02 08:01:42 +03:00
Author
Owner

@hwdsl2 commented on GitHub (Sep 4, 2023):

@andy112233445566 Hello! Thanks for providing the details in this issue. I am not familiar with SCTP, but it looks like SCTP might have some issues with IPsec VPNs [1]. I did a quick web search and this article [2] might help your use case. More specifically, in order for IPTables in the IPsec VPN container to properly forward SCTP traffic, you'll need to load a kernel module:

modprobe nf_conntrack_proto_sctp

Restart the Docker container after that. Re-connect and check if the issue is resolved.

If loading the kernel module on the Docker host doesn't help, you can try loading it from inside the container.

[1] https://lists.strongswan.org/pipermail/users/2012-September/003618.html
[2] https://serverfault.com/questions/720897/iptables-nat-not-work-for-sctp

<!-- gh-comment-id:1704630073 --> @hwdsl2 commented on GitHub (Sep 4, 2023): @andy112233445566 Hello! Thanks for providing the details in this issue. I am not familiar with SCTP, but it looks like SCTP might have some issues with IPsec VPNs [1]. I did a quick web search and this article [2] might help your use case. More specifically, in order for IPTables in the IPsec VPN container to properly forward SCTP traffic, you'll need to load a kernel module: ``` modprobe nf_conntrack_proto_sctp ``` Restart the Docker container after that. Re-connect and check if the issue is resolved. If loading the kernel module on the Docker host doesn't help, you can try loading it from [inside the container](https://github.com/hwdsl2/docker-ipsec-vpn-server/blob/master/docs/advanced-usage.md#bash-shell-inside-container). [1] https://lists.strongswan.org/pipermail/users/2012-September/003618.html [2] https://serverfault.com/questions/720897/iptables-nat-not-work-for-sctp
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-ipsec-vpn-server#370
No description provided.