#!/bin/bash

set -Eeuo pipefail

echo "$(date) User ${USERNAME} Connected - Server: ${IP_REAL_LOCAL} VPN IP: ${IP_REMOTE}  Remote IP: ${IP_REAL} Device:${DEVICE}"
echo "Running iptables MASQUERADE for User ${USERNAME} connected with VPN IP ${IP_REMOTE}"
iptables -t nat  -A POSTROUTING -s ${IP_REMOTE}/32 -o eth0 -j MASQUERADE
