
slava.trifonov
Участники форума-
Постов
62 -
Зарегистрирован
-
Посещение
Тип контента
Профили
Форумы
Галерея
Загрузки
Блоги
События
Весь контент slava.trifonov
-
не сработали скрипты netfilter.d
slava.trifonov опубликовал тема в Вопросы по сборке и настройке Opkg
После перезагрузки роутера не сработали скрипты из /opt/etc/ndm/netfilter.d. И, как мне показалось, они не запускаются в процессе работы когда система пересоздаёт таблицы. Добавил logger в скрипт, но пока в журнале пусто. И правила пока на месте. Но ночью правила сбросились и не создались. -
подключил swap и некоторые пакеты из cpan начали устанавливаться, а не которые нет например: cpan[1]> install ExtUtils::PkgConfig Reading '/opt/root/.cpan/Metadata' Database was generated on Fri, 15 Dec 2017 11:53:55 GMT Running install for module 'ExtUtils::PkgConfig' Checksum for /opt/root/.cpan/sources/authors/id/X/XA/XAOC/ExtUtils-PkgConfig-1.16.tar.gz ok Scanning cache /opt/root/.cpan/build for sizes ............................................................................DONE Argument "1.4417_001" isn't numeric in numeric ge (>=) at /opt/lib/perl5/5.24/CPAN/Distribution.pm line 638. Configuring X/XA/XAOC/ExtUtils-PkgConfig-1.16.tar.gz with Makefile.PL *** *** ExtUtils::PkgConfig requires the pkg-config utility, but it doesn't *** seem to be in your PATH. Is it correctly installed? *** PATH=/opt/usr/sbin:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin *** No 'Makefile' created XAOC/ExtUtils-PkgConfig-1.16.tar.gz /opt/bin/perl5.24.1 Makefile.PL -- NOT OK Failed during this command: XAOC/ExtUtils-PkgConfig-1.16.tar.gz : writemakefile NO -- No 'Makefile' created откуда берётся этот pkg-config?
-
Entware (не 3х) Не получается установить необходимые модули perl как с помощью CPAN, так и в ручную. Попытка установить через CPAN всегда заканчивается переполнением памяти : # perl -MCPAN -e shell Terminal does not support AddHistory. Can't exec "pwd": No such file or directory at /opt/lib/perl5/5.24/Cwd.pm line 209. cpan shell -- CPAN exploration and modules installation (v2.1101) Enter 'h' for help. cpan[1]> install CPAN Fetching with HTTP::Tiny: http://www.cpan.org/authors/01mailrc.txt.gz Reading '/opt/root/.cpan/sources/authors/01mailrc.txt.gz' ............................................................................DONE Fetching with HTTP::Tiny: http://www.cpan.org/modules/02packages.details.txt.gz Reading '/opt/root/.cpan/sources/modules/02packages.details.txt.gz' Database was generated on Fri, 15 Dec 2017 11:53:55 GMT ............. New CPAN.pm version (v2.16) available. [Currently running version is v2.1101] You might want to try install CPAN reload cpan to both upgrade CPAN.pm and run the new version without leaving the current session. ...................................................Killed Ручная установка тоже всегда заканчивается каким-нибудь ошибками: ~/CPAN-DistnameInfo-0.12 # perl Makefile.PL && make && make install Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for CPAN::DistnameInfo Writing MYMETA.yml and MYMETA.json cp lib/CPAN/DistnameInfo.pm blib/lib/CPAN/DistnameInfo.pm !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Couldn't chdir to '': No such file or directory !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! at -e line 1. make: *** [Makefile:682: pure_site_install] Error 2 Установка из CPAN вообще возможна? Или придётся довольствоваться тем что есть среди пакетов perlbase-*?
-
Дано: lighttpd с виртуальными хостами на нестандартном порту 1088 записи в hosts: 192.168.0.1 router.local 192.168.0.200 domain1.local 192.168.0.200 domain2.local и т.д. правило в iptables iptables -t nat -A PREROUTING -s 192.168.0.0/16 -d 192.168.0.200 -p tcp --dport 80 -j DNAT --to-destination 192.168.0.1:1088 открываю в браузере domain1.local или domain2.local - вижу фигу ЧЯДНТ? Хотя router.local работает без проблем. Никакого устройства по адресу 192.168.0.200 не существует.
-
Заглючил что-то роутер, отключил opkg - стало всё хорошо. Решил переустановить с нуля. В итоге не запускаются программы. В журнале роутера пишется вот это: Sep 30 23:56:54ndmCore::Syslog: the system log has been cleared. Sep 30 23:57:01ndmOpkg::Manager: disk is set to: b605bb92-5c69-e3ff-5148-9a40bd635ad7: Sep 30 23:57:01ndmOpkg::Manager: init script reset to default: /opt/etc/initrc. Sep 30 23:57:01ndmOpkg::Manager: /tmp/mnt/OPKG/ mounted to /tmp/mnt/OPKG/. Sep 30 23:57:01ndmOpkg::Manager: /tmp/mnt/OPKG/ mounted to /opt/. Sep 30 23:57:01ndmOpkg::Manager: /tmp/mnt/OPKG/ initialized. Sep 30 23:57:01ndmOpkg::Manager: invalid initrc "/opt/etc/initrc": no such file or directory, trying /opt/etc/init.d/. Sep 30 23:57:01ndmCore::ConfigurationSaver: saving configuration... Sep 30 23:57:05ndmCore::ConfigurationSaver: configuration saved. Sep 30 23:57:13rootFailed to start cron from . Sep 30 23:57:13ndmOpkg::Manager: /opt/etc/init.d/S10cron: exit code 255. Sep 30 23:57:25rootFailed to start tor from . Sep 30 23:57:25ndmOpkg::Manager: /opt/etc/init.d/S35tor: exit code 255. Sep 30 23:57:25dropbear[1251]Running in background Sep 30 23:57:36rootFailed to start dnsmasq from . Sep 30 23:57:36ndmOpkg::Manager: /opt/etc/init.d/S56dnsmasq: exit code 255. Sep 30 23:57:48rootFailed to start cron from . Sep 30 23:58:00rootFailed to start tor from . Sep 30 23:58:00ndmOpkg::Manager: /opt/etc/init.d/rc.unslung: timed out. Sep 30 23:58:11rootFailed to start dnsmasq from . При попытке запустить из консоли выдаёт это и висит: /opt/root # /opt/etc/init.d/S56dnsmasq start Starting dnsmasq... /opt/etc/init.d/S56dnsmasq: /opt/etc/init.d/rc.func: line 115: 1: Invalid argument /opt/etc/init.d/S56dnsmasq: /opt/etc/init.d/rc.func: line 115: 1: Invalid argument Что делать то? Переустанавливать бесполезно, всё то же самое.
-
Попробуйте так: ~ # cat /opt/etc/ndm/netfilter.d/010-intercept-dns.sh #!/bin/sh case "$table" in nat) lan_ip=$(ndmq -p 'show interface Bridge0' -P address) iptables -t nat -I PREROUTING -p udp -m udp --dport 53 -j DNAT --to-destination $lan_ip:65053 iptables -t nat -I PREROUTING -p tcp -m tcp --dport 53 -j DNAT --to-destination $lan_ip:65053 ;; *) exit 0 esac Такой dnsmasq.conf no-resolv server=8.8.8.8 server=8.8.4.4 port=65053 addn-hosts=/opt/etc/hosts log-queries Файл hosts у меня другой, на 28000 строк, загрузка проца 1-2%. С учетом того что polipo+tor работают.
-
А как отменить действие команды opkg dns-override? Только хард-ресет роутера?
-
Добрый день. Начал делать по инструкции из первого поста. Содержимое /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: #!/bin/sh ["$table" != "nat"] && exit 0 lan_ip=$(ndmq -p 'show interface Bridge0' -P address) iptables -t nat -I PREROUTING -p udp -m udp --dport 53 -j DNAT --to-destination $lan_ip:65053 iptables -t nat -I PREROUTING -p tcp -m tcp --dport 53 -j DNAT --to-destination $lan_ip:65053 Как только делаю права на запуск , то пропадает доступ в Интернет ( DNS_PROBE_FINISHED_BAD_CONFIG ). В /opt/etc/dnsmasq.conf в конец дописал: no-resolv server=8.8.8.8 port=65053 В /opt/etc/hosts поместил список блокируемых хостов. Вот что пишет журнал Кинетика: Nov 05 12:59:31ndmOpkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: line 2: [filter: not found. Nov 05 12:59:31ndmCore::Server: started Session 127.0.0.1:60545. Nov 05 12:59:31ndmCore::Session: client disconnected. Nov 05 13:00:45ndmOpkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: line 2: [filter: not found. Nov 05 13:00:45ndmCore::Server: started Session 127.0.0.1:60547. Nov 05 13:00:45ndmCore::Session: client disconnected. Nov 05 13:00:47ndmOpkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: line 2: [filter: not found. Nov 05 13:00:47ndmCore::Server: started Session 127.0.0.1:60548. Nov 05 13:00:47ndmCore::Session: client disconnected. Nov 05 13:02:00ndmOpkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: line 2: [filter: not found. Nov 05 13:02:00ndmCore::Server: started Session 127.0.0.1:60549. Nov 05 13:02:00ndmCore::Session: client disconnected. Nov 05 13:02:02ndmOpkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: line 2: [filter: not found. Nov 05 13:02:02ndmCore::Server: started Session 127.0.0.1:60550. Nov 05 13:02:02ndmCore::Session: client disconnected. Nov 05 13:02:21ndmCore::Server: started Session 127.0.0.1:60552. Nov 05 13:02:21ndmCore::Session: client disconnected. Nov 05 13:02:21ndmOpkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: line 2: [filter: not found. В iptables много повторяющихся правил # iptables -t nat --list\ > Chain PREROUTING (policy ACCEPT) target prot opt source destination DNAT tcp -- anywhere anywhere tcp dpt:domain to:192.168.0.1:65053 DNAT udp -- anywhere anywhere udp dpt:domain to:192.168.0.1:65053 DNAT tcp -- anywhere anywhere tcp dpt:domain to:192.168.0.1:65053 DNAT udp -- anywhere anywhere udp dpt:domain to:192.168.0.1:65053 DNAT tcp -- anywhere anywhere tcp dpt:domain to:192.168.0.1:65053 DNAT udp -- anywhere anywhere udp dpt:domain to:192.168.0.1:65053 DNAT tcp -- anywhere anywhere tcp dpt:domain to:192.168.0.1:65053 DNAT udp -- anywhere anywhere udp dpt:domain to:192.168.0.1:65053 DNAT tcp -- anywhere anywhere tcp dpt:domain to:192.168.0.1:65053 DNAT udp -- anywhere anywhere udp dpt:domain to:192.168.0.1:65053 DNAT tcp -- anywhere anywhere tcp dpt:domain to:192.168.0.1:65053 DNAT udp -- anywhere anywhere udp dpt:domain to:192.168.0.1:65053 и т.д. Если нужна дополнительная информация, спрашивайте. Но помогите настроить блокировку.