I
I
Igor Petrov2016-08-25 02:19:21
linux
Igor Petrov, 2016-08-25 02:19:21

Why does PPTP routing work?

Good day, I ran into a PPTP problem . I raised a
PPTP server, and I'm trying to connect with Win, everything is fine, the Internet is working, and I can also access a dedicated IP via RDP, nothing is buggy.
As soon as I set up a PPTP client on Linux, that's it, trouble.
My client settings are:
persist
maxfail 0
debug
lock
require-chap
noauth
nobsdcomp
nodeflate
nodetach
noproxyarp
mtu 1400
name testvpn
#nodefaultroute
defaultroute
replacedefaultroute
remotename PPTP
pty "pptp 104.104.104.1 --nolaunchpppd"
With the replacedefaultroute option, access to the direct IP is lost and the dedicated IP can be hard to get to. If you turn off software routing, pptp rises, but you need to make sure that the client goes to the Internet via PPTP, and can also remotely connect to a dedicated IP.
Here is the raised pptp
[email protected]:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default old.zk-1.sbg.sp 0.0.0.0 UG 0 0 0 eth0
10.84.1.1 * 255.255.255.255 UH 0 0 0 ppp0
old.zk-1.sbg.sp * 255.255.255.255 UH 0 0 0 eth0
104.104.104.1 old.zk-1.sbg.sp 255.255.255.255 UGH 0 0 0 eth0
Such machinations do not lead to anything, only everything is buggy:
ip route del default
ip route add default ppp0
Please tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Pilipchuk, 2016-08-25
@SLIDERWEB

The problem is in routing if the server is configured correctly and there are no problems with encryption.
When raising PPTP, it is necessary to register the necessary routes on the client.
PPTP does not inject routes to clients.
I am little aware of how Windows works with VPN there, since there is a lot of "magic" there, but in nix everything is solved by adding the desired route.
I do this (before the famous BT tracker)

#!/bin/sh
# обозначаем возможные переменные для проверок
ifname=$1        # имя интерфейса pppd (e.g. ppp0)
ttyname=$2       # Имя tty-устройства 
speed=$3         # скорость tty-устройства
localip=$4       # локальный IP интерфейса
remoteip=$5      # IP-адрес удаленного "конца" туннеля
ipparam=$6       # текущий IP address до подключения к VPN

#192.168.0.1 - адрес Вашего VPN-шлюза

case "$remoteip" in
    192.168.0.1)
        /sbin/route add -net 195.82.146.0/23 -interface $ifname
        ;;
esac
exit 0;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question