[GH-ISSUE #6] /etc/ipsec.conf is reverted on restart #5

Closed
opened 2026-03-02 07:10:58 +03:00 by kerem · 2 comments
Owner

Originally created by @kc1212 on GitHub (Jul 24, 2016).
Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/6

Hi, I've been using docker-ipsec-vpn-server with a lot of success, there's only one little hiccup. I'm using Android 6.0, so I followed the step here https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients.md#android to change /etc/ipsec.conf (using docker cp).

However, every time I restart the container or my machine, the ipsec.conf file gets reverted back to its original state, and then I have to make the same changes again. I'm not sure whether this is an expected behaviour. What's a good way to persist my changes?

Originally created by @kc1212 on GitHub (Jul 24, 2016). Original GitHub issue: https://github.com/hwdsl2/docker-ipsec-vpn-server/issues/6 Hi, I've been using `docker-ipsec-vpn-server` with a lot of success, there's only one little hiccup. I'm using Android 6.0, so I followed the step here https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients.md#android to change `/etc/ipsec.conf` (using `docker cp`). However, every time I restart the container or my machine, the `ipsec.conf` file gets reverted back to its original state, and then I have to make the same changes again. I'm not sure whether this is an expected behaviour. What's a good way to persist my changes?
kerem closed this issue 2026-03-02 07:10:58 +03:00
Author
Owner

@hwdsl2 commented on GitHub (Jul 24, 2016):

@kc1212 Hello. Please try the following solution:

First, get a shell inside the container:

docker exec -it ipsec-vpn-server /bin/bash

Then edit /opt/src/run.sh to prevent ipsec.conf from being overwritten at restart:

export TERM=xterm
apt-get update && apt-get install nano
nano /opt/src/run.sh

Comment out these lines:

cat > /etc/ipsec.conf <<EOF
... ...
EOF

When finished, exit the container. Then restart it and check:

docker restart ipsec-vpn-server
docker exec -it ipsec-vpn-server cat /etc/ipsec.conf
<!-- gh-comment-id:234754493 --> @hwdsl2 commented on GitHub (Jul 24, 2016): @kc1212 Hello. Please try the following solution: First, get a shell inside the container: ``` docker exec -it ipsec-vpn-server /bin/bash ``` Then edit `/opt/src/run.sh` to prevent `ipsec.conf` from being overwritten at restart: ``` export TERM=xterm apt-get update && apt-get install nano nano /opt/src/run.sh ``` Comment out these lines: ``` cat > /etc/ipsec.conf <<EOF ... ... EOF ``` When finished, `exit` the container. Then restart it and check: ``` docker restart ipsec-vpn-server docker exec -it ipsec-vpn-server cat /etc/ipsec.conf ```
Author
Owner

@kc1212 commented on GitHub (Jul 24, 2016):

Thanks! That solves my issue.

<!-- gh-comment-id:234754828 --> @kc1212 commented on GitHub (Jul 24, 2016): Thanks! That solves my issue.
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#5
No description provided.