-aMk-
-
Posts
7 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Downloads
Blogs
Events
Posts posted by -aMk-
-
-
23 часа назад, slava.trifonov сказал:
Попробуйте так:
~ # 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 работают.
Всё заработало, Слава - спасибо
Скрытый текстI] Nov 14 22:10:46 dnsmasq[321]: read /opt/etc/hosts - 498004 addresses
Nov 14 22:10:53 dnsmasq[321]: read /opt/etc/hosts - 498004 addresses
Nov 14 22:10:53 dnsmasq[321]: query[A] i.instagram.com from 192.168.1.36
Nov 14 22:10:53 dnsmasq[321]: forwarded i.instagram.com to 77.88.8.2
Nov 14 22:10:53 dnsmasq[321]: forwarded i.instagram.com to 77.88.8.88
Nov 14 22:10:53 dnsmasq[321]: query[A] clients3.google.com from 192.168.1.36
Nov 14 22:10:53 dnsmasq[321]: forwarded clients3.google.com to 77.88.8.2
Nov 14 22:10:53 dnsmasq[321]: forwarded clients3.google.com to 77.88.8.88У меня тоже HOSTS скачан, ссылка была выше, ну и лог временно посмотрю и отключу позже. Кстати, загрузка ЦП и Ram:
Скрытый текст
Keenetic Giga II Сервисный код 797-604-641-321-677 Версия NDMS v2.06(AAFS.8)C1 ОбновленияМодель НетВремя работы 00:05:44 Текущее время 14/11/2016 22:15:46 Загрузка ЦП 0% Память 25% (63/256 МБ) Файл подкачки 0 из 0 МБ Имя устройства Keenetic -
Так и делаю. Буду пробовать. Как перезапустить службу, какая команда используется для перезапуска DNSMASQ ?
Пробую в консоли ввести ["$table" != "nat"], вылезает ошибка:
sh: missing ]
-
Цитата
Все сделал, как вы предложили, стало хуже:
Скрытый текстPutty:
login as: root
root@192.168.1.1's password:
BusyBox v1.24.2 () built-in shell (ash)
|. .| |. .| |. .|
|||,.||| |||,.||| |||,.|||
|' || '| |' || '| |' || '|
____||____ ||________||
| === = = | | == == == |
|__________| |__________|
______ _________ ___ ____ ____
| | \| |_ _| \ /\ / / \ | _ `| |
| ~~,' ' | | | \ \/ \/ / _ \ | |_),| ~~,' __
| ~~'. ; | | | \ /\ / ___ \| ._ \| ~~'. |__|
|____|_|\_| |_| \/ \/_/ \_|_| \_|____|
_ ______________ ______________ ___
| |/ /| | | \| | |_ _| |/ __\
| ' / | ~~,' ~~,' ' | ~~,' | | | | | '
| ; \ | ~~'. ~~'. ; | ~~'. | | | | |__,
|_|\_\|____|____|_|\_|____| |_| |_|\___/Ultimate repo for ZyXEL routers the Keenetic series
~ # ndmq -p "show version" -P release
v2.06(AAFS.8)C1
~ # ndmq -p "show version" -P device
Keenetic Giga II
~ # opkg install dnsmasq-full iptables
Package dnsmasq-full (2.76-7) installed in root is up to date.
Package iptables (1.4.21-2) installed in root is up to date.
~ # cat > /opt/etc/ndm/netfilter.d/010-intercept-dns.sh <<EOF
> !/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
> EOF
~ # chmod +x /opt/etc/ndm/netfilter.d/010-intercept-dns.sh
~ # cat >> /opt/etc/dnsmasq.conf <<EOF
> no-resolv
> server=77.88.8.88#1253
> server=77.88.8.2#1253
> port=65053
> EOF
~ # wget -O /opt/etc/hosts http://winhelp2002.mvps.org/hosts.txt
Connecting to winhelp2002.mvps.org (216.155.126.40:80)
hosts 100% |***************************************************| 490k 0:00:00 ETA
~ #
~ #Скрытый текстSyslog:
Nov 11 19:45:07 ndm: Opkg::Manager: /tmp/mnt/500gb mounted to /tmp/mnt/500gb.
Nov 11 19:45:07 ndm: Opkg::Manager: /tmp/mnt/500gb mounted to /opt/.
Nov 11 19:45:07 ndm: Opkg::Manager: /tmp/mnt/500gb initialized.
[E] Nov 11 19:45:07 ndm: Opkg::Manager: invalid initrc "/opt/opkg dns-override": no such file or directory, trying /opt/etc/init.d/.
Nov 11 19:45:07 dropbear[309]: Running in background
Nov 12 14:47:05 ndm: Core::System::Clock: system time has been changed.
Nov 12 14:47:05 root: Started dropbear from .
[C] Nov 12 14:47:05 dnsmasq[316]: error at line 674 of /opt/etc/dnsmasq.conf
[C] Nov 12 14:47:05 dnsmasq[316]: FAILED to start up
Nov 12 14:47:05 pppd[295]: System time change detected.
Nov 12 14:47:06 ndm: Core::Server: started Session 127.0.0.1:57199.
Nov 12 14:47:06 miniupnpd: HTTP listening on port 35743
Nov 12 14:47:06 miniupnpd: listening for NAT-PMP traffic on port 5351
Nov 12 14:47:06 ndm: kernel: ra0: no IPv6 routers present
Nov 12 14:47:07 ndm: Core::Server: started Session 127.0.0.1:57201.
Nov 12 14:47:07 ndm: Cifs::ServerNQ: service started.
Nov 12 14:47:09 transmissiond: Transmission 2.84 (14307) started
Nov 12 14:47:09 transmissiond: RPC Server Adding address to whitelist: *.*.*.*
Nov 12 14:47:09 transmissiond: RPC Server Serving RPC and Web requests on port 127.0.0.1:10000/transmission/
Nov 12 14:47:09 transmissiond: RPC Server Whitelist enabled
Nov 12 14:47:09 transmissiond: RPC Server Password required
Nov 12 14:47:09 transmissiond: Port Forwarding Stopped
Nov 12 14:47:09 transmissiond: DHT Reusing old id
Nov 12 14:47:09 transmissiond: DHT Bootstrapping from 108 IPv4 nodes
Nov 12 14:47:09 transmissiond: Using settings from "/tmp/mnt/500gb//uT/"
Nov 12 14:47:09 transmissiond: transmissiond requiring authentication
Nov 12 14:47:09 transmissiond: Watching "/tmp/mnt/500gb//uT//watch" for new .torrent files
Nov 12 14:47:13 ndm: Core::System::Clock: system time has been changed.
Nov 12 14:47:13 ndm: Ntp::Client: time synchronized with "3.pool.ntp.org".
Nov 12 14:47:17 root: Failed to start dnsmasq from .
[E] Nov 12 14:47:17 ndm: Opkg::Manager: /opt/etc/init.d/S56dnsmasq: exit code 255.
[C] Nov 12 14:47:17 dnsmasq[374]: error at line 674 of /opt/etc/dnsmasq.conf
[C] Nov 12 14:47:17 dnsmasq[374]: FAILED to start up
Nov 12 14:47:23 ndm: kernel: SWNAT bind table cleared
Nov 12 14:47:23 ndm: Core::System::DriverManager: unloading hw_nat.ko...
Nov 12 14:47:29 root: Failed to start dnsmasq from .
[E] Nov 12 14:47:29 ndm: Opkg::Manager: /opt/etc/init.d/rc.unslung: exit code 255.
Nov 12 14:47:29 ndm: Opkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: line 1: !/bin/sh: not found.
Nov 12 14:48:22 ndm: Core::Syslog: last message repeated 4 times.
Nov 12 14:49:08 ndm: kernel: IPv4 conntrack: flushed 1 entries with address 192.168.1.40
Nov 12 14:49:08 ndm: kernel: SWNAT bind table cleared
Nov 12 14:49:08 ndm: Core::System::DriverManager: unloading hw_nat.ko...
Nov 12 14:49:09 ndm: Opkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: line 1: !/bin/sh: not found.
Nov 12 14:49:39 wmond: WifiMaster0/AccessPoint0: (RT2860) STA(74:04:2b:71:35:21) had deauthenticated.И вот ещё - подскажите, какой командой перезапустить службу, в моём случае dnsmasq, без перезагрузки роутера. Спасибо заранее
-
2 часа назад, TheBB сказал:
Версию Entware можно определить по url, с которого идет скачивание пакетов, в файле /opt/etc/opkg.conf :
src/gz keenle http://pkg.entware-keenetic.ru/binaries/keenle
dest root /
lists_dir ext /opt/var/opkg-listsВот ЭТО лежит внутри файла /opt/etc/opkg.conf. Ызвыняйте, что ничего более конкретного предоставить не могу, действую "по уставу"...
2 часа назад, TheBB сказал:opkg list-installed
-
2 минуты назад, TheBB сказал:
??? судя по v2.06 - Entware-ng или Entware-Keenetic (как и Entware-3x для 2.07+), являются актуальными. Что вы умудрились поставить?
не вариант, т.к.
пакет iptables установлен?
Как проверить версию EnterWare и установлен-ли пакет iptables? Я делал всё по инструкции в 1-м посте, никакой отсебятины... И повторюсь - вручную всё работает, но непонятная хрень в журнале. Если не сложно - отпишите, что набрать в консоли, логи с меня, могу принт-скрины приложить, очень хочется автоматизировать процесс фильтрации ибо 2-е детишек с планшетами\смартами
-
Добрый вечер форумчане. А я не починил (как отписался предшествующий оратор :)) ). Вручную, через Putty, фильтрация работает.... Что я делаю:
в консоли копипастой по очереди запускаю
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
и фильтр работает, НО в журнале имею:
Nov 11 19:52:27ndm Opkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: Try `iptables -h' or 'iptables --help' for more information.Nov 11 19:52:27ndm Opkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: Try `iptables -h' or 'iptables --help' for more information.Nov 11 19:52:27ndm Opkg::Manager: /opt/etc/ndm/netfilter.d/010-intercept-dns.sh: exit code 2.Что не так-то? Сильно подозреваю, что с синтаксисом во 2-й строке косяк, но т.к. в "этих-ваших-линуксах" слабо понимаю, то сообразить где ошибка - не могу. Версия EnterWare - последняя доступная, может доустановить что-то из репозитория, или роутер сбросить "на завод" и всё с нуля попробовать ??
Блокировка рекламы на роутере
in Каталог готовых решений Opkg
Posted