port 6194
proto udp
dev tap
up /home/openvpn/up.sh
ca /home/openvpn/conf/server/ca.crt
cert /home/openvpn/conf/server/server.crt
dh /home/openvpn/conf/server/dh2048.pem
key /home/openvpn/conf/server/server.key
server-bridge 192.168.3.38 255.255.255.0 192.168.3.2 192.168.3.5
keepalive 10 120
sndbuf 0
rcvbuf 0
txqueuelen 1000
persist-key
persist-tun
status /home/openvpn/logs/server/openvpn-status.log
log-append /home/openvpn/logs/server/openvpn.log
verb 5
script-security 3
auth-user-pass-verify /home/openvpn/checkpsw.sh via-env
username-as-common-name
#!/bin/bash
#
#
BRIDGE="br0"
/usr/sbin/brctl addif ${BRIDGE} ${1}
/usr/sbin/ifconfig ${1} up
#!/bin/sh
###########################################################
# checkpsw.sh (C) 2004 Mathias Sundman <mathias@openvpn.se>
#
# This script will authenticate OpenVPN users against
# a plain text file. The passfile should simply contain
# one row per user with the username first followed by
# one or more space(s) or tab(s) and then the password.
PASSFILE="/home/openvpn/conf/server/psw-file"
LOG_FILE="/var/log/openvpn-password.log"
TIME_STAMP=`date "+%Y-%m-%d %T"`
###########################################################
if [ ! -r "${PASSFILE}" ]; then
echo "${TIME_STAMP}: Could not open password file \"${PASSFILE}\" for reading." >> ${LOG_FILE}
exit 1
fi
CORRECT_PASSWORD=`awk '!/^;/&&!/^#/&&$1=="'${username}'"{print $2;exit}' ${PASSFILE}`
if [ "${CORRECT_PASSWORD}" = "" ]; then
echo "${TIME_STAMP}: User does not exist: username=\"${username}\", password=\"${password}\"." >> ${LOG_FILE}
exit 1
fi
if [ "${password}" = "${CORRECT_PASSWORD}" ]; then
echo "${TIME_STAMP}: Successful authentication: username=\"${username}\"." >> ${LOG_FILE}
exit 0
fi
echo "${TIME_STAMP}: Incorrect password: username=\"${username}\", password=\"${password}\"." >> ${LOG_FILE}
exit 1
yydsOpenVPN,10.8.31.4
yydsOpenVPN ABCabc123