Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 92369 - openvpn: check if network is already accessible
Summary: openvpn: check if network is already accessible
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Jan Brinkmann (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-05-12 06:25 UTC by Christian Hesse
Modified: 2005-05-30 06:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
diff for /etc/init.d/openvpn init script (openvpn.diff,790 bytes, patch)
2005-05-19 22:46 UTC, Christian Hesse
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Hesse 2005-05-12 06:25:45 UTC
I have a notebook that should be connected to my VPN all the time. If I am at home my router allready has the connection, so there is no need for my notebook's openvpn to connect. If I connect from outside my local net the notebook should establish an openvpn connection itself. This could be done by a specified host that has to be accessible (for example the host running the openvpn server)...

What do you think?

Reproducible: Always
Steps to Reproduce:
1. Take your notebook an connect to
 a. your local lan
 b. a foreign net
Actual Results:  
There's no connection or openvpn connects twice...

Expected Results:  
The openvpn init script should test if the openvpn server is allready accessible 
and connect itself if it is not.

Portage 2.0.51.21-r1 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.5-
r0, 2.6.11.8+ i686)
=================================================================
System uname: 2.6.11.8+ i686 Intel(R) Pentium(R) M processor 1400MHz
Gentoo Base System version 1.6.11
ccache version 2.4 [disabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.6
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.97
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=pentium-m -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/
share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /
usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-Os -march=pentium-m -pipe"
DISTDIR="/mnt/data/distfiles"
FEATURES="autoconfig confcache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ ftp://sunsite.
informatik.rwth-aachen.de/pub/Linux/gentoo http://linux.rz.ruhr-uni-bochum.de/
download/gentoo-mirror/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ http://
ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.uni-erlangen.de/pub/mirrors/
gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://ftp.
wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/
distributions/gentoo ftp://ftp6.uni-muenster.de/pub/linux/distributions/gentoo 
http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp-stud.fht-
esslingen.de/pub/Mirrors/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/
gentoo/ ftp://ftp.gentoo.mesh-solutions.com/gentoo/"
LANG="en_US"
MAKEOPTS="-j 2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/mnt/data/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage_overlay"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="x86 X a52 aac aalib acpi alsa apache2 audiofile avi berkdb bidi bitmap-
fonts cddb cdparanoia cdr crypt cups curl dga divx4linux dpms dts dv dvb dvd 
dvdread emboss encode extensions fam fame fbcon ffmpeg flac foomaticdb gdbm gif 
glitz gnutls gtk gtk2 hal ieee1394 imagemagick imlib imlib2 ipv6 java javascript 
jpeg jpeg2k kde kdeenablefinal kqemu libcaca libg++ libwww live lzo mad matroska 
mikmod mmx mmx2 mng motif mozsvg mp3 mpeg mysql mythtv ncurses network nls nptl 
nptlonly nvidia odbc ogg oggvorbis opengl pam pcre pdflib perl pic png pthreads 
python qt quicktime rdesktop readline real rtc samba sasl sdl slang smime 
softmmu spell sse sse2 ssl svg tcltk tcpd tga theora threads tiff truetype 
truetype-fonts type1-fonts unicode usb userlocales v4l v4l2 vcd vidix vorbis 
win32codecs wmf xanim xine xml xml2 xmms xv xvid xvmc zeroconf zlib userland_GNU 
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Christian Hesse 2005-05-19 22:46:17 UTC
Created attachment 59346 [details, diff]
diff for /etc/init.d/openvpn init script

I think it could look like this...
Comment 2 Jan Brinkmann (RETIRED) gentoo-dev 2005-05-30 06:21:10 UTC
very good idea, all version in portage except 2.0(-r0) can use this nice feature
now through a file called onlinecheck. 2.0-r1 makes use of the better initscript
instead of the upstream one. to add a check:

echo my.ip.to.check > /etc/openvpn/myconf/onlinecheck
or
echo myhost.org > /etc/openvpn/myconf/onlinecheck

the initscript will try to ping the address given in the first line if the file
exists. when there are problems, i.e. the hostname can't be resolved or the
address can't be pinged the connection starts up. otherwise the initscript tells
that the connection is already up and will be skipped. thanks again!