PPTP

Einrichten des lokalen Netzes, Verbindung zu anderen Computern und Diensten.
Antworten
Benutzeravatar
LeoLinux
Beiträge: 408
Registriert: 24.11.2005 17:58:47
Wohnort: Frankfurt Am Main

PPTP

Beitrag von LeoLinux » 03.10.2006 00:36:28

Hi Leute,

versuche gerade verzweifelt den pptp client unter meinem debian zum laufen zu kriegen.

die PPTP Verbindung zum Server steht. verbindung mit windows clients auch möglich.
mein problem ist leider das routing.
habe mich an dem source fourge how to orientiert
( http://pptpclient.sourceforge.net/routi ... atic-setup )
und möchte am ende allen traffic durch denn tunnel leiten - All Traffic Through Tunnel. ich komme leider nur nicht mit den script beispielen klar.

Code: Alles auswählen

#!/bin/sh
# pppd ip-up script for all-to-tunnel routing

# name of primary network interface (before tunnel)
PRIMARY=eth0

# address of tunnel server
SERVER=tunnel.example.com

# provided by pppd: string to identify connection aka ipparam option
CONNECTION=$6
if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi

# provided by pppd: interface name
TUNNEL=$1
if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi

# if we are being called as part of the tunnel startup
if [ "${CONNECTION}" = "tunnel" ] ; then

  # direct tunnelled packets to the tunnel server
  route add -host ${SERVER} dev ${PRIMARY}

  # direct all other packets into the tunnel
  route del default ${PRIMARY}
  route add default dev ${TUNNEL}

fi
und zum wieder herstellen des alten zustandes:

Code: Alles auswählen

#!/bin/sh
# pppd ip-down script for all-to-tunnel routing

# name of primary network interface (before tunnel)
PRIMARY=eth0

# provided by pppd: string to identify connection aka ipparam option
CONNECTION=$6
if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi

# provided by pppd: interface name
TUNNEL=$1
if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi

# if we are being called as part of the tunnel shutdown
if [ "${CONNECTION}" = "tunnel" ] ; then

  # direct packets back to the original interface
  route del default ${TUNNEL}
  route add default dev ${PRIMARY}

fi
##################################
und hier benötige ich deine hilfe:

Jetzt würde das abgeändert bei mir ja wiefolgt aussehen?!

Code: Alles auswählen

#!/bin/sh
# pppd ip-up script for all-to-tunnel routing

# name of primary network interface (before tunnel)
PRIMARY=eth0

# address of tunnel server
SERVER=pptp.server.net

# provided by pppd: string to identify connection aka ipparam option
CONNECTION=$6
if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi

# provided by pppd: interface name
TUNNEL=$1
if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi

# if we are being called as part of the tunnel startup
if [ "${CONNECTION}" = "pc1service" ] ; then

  # direct tunnelled packets to the tunnel server
  route add -host ${SERVER} dev ${PRIMARY}

  # direct all other packets into the tunnel
  route del default ${PRIMARY}
  route add default dev ${TUNNEL}

fi
und zum wieder herstellen des alten zustandes:

Code: Alles auswählen

#!/bin/sh
# pppd ip-down script for all-to-tunnel routing

# name of primary network interface (before tunnel)
PRIMARY=eth0

# provided by pppd: string to identify connection aka ipparam option
CONNECTION=$6
if [ "${CONNECTION}" = "" ]; then CONNECTION=${PPP_IPPARAM}; fi

# provided by pppd: interface name
TUNNEL=$1
if [ "${TUNNEL}" = "" ]; then TUNNEL=${PPP_IFACE}; fi

# if we are being called as part of the tunnel shutdown
if [ "${CONNECTION}" = "pc1service" ] ; then

  # direct packets back to the original interface
  route del default ${TUNNEL}
  route add default dev ${PRIMARY}

fi

und hier am rande noch ein paar nebensächliche informationen:

Code: Alles auswählen

root@iBook:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto pc1service
iface pc1service inet ppp
        provider pc1service

root@iBook:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:95:EF:AC:88
          inet addr:10.1.10.92  Bcast:10.1.255.255  Mask:255.255.0.0
          inet6 addr: fe80::20a:95ff:feef:ac88/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1022 errors:0 dropped:0 overruns:0 frame:0
          TX packets:992 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:592184 (578.3 KiB)  TX bytes:184745 (180.4 KiB)
          Interrupt:41 Base address:0x4000

lo        bla blub

ppp0      Link encap:Point-to-Point Protocol
          inet addr:192.168.1.144  P-t-P:192.168.1.8  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1496  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:78 (78.0 b)  TX bytes:72 (72.0 b)


root@iBook:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.8     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
10.1.0.0        0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         10.1.10.1       0.0.0.0         UG    0      0        0 eth0
^^ so siehts aus wenn ich verbunden bin ^^


root@iBook:~# ifdown pc1service

root@iBook:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.1.0.0        0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         10.1.10.1       0.0.0.0         UG    0      0        0 eth0
^^ und so siehts aus wenn ich nicht mehr verbunden bin

root@iBook:~#
p.s. führe ich das script vielleicht falsch aus? (ich habe nicht viel mit scripten am hut ...) ich gebe ganz normal den pfad der script datei hinter den root prompt ...

Code: Alles auswählen

root@iBook:~# ./all-trought-tunnel.sh
root@iBook:~#
was fehlt mir bzw. was habe ich falsch gemacht?
wäre vielleicht jemand so nett und könnte mir das script verbessern oder mir nen tipp geben?

dankeschön ;-)

grüße Leo

Benutzeravatar
LeoLinux
Beiträge: 408
Registriert: 24.11.2005 17:58:47
Wohnort: Frankfurt Am Main

Beitrag von LeoLinux » 21.02.2007 13:43:32

hat denn niemand eine Idee??

MfG,
LeoLinux

Benutzeravatar
chroiss
Beiträge: 332
Registriert: 29.10.2004 09:29:43
Lizenz eigener Beiträge: MIT Lizenz
Wohnort: BREMEN (in Wellington,NZ a.D) (in OLDENBURG a.D.) (in BREMEN a.D.) (in COLOGNE a.D.)

Beitrag von chroiss » 21.02.2007 16:03:58

Das was das Start Script (nachdem der Tunnel aufgebaut worden ist) eigentlich machen sollte ist :

Code: Alles auswählen

route add -host 192.168.1.8 dev ppp0
route del default eth0
route add default dev ppp0
und das was das stop script (nach dem der Tunnel beendet worden ist) machen sollte ist:

Code: Alles auswählen

route del default ppp0
route add default gw 10.1.10.1
Probier es manuell aus ....

Denn die Default Route bleibt bei dir trotzdem noch die alte

gruss chroiss
"The only secure computer is one that's unplugged, locked in a safe, and buried 20 feet under the ground in a secret location... and I'm not even too sure about that one"--Dennis Huges, FBI.

Bill Cosby
Beiträge: 21
Registriert: 22.06.2007 12:03:06

Beitrag von Bill Cosby » 27.06.2007 12:55:24

chroiss hat geschrieben:Probier es manuell aus ....
Ich habe genau das gleiche Problem, und leider funktioniert das manuell nicht bei mir :(
Ich habe die IP "192.168.1.8" natürlich durch die meines VPN-Servers (der auch unter P-t-P in ifconfig angezeigt wird) ausgewechselt.

Wenn ich das GUI Tool von pptp-linux benutzt dann funktioniert das routing, muss ich nur anklicken, Wundere mich schon was hier falsch läuft, kann hier irgendjemand noch helfen?

Antworten