LINUX.ORG.RU

PPTP из локальной сети. IPTABLES.

 ,


0

1

Добрый день Подскажите, как побороть, из локальной сети не могу подключится к VPN PPTP серверу который находится в другом месте.

# Generated by iptables-save v1.6.0 on Mon Sep 30 23:50:13 2019
*mangle
:PREROUTING ACCEPT [4899905:5488213642]
:INPUT ACCEPT [2121079:3031077122]
:FORWARD ACCEPT [2776542:2456460297]
:OUTPUT ACCEPT [1451601:85050313]
:POSTROUTING ACCEPT [4228143:2541510610]
-A FORWARD -o ppp0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:65495 -j TCPMSS --clamp-mss-to-pmtu
COMMIT
# Completed on Mon Sep 30 23:50:13 2019
# Generated by iptables-save v1.6.0 on Mon Sep 30 23:50:13 2019
*nat
:PREROUTING ACCEPT [42:3044]
:INPUT ACCEPT [14:1079]
:OUTPUT ACCEPT [3:221]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o ppp+ -j MASQUERADE
COMMIT
# Completed on Mon Sep 30 23:50:13 2019
# Generated by iptables-save v1.6.0 on Mon Sep 30 23:50:13 2019
*filter
:INPUT ACCEPT [11:3834]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [69:9064]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i ppp+ -j ACCEPT
-A INPUT -p tcp -m tcp --dport 1723 -j ACCEPT
-A INPUT -p gre -j ACCEPT
-A FORWARD -i ppp+ -o ppp+ -j ACCEPT
-A FORWARD -j ACCEPT
-A OUTPUT -o ppp+ -j ACCEPT
-A OUTPUT -p gre -j ACCEPT
COMMIT
# Completed on Mon Sep 30 23:50:13 2019

23:56:25.513179 IP 233.82.PPPoE.fregat.ua.45700 > xxx.xxx.xxx.xxx: Flags [S], seq 3863674686, win 29200, options [mss 1452,sackOK,TS val 3677442620 ecr 0,nop,wscale 7], length 0
23:56:25.514018 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua.45700: Flags [S.], seq 91726336, ack 3863674687, win 14280, options [mss 1440,sackOK,TS val 1180006 ecr 3677442620,nop,wscale 3], length 0
23:56:25.518400 IP 233.82.PPPoE.fregat.ua.45700 > xxx.xxx.xxx.xxx: Flags [.], ack 1, win 229, options [nop,nop,TS val 3677442624 ecr 1180006], length 0
23:56:25.518980 IP 233.82.PPPoE.fregat.ua.45700 > xxx.xxx.xxx.xxx: Flags [P.], seq 1:157, ack 1, win 229, options [nop,nop,TS val 3677442624 ecr 1180006], length 156: pptp CTRL_MSGTYPE=SCCRQ PROTO_VER(1.0) FRAME_CAP(AS) BEARER_CAP(DA) MAX_CHAN(65535) FIRM_REV(1) HOSTNAME(local) VENDOR(cananian)
23:56:25.519781 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua.45700: Flags [.], ack 157, win 1919, options [nop,nop,TS val 1180007 ecr 3677442624], length 0
23:56:25.521458 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua.45700: Flags [P.], seq 1:157, ack 157, win 1919, options [nop,nop,TS val 1180007 ecr 3677442624], length 156: pptp CTRL_MSGTYPE=SCCRP PROTO_VER(1.0) RESULT_CODE(1) ERR_CODE(0) FRAME_CAP(S) BEARER_CAP() MAX_CHAN(0) FIRM_REV(1) HOSTNAME(MikroTik) VENDOR(MikroTik)
23:56:25.529323 IP 233.82.PPPoE.fregat.ua.45700 > xxx.xxx.xxx.xxx: Flags [.], ack 157, win 237, options [nop,nop,TS val 3677442635 ecr 1180007], length 0
23:56:26.517852 IP 233.82.PPPoE.fregat.ua.45700 > xxx.xxx.xxx.xxx: Flags [P.], seq 157:325, ack 157, win 237, options [nop,nop,TS val 3677443625 ecr 1180007], length 168: pptp CTRL_MSGTYPE=OCRQ CALL_ID(33460) CALL_SER_NUM(0) MIN_BPS(2400) MAX_BPS(10000000) BEARER_TYPE(Any) FRAME_TYPE(E) RECV_WIN(3) PROC_DELAY(0) PHONE_NO_LEN(0) PHONE_NO() SUB_ADDR()
23:56:26.519382 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua.45700: Flags [P.], seq 157:189, ack 325, win 2053, options [nop,nop,TS val 1180107 ecr 3677443625], length 32: pptp CTRL_MSGTYPE=OCRP CALL_ID(16) PEER_CALL_ID(33460) RESULT_CODE(1) ERR_CODE(0) CAUSE_CODE(0) CONN_SPEED(100000) RECV_WIN(100) PROC_DELAY(0) PHY_CHAN_ID(0)
23:56:26.520811 IP 233.82.PPPoE.fregat.ua.45700 > xxx.xxx.xxx.xxx: Flags [.], ack 189, win 237, options [nop,nop,TS val 3677443628 ecr 1180107], length 0
23:56:26.521374 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 1, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:26.522476 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 1, ack 1, length 39: LCP, Conf-Request (0x01), id 1, length 21
23:56:26.522686 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 2, ack 1, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:27.534097 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 3, ack 1, length 39: LCP, Conf-Request (0x01), id 2, length 21
23:56:29.115886 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 4, ack 1, length 39: LCP, Conf-Request (0x01), id 3, length 21
23:56:29.525868 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 2, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:29.527026 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 5, ack 2, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:31.159066 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 6, ack 2, length 39: LCP, Conf-Request (0x01), id 4, length 21
23:56:32.512611 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 3, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:32.513654 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 7, ack 3, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:34.215789 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 8, ack 3, length 39: LCP, Conf-Request (0x01), id 5, length 21
23:56:35.521959 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 4, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:35.523054 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 9, ack 4, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:38.519547 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 5, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:38.520676 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 10, ack 5, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:38.751233 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 11, ack 5, length 39: LCP, Conf-Request (0x01), id 6, length 21
23:56:41.523676 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 6, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:41.524722 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 12, ack 6, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:44.529746 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 7, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:44.530793 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 13, ack 7, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:45.492165 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 14, ack 7, length 39: LCP, Conf-Request (0x01), id 7, length 21
23:56:47.525199 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 8, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:47.526390 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 15, ack 8, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:50.558649 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 9, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:50.559676 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 16, ack 9, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:53.536624 IP 233.82.PPPoE.fregat.ua > xxx.xxx.xxx.xxx: GREv1, call 16, seq 10, length 36: LCP, Conf-Request (0x01), id 1, length 22
23:56:53.537743 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 17, ack 10, length 34: LCP, Conf-Reject (0x04), id 1, length 16
23:56:56.190911 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua: GREv1, call 33460, seq 18, ack 10, length 39: LCP, Conf-Request (0x01), id 8, length 21
23:56:56.566375 IP 233.82.PPPoE.fregat.ua.45700 > xxx.xxx.xxx.xxx: Flags [P.], seq 325:341, ack 189, win 237, options [nop,nop,TS val 3677473658 ecr 1180107], length 16: pptp CTRL_MSGTYPE=CCRQ CALL_ID(33460)
23:56:56.567396 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua.45700: Flags [F.], seq 189, ack 341, win 2053, options [nop,nop,TS val 1183112 ecr 3677473658], length 0
23:56:56.638968 IP 233.82.PPPoE.fregat.ua.45700 > xxx.xxx.xxx.xxx: Flags [F.], seq 341, ack 189, win 237, options [nop,nop,TS val 3677473658 ecr 1180107], length 0
23:56:56.639523 IP 233.82.PPPoE.fregat.ua.45700 > xxx.xxx.xxx.xxx: Flags [.], ack 190, win 237, options [nop,nop,TS val 3677473688 ecr 1183112], length 0
23:56:56.639696 IP xxx.xxx.xxx.xxx > 233.82.PPPoE.fregat.ua.45700: Flags [.], ack 342, win 2053, options [nop,nop,TS val 1183119 ecr 3677473658], length 0


Последнее исправление: darksmoke (всего исправлений: 2)

Обязательно использовать этого франкенштейна? :) есть куда более современные и безопасные протоколы для VPN... OpenVPN хотя бы.

skyman ★★★
()

1. iptables-save и tcpdump это с каких хостов? tcpdump вроде как с клиента, откуда пытаетесь поднять. А iptables откуда?

2. Какой смысл в правилах -j ACCEPT для filter, если DROP нету и по умолчанию все ACCEPT???

3. Про pptp skyman уже сказал. Но если так надо, то логи pptp клиента в студию. И вывод

$ ip a
$ ip ro
IP свой внешний затрите, если iptables-save - это на клиенте и на нем же PPPOE на провайдера;)

На данном этапе у вас может быть проблема с маршрутом до VPN сервера - он должен быть прописан отдельно, если потом ваш pptp станет маршрутом по умолчанию.

И конфиг pptp клиента тоже покажите.

Ну и до кучи с микротика, к которому подключаетесь (если есть к нему доступ):

/interface pptp-server export
/ppp export
(пароли естественно затрите) Можно и логи на сервере посмотреть в момент подключения (опять же если есть доступ).

На этом этапе могу быть не соответствия конфигов и скорее всего по логам будет видно.

samson ★★
()

И pptp сервер точно настроен/работает и пускает извне?

samson ★★
()
Ответ на: комментарий от samson

1. и tcpdump и iptables-save все с шлюза.

с шлюза

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 90:e6:ba:d6:dd:52 brd ff:ff:ff:ff:ff:ff
3: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:04:75:fb:57:45 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.250/24 brd 192.168.1.255 scope global enp5s0
       valid_lft forever preferred_lft forever
    inet6 fe80::204:75ff:fefb:5745/64 scope link 
       valid_lft forever preferred_lft forever
4: enp5s1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:02:44:a5:68:e3 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::202:44ff:fea5:68e3/64 scope link 
       valid_lft forever preferred_lft forever
5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether f2:c5:b4:d6:d5:97 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::f0c5:b4ff:fed6:d597/64 scope link 
       valid_lft forever preferred_lft forever
72: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN group default qlen 1
    link/gre 0.0.0.0 brd 0.0.0.0
73: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
75: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast state UNKNOWN group default qlen 3
    link/ppp 
    inet 46.98.55.141 peer 212.115.225.252/32 scope global ppp0
       valid_lft forever preferred_lft forever

$ip ro
default dev ppp0 scope link 
192.168.1.0/24 dev enp5s0 proto kernel scope link src 192.168.1.250 
212.115.225.252 dev ppp0 proto kernel scope link src 46.98.55.141

Лог PPTP с клиента

Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 pppd[3914]: pppd 2.4.7 started by root, uid 0
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 pptp[3917]: anon log[main:pptp.c:353]: The synchronous pptp option is NOT activated
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 systemd-udevd[3922]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 pppd[3914]: Using interface ppp0
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 pppd[3914]: Connect: ppp0 <--> /dev/pts/2
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 NetworkManager[937]: <info>  [1569953113.4708] manager: (ppp0): new Ppp device (/org/freedesktop/NetworkManager/Devices/4)
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 NetworkManager[937]: <info>  [1569953113.4802] devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 NetworkManager[937]: <info>  [1569953113.4803] device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 pptp[3931]: anon log[ctrlp_rep:pptp_ctrl.c:259]: Sent control packet type is 1 'Start-Control-Connection-Request'
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 pptp[3931]: anon log[ctrlp_disp:pptp_ctrl.c:781]: Received Start Control Connection Reply
Oct  1 21:05:13 darksmoke-HP-EliteBook-840-G1 pptp[3931]: anon log[ctrlp_disp:pptp_ctrl.c:815]: Client connection established.
Oct  1 21:05:14 darksmoke-HP-EliteBook-840-G1 pptp[3931]: anon log[ctrlp_rep:pptp_ctrl.c:259]: Sent control packet type is 7 'Outgoing-Call-Request'
Oct  1 21:05:14 darksmoke-HP-EliteBook-840-G1 pptp[3931]: anon log[ctrlp_disp:pptp_ctrl.c:900]: Received Outgoing Call Reply.
Oct  1 21:05:14 darksmoke-HP-EliteBook-840-G1 pptp[3931]: anon log[ctrlp_disp:pptp_ctrl.c:939]: Outgoing call established (call ID 21000, peer's call ID 25).
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 pppd[3914]: LCP: timeout sending Config-Requests
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 pppd[3914]: Connection terminated.
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 NetworkManager[937]: <info>  [1569953144.5098] devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 pppd[3914]: Modem hangup
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 pptp[3917]: anon warn[decaps_hdlc:pptp_gre.c:226]: short read (-1): Input/output error
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 pptp[3917]: anon warn[decaps_hdlc:pptp_gre.c:238]: pppd may have shutdown, see pppd log
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 pptp[3931]: anon log[callmgr_main:pptp_callmgr.c:245]: Closing connection (unhandled)
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 pptp[3931]: anon log[ctrlp_rep:pptp_ctrl.c:259]: Sent control packet type is 12 'Call-Clear-Request'
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 pptp[3931]: anon log[call_callback:pptp_callmgr.c:84]: Closing connection (call state)
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 pppd[3914]: Exit.
Oct  1 21:05:44 darksmoke-HP-EliteBook-840-G1 wpa_supplicant[938]: wlo1: WPA: Group rekeying completed with 04:95:e6:97:e6:08 [GTK=CCMP]

Конфиг просто создаю через GUI

darksmoke
() автор топика
Ответ на: комментарий от darksmoke

Нужен лог со включенным pppd debug

попробуйте nf_conntrack модуль подгрузить, если не подгружен

# modprobe nf_conntrack_pptp

еще silent в pppd/options попробуйте

samson ★★
()
Последнее исправление: samson (всего исправлений: 1)
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.