Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
docker: ipsec vpn server + mitmproxy
version: "3"
services:
vpn:
image: hwdsl2/ipsec-vpn-server
env_file:
- ./vpn.env
ports:
- "500:500/udp"
- "4500:4500/udp"
privileged: true
hostname: ipsec-vpn-server
container_name: ipsec-vpn-server
volumes:
- /lib/modules:/lib/modules:ro
command: >
bash -c '
HOST=$$(host -4 mitmproxy | head -1 | awk "{ print \$$4 }") &&
echo "HOST: $$HOST" &&
iptables -t nat -A PREROUTING -i eth+ -p tcp --destination-port 80 -j DNAT --to-destination $$HOST:8080 &&
iptables -t nat -A PREROUTING -i eth+ -p tcp --destination-port 443 -j DNAT --to-destination $$HOST:8080 &&
/opt/src/run.sh
'
mitmproxy:
image: mitmproxy/mitmproxy
ports:
- "8080:8080/tcp"
hostname: mitmproxy
container_name: mitmproxy
command: mitmdump -T --host
# Define your own values for these variables
# - DO NOT put "" or '' around values, or add space around =
# - DO NOT use these special characters within values: \ " '
VPN_IPSEC_PSK=foobar
VPN_USER=foo
VPN_PASSWORD=bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.