LINUX.ORG.RU

OpenWRT и PPTP

 


0

1

Вторые сутки пытаюсь настроить pptp подключение к провайдеру. По умолчанию в openwrt не оказалось пакета pptp-vpn. Пришлось подключить роутер к компьютеру-шлюзу, чтобы автоматом скачать и установить этот пакет. Хорошо хот в веб-интерфейсе есть минимум удобства чтобы устанавливать пакеты. Пакет успешно установился:

opkg list:
ppp - 2.4.7-6
ppp-mod-pppoe - 2.4.7-6
ppp-mod-pptp - 2.4.7-6

Настраиваю и подключаю pptp:

root@OpenWrt:~# ping 10.1.0.10
PING 10.1.0.10 (10.1.0.10): 56 data bytes
64 bytes from 10.1.0.10: seq=0 ttl=63 time=0.523 ms
64 bytes from 10.1.0.10: seq=1 ttl=63 time=0.571 ms
^C

[img]http://imagizer.imageshack.com/img921/3020/fCKOy0.png[/img]

ifconfig -a,  просто ifconfig не показывает pptp-vpn
pptp-vpn  Link encap:Point-to-Point Protocol  
		  POINTOPOINT NOARP MULTICAST  MTU:1500  Metric:1
		  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
		  TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
		  collisions:0 txqueuelen:3 
		  RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
route -n
Kernel IP routing table
Destination	 Gateway		 Genmask		 Flags Metric Ref	Use Iface
0.0.0.0		 10.5.4.1		0.0.0.0		 UG	0	  0		0 br-wan
10.1.0.10	   10.5.4.1		255.255.255.255 UGH   0	  0		0 br-wan
10.5.4.0		0.0.0.0		 255.255.255.0   U	 0	  0		0 br-wan
10.5.4.1		0.0.0.0		 255.255.255.255 UH	0	  0		0 br-wan
192.168.1.0	 0.0.0.0		 255.255.255.0   U	 0	  0		0 br-lan

logread

Wed Sep  9 05:43:58 2015 daemon.notice pppd[2132]: Connection terminated.
Wed Sep  9 05:43:58 2015 daemon.notice pppd[2132]: Modem hangup
Wed Sep  9 05:43:58 2015 daemon.info pppd[2132]: Exit.
Wed Sep  9 05:43:58 2015 daemon.notice netifd: Interface 'vpn' is now down
Wed Sep  9 05:43:58 2015 daemon.notice netifd: Interface 'vpn' is setting up now
Wed Sep  9 05:43:58 2015 daemon.info pppd[2231]: Plugin pptp.so loaded.
Wed Sep  9 05:43:58 2015 daemon.info pppd[2231]: PPTP plugin version 1.00
Wed Sep  9 05:43:58 2015 daemon.notice pppd[2231]: pppd 2.4.7 started by root, uid 0
Wed Sep  9 05:43:59 2015 daemon.info pppd[2231]: Using interface pptp-vpn
Wed Sep  9 05:43:59 2015 daemon.notice pppd&#91;2231]: Connect: pptp-vpn <--> pptp (10.1.0.10)
Wed Sep  9 05:43:59 2015 kern.info kernel: &#91;  369.820000] pptp-vpn: renamed from ppp0
Wed Sep  9 05:44:24 2015 daemon.info pppd&#91;2231]: Terminating on signal 15
Wed Sep  9 05:44:29 2015 daemon.notice netifd: Interface 'vpn' is now down
Wed Sep  9 05:44:29 2015 daemon.notice netifd: Interface 'vpn' is setting up now
Wed Sep  9 05:44:29 2015 daemon.info pppd&#91;2420]: Plugin pptp.so loaded.
Wed Sep  9 05:44:29 2015 daemon.info pppd&#91;2420]: PPTP plugin version 1.00
Wed Sep  9 05:44:29 2015 daemon.notice pppd&#91;2420]: pppd 2.4.7 started by root, uid 0
Wed Sep  9 05:44:31 2015 daemon.info pppd&#91;2420]: Using interface pptp-vpn
Wed Sep  9 05:44:31 2015 kern.info kernel: &#91;  401.360000] pptp-vpn: renamed from ppp0
Wed Sep  9 05:44:31 2015 daemon.notice pppd&#91;2420]: Connect: pptp-vpn <--> pptp (10.1.0.10)

На компьютере подключаюсь к этому провайдеру без файлов chap-secrets, pap-secrets и без файлов options.pptp и options. cat /etc/ppp/peers/provider

remotename diava
linkname diava
ipparam diava
pty "pptp 10.1.0.10 --nolaunchpppd "
user "*****"
password  *****
usepeerdns
refuse-eap
noauth
persist
maxfail 0
holdoff 10
lcp-echo-interval 10
После чего ввожу
route del default
route add default dev ppp0



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

А пакеты ″kmod-mppe″ и ″kmod-crypto″ установлены?

Попробуйте добавить опцию ″debug″ в файл /etc/ppp/options.pptp и посмотреть, что будет в логе.

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

Установлены opkg list

kmod-cfg80211 - 3.18.20+2015-03-09-3
kmod-crypto-aead - 3.18.20-1
kmod-crypto-aes - 3.18.20-1
kmod-crypto-arc4 - 3.18.20-1
kmod-crypto-core - 3.18.20-1
kmod-crypto-ecb - 3.18.20-1
kmod-crypto-hash - 3.18.20-1
kmod-crypto-manager - 3.18.20-1
kmod-crypto-pcompress - 3.18.20-1
kmod-crypto-sha1 - 3.18.20-1
kmod-gpio-button-hotplug - 3.18.20-1
kmod-gre - 3.18.20-1
kmod-ip6tables - 3.18.20-1
kmod-ipt-conntrack - 3.18.20-1
kmod-ipt-core - 3.18.20-1
kmod-ipt-nat - 3.18.20-1
kmod-iptunnel - 3.18.20-1
kmod-ipv6 - 3.18.20-1
kmod-ledtrig-usbdev - 3.18.20-1
kmod-lib-crc-ccitt - 3.18.20-1
kmod-mac80211 - 3.18.20+2015-03-09-3
kmod-mppe - 3.18.20-1
kmod-nf-conntrack - 3.18.20-1
kmod-nf-conntrack6 - 3.18.20-1
kmod-nf-ipt - 3.18.20-1
kmod-nf-ipt6 - 3.18.20-1
kmod-nf-nat - 3.18.20-1
kmod-nf-nathelper - 3.18.20-1
kmod-nls-base - 3.18.20-1
kmod-ppp - 3.18.20-1
kmod-pppoe - 3.18.20-1
kmod-pppox - 3.18.20-1
kmod-pptp - 3.18.20-1

logread

Wed Sep  9 20:29:47 2015 daemon.debug pppd[15093]: Script pptp-vpn 10.1.0.10 --nolaunchpppd  finished (pid 16833), status = 0x7f
Wed Sep  9 20:29:49 2015 daemon.debug pppd[16778]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x7104d886>]
Wed Sep  9 20:29:52 2015 daemon.debug pppd[16778]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x7104d886>]
Wed Sep  9 20:29:55 2015 daemon.debug pppd[16778]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x7104d886>]
Wed Sep  9 20:29:57 2015 daemon.debug pppd[15093]: using channel 5671
Wed Sep  9 20:29:57 2015 daemon.info pppd[15093]: Using interface ppp1
Wed Sep  9 20:29:57 2015 daemon.notice pppd[15093]: Connect: ppp1 <--> /dev/pts/2
Wed Sep  9 20:29:57 2015 daemon.notice pppd[15093]: Modem hangup
Wed Sep  9 20:29:57 2015 daemon.notice pppd[15093]: Connection terminated

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

А пакет resolveip установлен? Он как бы не особо нужен, но из-за него может не срабатывать скрипт.

И, судя по тому, что есть только ″send LCP″, а ответов нет, GRE тунель не устанавливается. Проверьте, что firewall у вас разрешено все протоколы для 10.1.0.10.

mky ★★★★★
()
Последнее исправление: mky (всего исправлений: 1)
Ответ на: комментарий от mky

resolveip установлен:

root@OpenWrt:~# res TAB
reset      resolveip

Все правила безопасности вроде имеют ACCEPT:

root@OpenWrt:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
delegate_input  all  --  anywhere             anywhere            

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
delegate_forward  all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
delegate_output  all  --  anywhere             anywhere            

Chain delegate_forward (1 references)
target     prot opt source               destination         
forwarding_rule  all  --  anywhere             anywhere             /* user chain for forwarding */
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
zone_lan_forward  all  --  anywhere             anywhere            
zone_wan_forward  all  --  anywhere             anywhere            
zone_wan_forward  all  --  anywhere             anywhere            
zone_wan_forward  all  --  anywhere             anywhere            
reject     all  --  anywhere             anywhere            

Chain delegate_input (1 references)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
input_rule  all  --  anywhere             anywhere             /* user chain for input */
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
syn_flood  tcp  --  anywhere             anywhere             tcp flags:FIN,SYN,RST,ACK/SYN
zone_lan_input  all  --  anywhere             anywhere            
zone_wan_input  all  --  anywhere             anywhere            
zone_wan_input  all  --  anywhere             anywhere            
zone_wan_input  all  --  anywhere             anywhere            

Chain delegate_output (1 references)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
output_rule  all  --  anywhere             anywhere             /* user chain for output */
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
zone_lan_output  all  --  anywhere             anywhere            
zone_wan_output  all  --  anywhere             anywhere            
zone_wan_output  all  --  anywhere             anywhere            
zone_wan_output  all  --  anywhere             anywhere            

Chain forwarding_lan_rule (1 references)
target     prot opt source               destination         

Chain forwarding_rule (1 references)
target     prot opt source               destination         

Chain forwarding_wan_rule (1 references)
target     prot opt source               destination         

Chain input_lan_rule (1 references)
target     prot opt source               destination         

Chain input_rule (1 references)
target     prot opt source               destination         

Chain input_wan_rule (1 references)
target     prot opt source               destination         

Chain output_lan_rule (1 references)
target     prot opt source               destination         

Chain output_rule (1 references)
target     prot opt source               destination         

Chain output_wan_rule (1 references)
target     prot opt source               destination         

Chain reject (7 references)
target     prot opt source               destination         
REJECT     tcp  --  anywhere             anywhere             reject-with tcp-reset
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable

Chain syn_flood (1 references)
target     prot opt source               destination         
RETURN     tcp  --  anywhere             anywhere             tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50
DROP       all  --  anywhere             anywhere            

Chain zone_lan_dest_ACCEPT (4 references)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            

Chain zone_lan_forward (1 references)
target     prot opt source               destination         
forwarding_lan_rule  all  --  anywhere             anywhere             /* user chain for forwarding */
zone_wan_dest_ACCEPT  all  --  anywhere             anywhere             /* forwarding lan -> wan */
ACCEPT     all  --  anywhere             anywhere             ctstate DNAT /* Accept port forwards */
zone_lan_dest_ACCEPT  all  --  anywhere             anywhere            

Chain zone_lan_input (1 references)
target     prot opt source               destination         
input_lan_rule  all  --  anywhere             anywhere             /* user chain for input */
ACCEPT     all  --  anywhere             anywhere             ctstate DNAT /* Accept port redirections */
zone_lan_src_ACCEPT  all  --  anywhere             anywhere            

Chain zone_lan_output (1 references)
target     prot opt source               destination         
output_lan_rule  all  --  anywhere             anywhere             /* user chain for output */
zone_lan_dest_ACCEPT  all  --  anywhere             anywhere            

Chain zone_lan_src_ACCEPT (1 references)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            

Chain zone_wan_dest_ACCEPT (2 references)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            

Chain zone_wan_dest_REJECT (1 references)
target     prot opt source               destination         
reject     all  --  anywhere             anywhere            
reject     all  --  anywhere             anywhere            
reject     all  --  anywhere             anywhere            

Chain zone_wan_forward (3 references)
target     prot opt source               destination         
forwarding_wan_rule  all  --  anywhere             anywhere             /* user chain for forwarding */
zone_lan_dest_ACCEPT  esp  --  anywhere             anywhere             /* @rule[7] */
zone_lan_dest_ACCEPT  udp  --  anywhere             anywhere             udp dpt:isakmp /* @rule[8] */
ACCEPT     all  --  anywhere             anywhere             ctstate DNAT /* Accept port forwards */
zone_wan_dest_REJECT  all  --  anywhere             anywhere            

Chain zone_wan_input (3 references)
target     prot opt source               destination         
input_wan_rule  all  --  anywhere             anywhere             /* user chain for input */
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc /* Allow-DHCP-Renew */
ACCEPT     icmp --  anywhere             anywhere             icmp echo-request /* Allow-Ping */
ACCEPT     igmp --  anywhere             anywhere             /* Allow-IGMP */
ACCEPT     all  --  anywhere             anywhere             ctstate DNAT /* Accept port redirections */
zone_wan_src_REJECT  all  --  anywhere             anywhere            

Chain zone_wan_output (3 references)
target     prot opt source               destination         
output_wan_rule  all  --  anywhere             anywhere             /* user chain for output */
zone_wan_dest_ACCEPT  all  --  anywhere             anywhere            

Chain zone_wan_src_REJECT (1 references)
target     prot opt source               destination         
reject     all  --  anywhere             anywhere            
reject     all  --  anywhere             anywhere            
reject     all  --  anywhere             anywhere            
root@OpenWrt:~# 
Я даже установил ACCEPT на все цепочки: iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT

Но это не помогает

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

как-то там hash (in tag)

И, ещё стоит попробовать туда-сюда попереставлять в пппо-шном .1 , .0 \Несколько переподключений, дОлжным образом должно законнектится..

anonymous
()
Ответ на: комментарий от UriyZenkov

разжёвываю до простейшего:

В заголовке, просто шутка юмора «хештэг», не знакомое, , ну никак?? А суть-про нолик и единицу это как раз про программный адрес, там нет PPPoE, ?

anonymous
()
Ответ на: комментарий от UriyZenkov

Я плохо знаю openwrt, поэтому в таком виде правила мне бесполезны — не указаны интерфейсы. Покажите, либо ″iptables -L -n -v -x″, либо, что лучше, ″iptables-save -c″.

И загружен ли модуль nf_conntrack_pptp (в выводе lsmod), чтобы понять, будет ли срабатывать ″state RELATED″. Если нет, попробуйте его загрузить через ″modprobe″.

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

kmod-nf-nathelper-extra

Всё решилось установкой пакета kmod-nf-nathelper-extra. Большое спасибо !!! Я три дня мучился !!!

UriyZenkov
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.