1
0
Fork 0
mirror of synced 2024-05-26 03:51:15 -04:00
ovpn-admin/start.d/secondary_ip_route.sh
2024-01-01 22:33:03 +04:00

6 lines
212 B
Bash

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