container-openvpn/bin/ovpn_run
Kyle Manna 836b473d20 ovpn: Remove reference to udp/1194
* Remove references to udp/1194.
* Works better with non-standard ports and tcp.
2014-06-30 23:27:00 -07:00

29 lines
561 B
Bash
Executable File

#!/bin/sh
#
# Run the OpenVPN server normally
#
set -ex
mkdir -p /dev/net
if [ ! -c /dev/net/tun ]; then
mknod /dev/net/tun c 10 200
fi
if [ ! -d "$OPENVPN/ccd" ]; then
mkdir -p /etc/openvpn/ccd
fi
# Static subnet
iptables -t nat -A POSTROUTING -s 192.168.254.0/24 -o eth0 -j MASQUERADE
# Dynamic subnet
iptables -t nat -A POSTROUTING -s 192.168.255.0/24 -o eth0 -j MASQUERADE
conf="$OPENVPN/openvpn.conf"
# TODO Remove after we stop caring about backwards compatibility
[ ! -s "$conf" ] && conf="$OPENVPN/udp1194.conf"
openvpn --config "$conf"