Skip to content

Commit

Permalink
Fix ipsec config
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru committed Sep 25, 2024
1 parent bc6e17c commit 9199259
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ipsec/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/usr/bin/env bash

sed -i "s/leftsubnet=0.0.0.0\/0/leftsubnet=10.0.0.0\/8/g" /opt/src/run.sh
sed -i "s/leftsubnet=0.0.0.0\/0/leftsubnet=10.224.0.0\/15/g" /opt/src/run.sh

nohup bash -c '
until ps | grep -q xl2tpd; do sleep 0.1; done
antizapret_ip=$(dig +short antizapret-vpn)
ip route add 10.0.0.0/8 via "$antizapret_ip"
iptables -t nat -A OUTPUT -d 10.0.0.1/32 -j DNAT --to-destination "$antizapret_ip"
iptables -t nat -A PREROUTING -d 10.0.0.1/32 -j DNAT --to-destination "$antizapret_ip"
ip route add 10.224.0.0/15 via "$antizapret_ip"
' &

exec /opt/src/run.sh

0 comments on commit 9199259

Please sign in to comment.