1
0
Fork 0
mirror of synced 2024-11-16 22:25:33 -05:00
ovpn-admin/start.d/secondary_ip_route.sh
2024-01-01 21:14:00 +04:00

5 lines
200 B
Bash

#!/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"