ovpn-admin/stop.d/secondary_ip_route.sh

6 lines
200 B
Bash
Raw Normal View History

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