Страница 1 из 1

VPN - помогите настроить.

Добавлено: 14 мар 2006, 10:57
kkk
Конфигурация сети такова: Роутер под мандрейком (Mandriva 2005LE),http://pptpclient.sourceforge.net/ - отсюда установлено/обновлено все до последних версий. За роутером три локальных машины.

при этом с локальной машины из-под WinXP SP1 - все чудесно соединяется и работает. (Провайдер speed-vpn.ukr-inter.net)

при попытке соединения с сервера получается ерунда: соединение с сервером speed-vpn.ukr-inter.net устанавливается, однако на этапе согласования конфигурации speed-vpn забрасывает мой сервер запросами LCP PPP Configuration Request, которые почему-то мой сервер игнорирует, после чего соединение обрывается, и все. Порты проверял, открыты, в опциях все компрессии, шифрования, и т.п. включал и отключал - без эффекта.

Где грабли - понять не могу. :(

Извиняйте, что много, зато подробно :)

вот конфигурации:

роутинг:

Код: Выделить всё

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
speed-vpn.ukr-i (шлюз провайдера) 255.255.255.255 UGH   0      0        0 eth0
(мой внешний IP) *               255.255.255.255 UH    0      0        0 eth0
192.168.0.0     www.server.lan. 255.255.255.0   UG    0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     10     0        0 eth1
85.202.240.0    *               255.255.240.0   U     10     0        0 eth0
default         (шлюз провайдера) 0.0.0.0         UG    10     0        0 eth0
файрволл:

Код: Выделить всё

#!/bin/bash

#Forwarding ON
echo 1 > /proc/sys/net/ipv4/ip_forward 

IPT="/sbin/iptables"

int_ip="192.168.0.1"

ext_if="eth0"
int_if="eth1"

# Clear all rules
$IPT -t filter -F
$IPT -t filter -X
$IPT -t nat -F
$IPT -t nat -X

$IPT -t filter -P INPUT DROP
$IPT -t filter -P FORWARD DROP
$IPT -t filter -P OUTPUT DROP

$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT
$IPT -t nat -P OUTPUT ACCEPT

# localhost 
$IPT -t filter -A INPUT -d 127.0.0.1 -j ACCEPT
$IPT -t filter -A INPUT -s 127.0.0.1 -j ACCEPT
$IPT -t filter -A OUTPUT -d 127.0.0.1 -j ACCEPT
$IPT -t filter -A OUTPUT -s 127.0.0.1 -j ACCEPT

#local network
$IPT -t filter -A INPUT -s 192.168.0.0/24 -j ACCEPT
$IPT -t filter -A INPUT -d 192.168.0.0/24 -j ACCEPT
$IPT -t filter -A OUTPUT -s 192.168.0.0/24 -j ACCEPT
$IPT -t filter -A OUTPUT -d 192.168.0.0/24 -j ACCEPT


# DNS 
$IPT -t filter -A INPUT -p tcp --sport 53 -j ACCEPT
$IPT -t filter -A INPUT -p tcp --dport 53 -j ACCEPT
$IPT -t filter -A INPUT -p udp --sport 53 -j ACCEPT
$IPT -t filter -A INPUT -p udp --dport 53 -j ACCEPT
$IPT -t filter -A OUTPUT -p tcp --sport 53 -j ACCEPT
$IPT -t filter -A OUTPUT -p tcp --dport 53 -j ACCEPT
$IPT -t filter -A OUTPUT -p udp --sport 53 -j ACCEPT
$IPT -t filter -A OUTPUT -p udp --dport 53 -j ACCEPT


#VPN settings
$IPT -t filter -A INPUT -i ppp+ -j ACCEPT
$IPT -t filter -A INPUT -s 195.20.103.2 -m state --state ESTABLISHED --state RELATED -j ACCEPT

$IPT -t filter -A OUTPUT -o ppp+ -j ACCEPT
$IPT -t filter -A OUTPUT -d 195.20.103.2 -j ACCEPT

$IPT -t filter -A FORWARD -s 195.20.103.2 -m state --state ESTABLISHED --state RELATED -j ACCEPT
$IPT -t filter -A FORWARD -d 195.20.103.2 -j ACCEPT

$IPT -t filter -A FORWARD -o ppp+ -j ACCEPT
$IPT -t filter -A FORWARD -i ppp+ -j ACCEPT

$IPT -t filter -A INPUT -i gre+ -j ACCEPT
$IPT -t filter -A OUTPUT -o gre+ -j ACCEPT
$IPT -t filter -A FORWARD -o gre+ -j ACCEPT
$IPT -t filter -A FORWARD -i gre+ -j ACCEPT

# Vhodyashie soedineniya 
$IPT -t filter -A INPUT -p tcp -i $ext_if -m state --state ESTABLISHED --state RELATED -j ACCEPT


#server inetaccess
$IPT -t filter -A OUTPUT -o $ext_if -j ACCEPT
$IPT -t filter -A OUTPUT -o ppp+ -j ACCEPT
$IPT -t filter -A OUTPUT -o gre+ -j ACCEPT


# SSH 
$IPT -t filter -A INPUT -p tcp --dport 22 -j ACCEPT
$IPT -t filter -A OUTPUT -p tcp --sport 22 -j ACCEPT


# Ping 
$IPT -t filter -A INPUT -p icmp -j ACCEPT
$IPT -t filter -A OUTPUT -p icmp -j ACCEPT

#Forwarding
$IPT -t filter -A FORWARD -s 192.168.0.2 -d 192.168.100.1 -j ACCEPT
$IPT -t filter -A FORWARD -d 192.168.100.1 -j REJECT
#kkk
$IPT -t filter -A FORWARD -s 192.168.0.2 -j ACCEPT
$IPT -t filter -A FORWARD -d 192.168.0.2 -j ACCEPT
#eagle
$IPT -t filter -A FORWARD -s 192.168.0.3 -j ACCEPT
$IPT -t filter -A FORWARD -d 192.168.0.3 -j ACCEPT
#alex
$IPT -t filter -A FORWARD -s 192.168.0.4 -j ACCEPT
$IPT -t filter -A FORWARD -d 192.168.0.4 -j ACCEPT

#Masquerade
$IPT -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE
$IPT -t nat -A POSTROUTING -o ppp+ -s 192.168.0.0/24 -j MASQUERADE
$IPT -t nat -A POSTROUTING -o gre+ -s 192.168.0.0/24 -j MASQUERADE
логи при соединении с сервера:

Код: Выделить всё

server pptp[24833]: anon log[main:pptp.c:267]: The synchronous pptp option is NOT activated 
server pptp[24835]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request' 
server pptp[24835]: anon log[ctrlp_disp:pptp_ctrl.c:738]: Received Start Control Connection Reply
server pptp[24835]: anon log[ctrlp_disp:pptp_ctrl.c:772]: Client connection established.
server pptp[24835]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request' 
server pptp[24835]: anon log[ctrlp_disp:pptp_ctrl.c:857]: Received Outgoing Call Reply.
server pptp[24835]: anon log[ctrlp_disp:pptp_ctrl.c:896]: Outgoing call established (call ID 0, peer's call ID 24960). 
server pptp[24835]: anon log[logecho:pptp_ctrl.c:676]: Echo Reply received.
server pptp[24835]: anon log[pptp_read_some:pptp_ctrl.c:543]: read returned zero, peer has closed
server pptp[24835]: anon log[callmgr_main:pptp_callmgr.c:255]: Closing connection (shutdown)
server pptp[24835]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request' 
server pptp[24835]: anon log[pptp_read_some:pptp_ctrl.c:543]: read returned zero, peer has closed
server pptp[24835]: anon log[call_callback:pptp_callmgr.c:78]: Closing connection (call state)

и дампы пакетов при соединении:

удачная сессия, с локальной машины:

Код: Выделить всё

$ext_ip        195.20.103.2          PPTP     Start-Control-Connection-Request
195.20.103.2          $ext_ip        PPTP     Start-Control-Connection-Reply
$ext_ip        195.20.103.2          PPTP     Outgoing-Call-Request
195.20.103.2          $ext_ip        PPTP     Outgoing-Call-Reply

$ext_ip        195.20.103.2          PPTP     Set-Link-Info
$ext_ip        195.20.103.2          PPP LCP  Configuration Request
195.20.103.2          $ext_ip        PPP LCP  Configuration Request
$ext_ip        195.20.103.2          PPP LCP  Configuration Reject
195.20.103.2          $ext_ip        PPP LCP  Identification
195.20.103.2          $ext_ip        PPP LCP  Configuration Request
$ext_ip        195.20.103.2          PPP LCP  Configuration Ack
$ext_ip        195.20.103.2          PPP LCP  Configuration Request
195.20.103.2          $ext_ip        PPP LCP  Configuration Reject
$ext_ip        195.20.103.2          PPP LCP  Configuration Request
195.20.103.2          $ext_ip        PPP LCP  Configuration Nak
$ext_ip        195.20.103.2          PPP LCP  Configuration Request
195.20.103.2          $ext_ip        PPP LCP  Configuration Nak
$ext_ip        195.20.103.2          PPP LCP  Configuration Request
195.20.103.2          $ext_ip        PPP LCP  Configuration Ack
$ext_ip        195.20.103.2          PPTP     Set-Link-Info
$ext_ip        195.20.103.2          PPP LCP  Identification
$ext_ip        195.20.103.2          PPP LCP  Identification
195.20.103.2          $ext_ip        PPP LCP  Echo Request
195.20.103.2          $ext_ip        PPP LCP  Identification
$ext_ip        195.20.103.2          PPP LCP  Echo Reply
195.20.103.2          $ext_ip        PPP CHAP Challenge
$ext_ip        195.20.103.2          PPP CHAP Response
195.20.103.2          $ext_ip        PPP CHAP Success
неудачная, с сервера:

Код: Выделить всё

$ext_ip        195.20.103.2          PPTP     Start-Control-Connection-Request
195.20.103.2          $ext_ip        PPTP     Start-Control-Connection-Reply
$ext_ip        195.20.103.2          PPTP     Outgoing-Call-Request
195.20.103.2          $ext_ip        PPTP     Outgoing-Call-Reply
195.20.103.2          $ext_ip        PPP LCP  Configuration Request
195.20.103.2          $ext_ip        PPP LCP  Configuration Request
195.20.103.2          $ext_ip        PPP LCP  Configuration Request
195.20.103.2          $ext_ip        PPP LCP  Configuration Request

$ext_ip        195.20.103.2          PPTP     Call-Clear-Request

195.20.103.2          $ext_ip        PPTP     Call-Disconnect-Notify
буду очень признателен за помощь.