sean-tek Hi All, Apologies if im being stupid here but I have a really basic setup p2p link between 2 servers in real world they are in 2 seperate subnets at a hosting providers DC. However in my test lab they are a couple of VM's running on virtual box client config dev tun remote 192.168.0.7 port 53 ifconfig 10.8.0.2 10.8.0.1 secret static.key server config dev tun port 53 ifconfig 10.8.0.1 10.8.0.2 secret static.key now the command service openvpn restart works on the server however it fails on the client [root@nfs openvpn]# service openvpn restart Shutting down openvpn: [ OK ] Starting openvpn: [FAILED] if I remove the port definition from the config file it works fine also if I do openvpn --config /etc/openvpn/client.conf its fine and the tunnel comes up any ideas why the init script doesn't work or what I have done wrong?
brendan as root, or with sudo/su run:bash -x /etc/init.d/openvpn startyou might need to adjust for proper path. you likely have something running on port 53 that is being caught by the init script.
sean-tek Definitely nothing on port 53 its a fresh centos 6 minimal install output of that command below [root@nfs ~]# bash -x /etc/init.d/openvpn start + openvpn= + openvpn_locations='/usr/sbin/openvpn /usr/local/sbin/openvpn' + for location in '$openvpn_locations' + '[' -f /usr/sbin/openvpn ']' + openvpn=/usr/sbin/openvpn + for location in '$openvpn_locations' + '[' -f /usr/local/sbin/openvpn ']' + lock=/var/lock/subsys/openvpn + piddir=/var/run/openvpn + work=/etc/openvpn + . /etc/rc.d/init.d/functions ++ TEXTDOMAIN=initscripts ++ umask 022 ++ PATH=/sbin:/usr/sbin:/bin:/usr/bin ++ export PATH ++ '[' -z '' ']' ++ COLUMNS=80 ++ '[' -z '' ']' +++ /sbin/consoletype ++ CONSOLETYPE=pty ++ '[' -f /etc/sysconfig/i18n -a -z '' -a -z '' ']' ++ . /etc/profile.d/lang.sh ++ unset LANGSH_SOURCED ++ '[' -z '' ']' ++ '[' -f /etc/sysconfig/init ']' ++ . /etc/sysconfig/init +++ BOOTUP=color +++ RES_COL=60 +++ MOVE_TO_COL='echo -en \033[60G' +++ SETCOLOR_SUCCESS='echo -en \033[0;32m' +++ SETCOLOR_FAILURE='echo -en \033[0;31m' +++ SETCOLOR_WARNING='echo -en \033[0;33m' +++ SETCOLOR_NORMAL='echo -en \033[0;39m' +++ PROMPT=yes +++ AUTOSWAP=no +++ ACTIVE_CONSOLES='/dev/tty[1-6]' +++ SINGLE=/sbin/sushell ++ '[' pty = serial ']' ++ __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d' + . /etc/sysconfig/network ++ NETWORKING=yes ++ HOSTNAME=nfs + '[' yes = no ']' + '[' -f /usr/sbin/openvpn ']' + case "$1" in + echo -n 'Starting openvpn: ' Starting openvpn: + /sbin/modprobe tun + '[' -f /etc/openvpn/openvpn-startup ']' + '[' '!' -d /var/run/openvpn ']' + '[' -f /var/lock/subsys/openvpn ']' ++ /bin/ls /var/run/openvpn/client.pid + for pidf in '`/bin/ls $piddir/*.pid 2>/dev/null`' + '[' -s /var/run/openvpn/client.pid ']' ++ cat /var/run/openvpn/client.pid + kill 2998 + rm -f /var/run/openvpn/client.pid + rm -f /var/lock/subsys/openvpn + sleep 2 + rm -f '/var/run/openvpn/*.pid' + cd /etc/openvpn + errors=0 + successes=0 ++ /bin/ls client.conf + for c in '`/bin/ls *.conf 2>/dev/null`' + bn=client + '[' -f client.sh ']' + rm -f /var/run/openvpn/client.pid + script_security= ++ grep '^[[:space:]]*script-security[[:space:]]' client.conf + '[' -z '' ']' + script_security='--script-security 2' + /usr/sbin/openvpn --daemon --writepid /var/run/openvpn/client.pid --cd /etc/openvpn --config client.conf --script-security 2 + '[' 0 = 0 ']' + successes=1 + '[' 0 = 1 ']' + success + '[' color '!=' verbose -a -z '' ']' + echo_success + '[' color = color ']' + echo -en '\033[60G' + echo -n '[' [+ '[' color = color ']' + echo -en '\033[0;32m' + echo -n ' OK ' OK + '[' color = color ']' + echo -en '\033[0;39m' + echo -n ']' ]+ echo -ne '\r' + return 0 + return 0 + echo + '[' 1 = 1 ']' + touch /var/lock/subsys/openvpn + exit 0 [root@nfs ~]# ANy ideas?
sean-tek hmm not convinced at all, tried changing the config to what you have above and the tunnel just will not come up as soon as I put it back to how it was it was fine again. dev tun proto udp port 53 ifconfig 10.8.0.2 10.8.0.1 remote x.x.x.x port 53 secret static.key log /var/log/openvpn.log keepalive 5 60 ping-timer-rem persist-tun persist-key