LINUX.ORG.RU
ФорумAdmin

Подключение PPTP в OpenWRT

 ,


0

1

Всем привет, второй день гуглю не могу подключиться к провайдеру по PPTP OpenWRT 23.05.05. Роутер Asus RT-AX53U на заводской прошивке все работало. Сначала делал по инструкции https://openwrt.org/docs/guide-user/services/vpn/pptp/client Потом нашел одноименную тему Подключение PPTP в OpenWRT. Соединение выдает ошибку unknown error(user_request). Прошу помощи. Делал следующее:

opkg update
opkg install ppp-mod-pptp kmod-nf-nathelper-extra luci-proto-ppp
# Провайдер требует подключение без шифрования, поэтому
# его нужно отключить принудительно
sed -i 's/^mppe/#mppe/' /etc/ppp/options.pptp
echo nomppe >> /etc/ppp/options.pptp
# В случае с Firwall 4 баг описан [здесь](https://github.com/openwrt/openwrt/issues/13009)
cat > /etc/nftables.d/20-pptp-conntrack-helper.nft << 'EOF'
chain user_pre_output {
    type filter hook output priority -1; policy accept;
    tcp dport 1723 ct helper set "pptp"
}
root@OpenWrt:~# ip address show; ip route show table all
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc mq state UP qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::52eb:f6ff:fe87:29c8/64 scope link
       valid_lft forever preferred_lft forever
3: wan: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
4: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br                              -lan state UP qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
5: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master                               br-lan state LOWERLAYERDOWN qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
6: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master                               br-lan state LOWERLAYERDOWN qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
7: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN qlen 1000
    link/gre 0.0.0.0 brd 0.0.0.0
8: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
9: erspan0@NONE: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
10: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
13: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP ql                              en 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fd7b:c861:1338::1/60 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::52eb:f6ff:fe87:29c8/64 scope link
       valid_lft forever preferred_lft forever
192.168.2.0/24 dev br-lan scope link  src 192.168.2.1
local 127.0.0.0/8 dev lo table local scope host  src 127.0.0.1
local 127.0.0.1 dev lo table local scope host  src 127.0.0.1
broadcast 127.255.255.255 dev lo table local scope link  src 127.0.0.1
local 192.168.2.1 dev br-lan table local scope host  src 192.168.2.1
broadcast 192.168.2.255 dev br-lan table local scope link  src 192.168.2.1
fd7b:c861:1338::/64 dev br-lan  metric 1024
unreachable fd7b:c861:1338::/48 dev lo  metric 2147483647
fe80::/64 dev eth0  metric 256
fe80::/64 dev br-lan  metric 256
local ::1 dev lo table local  metric 0
anycast fd7b:c861:1338:: dev br-lan table local  metric 0
local fd7b:c861:1338::1 dev br-lan table local  metric 0
anycast fe80:: dev eth0 table local  metric 0
anycast fe80:: dev br-lan table local  metric 0
local fe80::52eb:f6ff:fe87:29c8 dev eth0 table local  metric 0
local fe80::52eb:f6ff:fe87:29c8 dev br-lan table local  metric 0
multicast ff00::/8 dev eth0 table local  metric 256
multicast ff00::/8 dev br-lan table local  metric 256


root@OpenWrt:~# ip rule show; ip -6 rule show; nft list ruleset
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default
0:      from all lookup local
32766:  from all lookup main
table inet fw4 {
        ct helper amanda {
                type "amanda" protocol udp
                l3proto inet
        }

        ct helper RAS {
                type "RAS" protocol udp
                l3proto inet
        }

        ct helper Q.931 {
                type "Q.931" protocol tcp
                l3proto inet
        }

        ct helper irc {
                type "irc" protocol tcp
                l3proto ip
        }

        ct helper pptp {
                type "pptp" protocol tcp
                l3proto ip
        }

        ct helper sip {
                type "sip" protocol udp
                l3proto inet
        }

        ct helper snmp {
                type "snmp" protocol udp
                l3proto ip
        }

        ct helper tftp {
                type "tftp" protocol udp
                l3proto inet
        }

        chain user_pre_output {
                type filter hook output priority filter - 1; policy accept;
                tcp dport 1723 ct helper set "pptp"
                tcp dport 1723 ct helper set "pptp"
        }

        chain input {
                type filter hook input priority filter; policy drop;
                iifname "lo" accept comment "!fw4: Accept traffic from loopback"
                ct state established,related accept comment "!fw4: Allow inbound established and related flows"
                tcp flags syn / fin,syn,rst,ack jump syn_flood comment "!fw4: Rate limit TCP syn packets"
                iifname "br-lan" jump input_lan comment "!fw4: Handle lan IPv4/IPv6 input traffic"
                jump handle_reject
        }

        chain forward {
                type filter hook forward priority filter; policy drop;
                ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
                iifname "br-lan" jump forward_lan comment "!fw4: Handle lan IPv4/IPv6 forward traffic"
                jump handle_reject
        }

        chain output {
                type filter hook output priority filter; policy accept;
                oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
                ct state established,related accept comment "!fw4: Allow outbound established and related flows"
                oifname "br-lan" jump output_lan comment "!fw4: Handle lan IPv4/IPv6 output traffic"
        }

        chain prerouting {
                type filter hook prerouting priority filter; policy accept;
                iifname "br-lan" jump helper_lan comment "!fw4: Handle lan IPv4/IPv6 helper assignment"
        }

        chain handle_reject {
                meta l4proto tcp reject with tcp reset comment "!fw4: Reject TCP traffic"
                reject comment "!fw4: Reject any other traffic"
        }

        chain syn_flood {
                limit rate 25/second burst 50 packets return comment "!fw4: Accept SYN packets below rate-limit"
                drop comment "!fw4: Drop excess packets"
        }

        chain input_lan {
                jump accept_from_lan
        }

        chain output_lan {
                jump accept_to_lan
        }

        chain forward_lan {
                jump accept_to_lan
        }

        chain helper_lan {
                udp dport 10080 ct helper set "amanda" comment "!fw4: Amanda backup and archiving proto"
                udp dport 1719 ct helper set "RAS" comment "!fw4: RAS proto tracking"
                tcp dport 1720 ct helper set "Q.931" comment "!fw4: Q.931 proto tracking"
                meta nfproto ipv4 tcp dport 6667 ct helper set "irc" comment "!fw4: IRC DCC connection tracking"
                meta nfproto ipv4 tcp dport 1723 ct helper set "pptp" comment "!fw4: PPTP VPN connection tracking"
                udp dport 5060 ct helper set "sip" comment "!fw4: SIP VoIP connection tracking"
                meta nfproto ipv4 udp dport 161 ct helper set "snmp" comment "!fw4: SNMP monitoring connection tracking"
                udp dport 69 ct helper set "tftp" comment "!fw4: TFTP connection tracking"
        }

        chain accept_from_lan {
                iifname "br-lan" counter packets 703 bytes 53996 accept comment "!fw4: accept lan IPv4/IPv6 traffic"
        }

        chain accept_to_lan {
                oifname "br-lan" counter packets 52 bytes 5965 accept comment "!fw4: accept lan IPv4/IPv6 traffic"
        }

        chain input_ant {
        }

        chain output_ant {
        }

        chain forward_ant {
        }

        chain accept_to_ant {
        }

        chain reject_from_ant {
        }

        chain reject_to_ant {
        }

        chain dstnat {
                type nat hook prerouting priority dstnat; policy accept;
        }

        chain srcnat {
                type nat hook postrouting priority srcnat; policy accept;
        }

        chain srcnat_ant {
        }

        chain raw_prerouting {
                type filter hook prerouting priority raw; policy accept;
        }

        chain raw_output {
                type filter hook output priority raw; policy accept;
        }

        chain mangle_prerouting {
                type filter hook prerouting priority mangle; policy accept;
        }

        chain mangle_postrouting {
                type filter hook postrouting priority mangle; policy accept;
        }

        chain mangle_input {
                type filter hook input priority mangle; policy accept;
        }

        chain mangle_output {
                type route hook output priority mangle; policy accept;
        }

        chain mangle_forward {
                type filter hook forward priority mangle; policy accept;
        }
}



root@OpenWrt:~# sysctl net.netfilter.nf_conntrack_helper
net.netfilter.nf_conntrack_helper = 1

root@OpenWrt:~# uci show network; uci show firewall
network.loopback=interface
network.loopback.device='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fd7b:c861:1338::/48'
network.globals.packet_steering='1'
network.@device[0]=device
network.@device[0].name='br-lan'
network.@device[0].type='bridge'
network.@device[0].ports='lan1' 'lan2' 'lan3'
network.lan=interface
network.lan.device='br-lan'
network.lan.proto='static'
network.lan.ipaddr='192.168.2.1'
network.lan.netmask='255.255.255.0'
network.lan.ip6assign='60'
network.wwan=interface
network.wwan.proto='dhcp'
network.wwan.auto='0'
network.ANT=interface
network.ANT.proto='pptp'
network.ANT.server='vpnnem.a-n-t.ru'
network.ANT.username='NTCH_67_170'
network.ANT.password='55867828000'
network.ANT.ipv6='0'
firewall.@defaults[0]=defaults
firewall.@defaults[0].input='REJECT'
firewall.@defaults[0].output='ACCEPT'
firewall.@defaults[0].forward='REJECT'
firewall.@defaults[0].synflood_protect='1'
firewall.@zone[0]=zone
firewall.@zone[0].name='lan'
firewall.@zone[0].input='ACCEPT'
firewall.@zone[0].output='ACCEPT'
firewall.@zone[0].forward='ACCEPT'
firewall.@zone[0].network='lan' 'wwan' 'ANT'


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

резолвится ли vpnnem.a-n-t.ru, подключается ли к этому серверу на 1723 порт…

Распишите по подробней пожалуйста, или дайте ссылку где почитать можно.

Добавил DHCP клиента на wan.

root@OpenWrt:~# ip address show; ip route show table all
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc mq state UP qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::52eb:f6ff:fe87:29c8/64 scope link
       valid_lft forever preferred_lft forever
3: wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
    inet 10.24.12.254/21 brd 10.24.15.255 scope global wan
       valid_lft forever preferred_lft forever
    inet6 fe80::52eb:f6ff:fe87:29c8/64 scope link
       valid_lft forever preferred_lft forever
4: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br                                         -lan state UP qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
5: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master                                          br-lan state LOWERLAYERDOWN qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
6: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master                                          br-lan state LOWERLAYERDOWN qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
7: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN qlen 1000
    link/gre 0.0.0.0 brd 0.0.0.0
8: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
9: erspan0@NONE: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
10: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
13: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP ql                                         en 1000
    link/ether 50:eb:f6:87:29:c8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fd7b:c861:1338::1/60 scope global noprefixroute
       valid_lft forever preferred_lft forever
    inet6 fe80::52eb:f6ff:fe87:29c8/64 scope link
       valid_lft forever preferred_lft forever
default via 10.24.8.1 dev wan  src 10.24.12.254
10.0.0.0/24 via 10.24.8.1 dev wan  src 10.24.12.254
10.20.0.0/22 via 10.24.8.1 dev wan  src 10.24.12.254
10.24.8.0/21 dev wan scope link  src 10.24.12.254
192.168.2.0/24 dev br-lan scope link  src 192.168.2.1
192.168.240.0/24 via 10.24.8.1 dev wan  src 10.24.12.254
local 10.24.12.254 dev wan table local scope host  src 10.24.12.254
broadcast 10.24.15.255 dev wan table local scope link  src 10.24.12.254
local 127.0.0.0/8 dev lo table local scope host  src 127.0.0.1
local 127.0.0.1 dev lo table local scope host  src 127.0.0.1
broadcast 127.255.255.255 dev lo table local scope link  src 127.0.0.1
local 192.168.2.1 dev br-lan table local scope host  src 192.168.2.1
broadcast 192.168.2.255 dev br-lan table local scope link  src 192.168.2.1
fd7b:c861:1338::/64 dev br-lan  metric 1024
unreachable fd7b:c861:1338::/48 dev lo  metric 2147483647
fe80::/64 dev wan  metric 256
fe80::/64 dev eth0  metric 256
fe80::/64 dev br-lan  metric 256
local ::1 dev lo table local  metric 0
anycast fd7b:c861:1338:: dev br-lan table local  metric 0
local fd7b:c861:1338::1 dev br-lan table local  metric 0
anycast fe80:: dev wan table local  metric 0
anycast fe80:: dev eth0 table local  metric 0
anycast fe80:: dev br-lan table local  metric 0
local fe80::52eb:f6ff:fe87:29c8 dev wan table local  metric 0
local fe80::52eb:f6ff:fe87:29c8 dev eth0 table local  metric 0
local fe80::52eb:f6ff:fe87:29c8 dev br-lan table local  metric 0
multicast ff00::/8 dev wan table local  metric 256
multicast ff00::/8 dev eth0 table local  metric 256
multicast ff00::/8 dev br-lan table local  metric 256
ooogo
() автор топика
Ответ на: комментарий от ooogo

Наверное, вы уже поняли, что проблема в DNS. По идее, dhcp-клиент должен пролучить от вашего провайдера адреса DNS и прописать их в /etc/resolv.conf. Но сейчас в линуксе (в общем) и в openwrt настрйока DNS может быть навороченой. Там, kresd, dnsmasq и пр. И какой-то готовой инструкции куда смотреть и что делать я не подскажу. Это может быть как нехватка библиотек типа libnss_dns.so.2 и libresolv.so.2, так и неправильные настройки dnsmasq...

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

Дублирую решение, может быть кому-то пригодиться

Edit your /etc/config/dhcp and add a single line at the end of the section:

config dnsmasq
    [...]
    list rebind_domain 'a-n-t.ru'
then execute /etc/init.d/dnsmasq restart
ooogo
() автор топика