VPNC - Wie reconnect?

Puzzler

Commander
Registriert
Dez. 2007
Beiträge
2.089
Hallo.

Ich benutze vpnc, da ich per DHCP über meine Uni ins Internet gehe.

dazu habe ich laut ANleitung auf meiner Uniseite die vpnc.conf nach /etc/ kopiert.
Nun starte ich im Terminal mit "vpnc-connect".
Soweit so gut.
Jetzt passiert es aber sehr oft, dass die Verbindung abbricht. Und dann kann ich mich erstmal nicht wieder verbinden, weil
vpnc-connect: Error binding to source port. Try '--local-port 0'
Failed to bind to 0.0.0.0:500: Address already in use
ausgegeben wird.

Folgendes steht auch auf der Uniseite.
Mit der aktuellen vpnc-Version (ab 0.5.1) ist es so, dass es sowohl Re-Keying als auch vernuenftigen Disconnect beherrscht. Entsprechend ist kein aufwendiges Script mehr noetig um eine Verbindung am Leben zu erhalten. VPNC merkt selber, wenn es die Verbindung verliert und beendet sich. Es reicht also mit einem Cron-Eintrag zu gucken, ob es noch laeuft und wenn nicht, den Service neuzustarten. Mittels crontab -e fuegt man folgendes als root ein:

*/1 * * * * /usr/local/etc/rc.d/vpnc status || /usr/local/etc/rc.d/vpnc stop; sleep
5; /usr/local/etc/rc.d/vpnc start

Die Pfade zu vpnc sind entsprechend dem Betriebssystem anzupassen.

Hiermit kann ich nicht viel anfangen, da ich nicht weiß, was cron überhaupt ist. :D
Wie ich dann was und wo einfüge ist dank der kurzen Beschreibung leider auch nicht nachvollziehbar.

Die Frage ist nun, was ih genau tun kann, damit ich mich wieder verbinden kann oder damit die Verbindung über einen längeren Zeitraum aufrecht erhalten wird. Sodass sie nicht bei jedem kleinsten Timeout aufgibt.
Diese hat die Leitung nämlich ziemlich oft, dank Überlastung.
 
Zuletzt bearbeitet:
Steht doch alles drauf was du machen musst. Nur /usr/local/etc/rc.d/vpnc musst du anpassen und mit "sehr großzügiger" Info kann man dir auch nicht weiterhelfen.
was cron ist steht unter Wiki, google usw. auch unter --> man cron <-- zu finden.
 
Hier ist der Ordner /usr/local/etc/ leer.
Und im Ordner /etc/ finde ich nur rc0.d bis rc6.d.
Und im Ordner /etc/vpnc/ befindet sich nur example.conf und vpnc.script.
Und die ganzen **** sind korrekt so ja? :D
 
also nochmal: ich weiß deine Distribution nicht, ich weiß auch nicht wie du das installiert hast, ich weiß ausserdem auch nicht ob du nach cron schonmal gesucht hast, in wikipedia ists bestens erklärt.
Deswegen können keine deine Frage beantworten ohne die fehlende Info zu raten.
 
Ubuntu 8.1 hab ich hier drauf. ^^
crontab -e krieg ich auch gestartet. Aber die Ordner verstehe ich nicht.
 
guck mal unter /etc/init.d/ nach vpnc wenn dort gibt dann hast gefunden.
 
In /etc/init.d befindet sich kein Ordner namens vpnc und auch keine Datei.
Welchen vpnc Ordner brauche ich denn? Bzw. was soll sich in dem vpnc Ordner dann befinden? Bestimmte Scripte oder sowas?

Die Dateien, laut dem "Search" sind es "Link to executable" vpnc-connect und vpnc-disconnect sind im Ordner /usr/sbin.
oder sind die nicht von Interesse? :D
Die executable "vpnc" befindet sich dort auch.
 
Zuletzt bearbeitet:
wie hast du dann installiert?
kannst ja auf deine Kiste nach vpnc suchen, ggf. aktualisiere mal die Ubuntu-Datenbank bevor du mit Suchen beginnst.
 
Der Paketmanager sagt jenes:

/.
/usr
/usr/sbin
/usr/sbin/vpnc
/usr/sbin/vpnc-disconnect
/usr/share
/usr/share/vpnc
/usr/share/vpnc/pcf2vpnc
/usr/share/doc
/usr/share/doc/vpnc
/usr/share/doc/vpnc/README.gz
/usr/share/doc/vpnc/TODO.gz
/usr/share/doc/vpnc/README.Debian
/usr/share/doc/vpnc/copyright
/usr/share/doc/vpnc/examples
/usr/share/doc/vpnc/examples/vpnc.conf
/usr/share/doc/vpnc/changelog.Debian.gz
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/vpnc.8.gz
/usr/lib
/usr/lib/vpnc
/usr/lib/vpnc/cisco-decrypt
/var
/var/run
/var/run/vpnc
/etc
/etc/vpnc
/etc/vpnc/example.conf
/etc/vpnc/vpnc-script
/usr/sbin/vpnc-connect
/usr/share/man/man8/vpnc-connect.8.gz
/usr/share/man/man8/vpnc-disconnect.8.gz

Zuerst hatte ich mir irgendwo "DEBIAN_vpnc_0.3.3+SVN20051028-3_amd64.deb" gesaugt.
Dann per Doppelklick installiert.
Danach hat es sich dann automatisch aktualisiert auf die Version 0.5.1, da ich ja erstmal Internet benötigte.
 
was sind die Optionen von /usr/sbin/vpnc? Habe bei mir nicht installiert daher keine Ahnung, wies genau aussieht.
 
Optionen? Was meinst du damit? Ich habe nur den Text aus dem Paketmanager kopiert. Mehr Informationen finde ich dort nicht.
 
z.B.: openvpn
OpenVPN 2.0.9 x86_64-pc-linux-gnu [SSL] [LZO] [EPOLL] built on Sep 22 2007

General Options:
--config file : Read configuration options from file.
--help : Show options.
--version : Show copyright and version information.

Tunnel Options:
--local host : Local host name or ip address.
--remote host [port] : Remote host name or ip address.
...
... usw.

Ist aber jetzt egal, ich weiß halt vpnc nicht. schau mal im Ubuntuforen um, vielleicht gibt's passende Lösung.

Die Uni Seite nimmt doch *buntu als Beispiel? Hast du einfachmal schon so wie es ist probiert?
 
Zuletzt bearbeitet:
Wenn ich "vpnc" ist dies gleichbedeutend wie "vpnc-conncect".
Optionen kann ich wohl nur mit --help sichtbar machen?! :p

Code:
sudo vpnc --help
Usage: vpnc [--version] [--print-config] [--help] [--long-help] [options] [config files]

Options:
  --gateway <ip/hostname>
      IP/name of your IPSec gateway
  conf-variable: IPSec gateway <ip/hostname>

  --id <ASCII string>
      your group name
  conf-variable: IPSec ID <ASCII string>

  (configfile only option) 
      your group password (cleartext)
  conf-variable: IPSec secret <ASCII string>

  --username <ASCII string>
      your username
  conf-variable: Xauth username <ASCII string>

  (configfile only option) 
      your password (cleartext)
  conf-variable: Xauth password <ASCII string>

Use --long-help to see all options

Report bugs to [email]vpnc@unix-ag.uni-kl.de[/email]


Code:
sudo vpnc --long-help
Usage: vpnc [--version] [--print-config] [--help] [--long-help] [options] [config files]

Options:
  --gateway <ip/hostname>
      IP/name of your IPSec gateway
  conf-variable: IPSec gateway <ip/hostname>

  --id <ASCII string>
      your group name
  conf-variable: IPSec ID <ASCII string>

  (configfile only option) 
      your group password (cleartext)
  conf-variable: IPSec secret <ASCII string>

  (configfile only option) 
      your group password (obfuscated)
  conf-variable: IPSec obfuscated secret <hex string>

  --username <ASCII string>
      your username
  conf-variable: Xauth username <ASCII string>

  (configfile only option) 
      your password (cleartext)
  conf-variable: Xauth password <ASCII string>

  (configfile only option) 
      your password (obfuscated)
  conf-variable: Xauth obfuscated password <hex string>

  --domain <ASCII string>
      (NT-) Domain name for authentication
  conf-variable: Domain <ASCII string>

  --xauth-inter 
      enable interactive extended authentication (for challenge response auth)
  conf-variable: Xauth interactive

  --vendor <cisco/netscreen>
      vendor of your IPSec gateway
    Default: cisco
  conf-variable: Vendor <cisco/netscreen>

  --natt-mode <natt/none/force-natt/cisco-udp>
      Which NAT-Traversal Method to use:
       * natt -- NAT-T as defined in RFC3947
       * none -- disable use of any NAT-T method
       * force-natt -- always use NAT-T encapsulation even
                       without presence of a NAT device
                       (useful if the OS captures all ESP traffic)
       * cisco-udp -- Cisco proprietary UDP encapsulation, commonly over Port 10000
      Note: cisco-tcp encapsulation is not yet supported
    Default: natt
  conf-variable: NAT Traversal Mode <natt/none/force-natt/cisco-udp>

  --script <command>
      command is executed using system() to configure the interface,
      routing and so on. Device name, IP, etc. are passed using enviroment
      variables, see README. This script is executed right after ISAKMP is
      done, but before tunneling is enabled. It is called when vpnc
      terminates, too
    Default: /etc/vpnc/vpnc-script
  conf-variable: Script <command>

  --dh <dh1/dh2/dh5>
      name of the IKE DH Group
    Default: dh2
  conf-variable: IKE DH Group <dh1/dh2/dh5>

  --pfs <nopfs/dh1/dh2/dh5/server>
      Diffie-Hellman group to use for PFS
    Default: server
  conf-variable: Perfect Forward Secrecy <nopfs/dh1/dh2/dh5/server>

  --enable-1des 
      enables weak single DES encryption
  conf-variable: Enable Single DES

  --enable-no-encryption 
      enables using no encryption for data traffic (key exchanged must be encrypted)
  conf-variable: Enable no encryption

  --application-version <ASCII string>
      Application Version to report. Note: Default string is generated at runtime.
    Default: Cisco Systems VPN Client 0.5.1:Linux
  conf-variable: Application version <ASCII string>

  --ifname <ASCII string>
      visible name of the TUN/TAP interface
  conf-variable: Interface name <ASCII string>

  --ifmode <tun/tap>
      mode of TUN/TAP interface:
       * tun: virtual point to point interface (default)
       * tap: virtual ethernet interface
    Default: tun
  conf-variable: Interface mode <tun/tap>

  --debug <0/1/2/3/99>
      Show verbose debug messages
       *  0: Do not print debug information.
       *  1: Print minimal debug information.
       *  2: Show statemachine and packet/payload type information.
       *  3: Dump everything exluding authentication data.
       * 99: Dump everything INCLUDING AUTHENTICATION data (e.g. PASSWORDS).
  conf-variable: Debug <0/1/2/3/99>

  --no-detach 
      Don't detach from the console after login
  conf-variable: No Detach

  --pid-file <filename>
      store the pid of background process in <filename>
    Default: /var/run/vpnc/pid
  conf-variable: Pidfile <filename>

  --local-addr <ip/hostname>
      local IP to use for ISAKMP / ESP / ... (0.0.0.0 == automatically assign)
    Default: 0.0.0.0
  conf-variable: Local Addr <ip/hostname>

  --local-port <0-65535>
      local ISAKMP port number to use (0 == use random port)
    Default: 500
  conf-variable: Local Port <0-65535>

  --udp-port <0-65535>
      Local UDP port number to use (0 == use random port).
      This is only relevant if cisco-udp nat-traversal is used.
      This is the _local_ port, the remote udp port is discovered automatically.
      It is especially not the cisco-tcp port.
    Default: 10000
  conf-variable: Cisco UDP Encapsulation Port <0-65535>

  --dpd-idle <0,10-86400>
      Send DPD packet after not receiving anything for <idle> seconds.
      Use 0 to disable DPD completely (both ways).
    Default: 300
  conf-variable: DPD idle timeout (our side) <0,10-86400>

  --non-inter 
      Don't ask anything, exit on missing options
  conf-variable: Noninteractive

  --auth-mode <psk/cert/hybrid>
      Authentication mode:
       * psk:    pre-shared key (default)
       * cert:   server + client certificate (not implemented yet)
       * hybrid: server certificate + xauth (if built with openssl support)
    Default: psk
  conf-variable: IKE Authmode <psk/cert/hybrid>

  --ca-file <filename>
      filename and path to the CA-PEM-File
  conf-variable: CA-File <filename>

  --ca-dir <directory>
      path of the trusted CA-Directory
    Default: /etc/ssl/certs
  conf-variable: CA-Dir <directory>

  --target-network <target network/netmask>
      Target network in dotted decimal or CIDR notation
    Default: 0.0.0.0/0.0.0.0
  conf-variable: IPSEC target network <target network/netmask>

  --dns-update 
      DEPRECATED extension, see README.Debian for details
    Default: Yes
  conf-variable: DNSUpdate

  --target-networks 
      DEPRECATED extension, see README.Debian for details
    Default: 
  conf-variable: Target Networks

Report bugs to vpnc@unix-ag.uni-kl.de


EDIT:

Ich habe m,al etwas recherchiert und bin hier gelandet:

Code:
*/1 * * * * vpnc status || vpnc stop; sleep 5; vpnc start

Mit den spezifischen Pfaden hatte ich sowieso nur error messages bekommen "bad minute".
Jetzt habe ich das oben stehende hinzufügen können, aber wie merke ich nur ob cron zuverlässig und überhaupt arbeitet?! :evillol:
 
Zuletzt bearbeitet:
Zurück
Oben