Open AEGEGE opened 1 year ago
I'm not quite sure what the question is. Is this a PR? If so could you commit it as a PR so I can look at the diff?
I'm not quite sure what the question is. Is this a PR? If so could you commit it as a PR so I can look at the diff?
Added
It is necessary to modify the code 'if [ "$OVPN_NAT" == "true" ]; then' in the configuration script/opt/configuration/setup_networking.sh to 'if [ "$OVPN_NAT" != "true" ]; then'
`if [ "${OVPN_ROUTES}x" != "x" ] ; then
IFS="," read -r -a route_list <<< "$OVPN_ROUTES"
echo "" >/tmp/routes_config.txt
for this_route in ${route_list[@]} ; do
echo "routes: adding route $this_route to server config" echo "push \"route $this_route\"" >> /tmp/routes_config.txt
if [ "$OVPN_NAT" == "true" ]; then IFS=" " this_net=
echo $this_route | awk '{ print $1 }'
this_cidr=ipcalc -nb $this_route | grep ^Netmask | awk '{ print $NF }'
IFS="," to_masquerade="${this_net}/${this_cidr}" echo "iptables: masquerade from $ovpn_net to $to_masquerade via $this_natdevice" echo -n "Checking for existing iptables rule: " iptables -t nat -C POSTROUTING -s "$ovpn_net" -d "$to_masquerade" -o $this_natdevice -j MASQUERADE 2>&1 || \ iptables -t nat -A POSTROUTING -s "$ovpn_net" -d "$to_masquerade" -o $this_natdevice -j MASQUERADE fidone
IFS=" "
else`