1
0
Fork 0
mirror of synced 2024-11-17 06:25:36 -05:00
ovpn-admin/stop.d/secondary_ip_route.sh

6 lines
200 B
Bash
Raw Normal View History

2024-01-01 12:14:00 -05:00
#!/usr/bin/env bash
set -ex
default_iface=$(ip route | grep default | awk '{print $5}')
iptables -t nat -I POSTROUTING -s "$OVPN_NET_SUBNET" -o "$default_iface" -j SNAT --to-source "$OVPN_PUBLIC_IP"