Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kolyanok/6e93f3ed5f3aefb4d482df8c4463f196 to your computer and use it in GitHub Desktop.
Save kolyanok/6e93f3ed5f3aefb4d482df8c4463f196 to your computer and use it in GitHub Desktop.
Установка bol-van/zapret на OpenWrt

1. Установите OpenWrt на ваш роутер.

Для каждой модели роутера процесс установки различается. Ищите инструкции для своей модели в Google.

2. Подключитесь к роутеру по SSH

Чтобы подключиться по SSH, на роутере должен быть установлен пароль. Его можно установить в веб-интерфейсе. Для Windows используйте программу PuTTY, в macOS/Linux достаточно открыть системное приложение Терминал и ввести там следующую команду:

ssh root@IP-адрес_роутера

IP адрес роутера в стандартной конфигурации — 192.168.1.1

3. Установите bol-van/zapret

Для этого введите поочередно следующие команды:

opkg update
opkg install iptables-mod-extra iptables-mod-nfqueue iptables-mod-filter iptables-mod-ipopt iptables-mod-conntrack-extra ipset curl ip6tables-mod-nat gzip grep git-http
mkdir /opt
cd /tmp
git clone --depth 1 https://github.com/bol-van/zapret
cd zapret/
./install_easy.sh

Далее на

do you want the installer to copy it for you (default : N)

ответьте Y. Если у вас есть IPv6 (или если вы не знаете, есть ли он у вас), на вопрос о включении его поддержки тоже ответьте Y. На остальные вопросы просто нажимайте enter. После установки выполните следующие команды:

cd ..
rm -rf zapret/

После этого доступ к заблокированным сайтам должен появиться.

@guglovich
Copy link

через PuTTY подключаюсь к роутеру по SSH, по итогу пишет "Connection refused". Ip точно верный

новый ssh любит ключи теперь. при новом коннекте надо удалять файл C:\Users\HP.ssh\known_hosts
на линухе аналогично но свой путь

@guglovich
Copy link

а как настроить сам zapret? то есть на роутер я его установил, но можно ли как-то добавить сайты в исключения?

можно GUI приложуху сделать в лк. пакет называется luci-app-zapret.ipk

@9868-08
Copy link

9868-08 commented Apr 2, 2025

Подскажите, пожалуйста, а есть подходящий пакет

для всех платформ там есть. Инструкцию там же читайте.
для моей платформы - arm_cortex-a7_neon-vfpv4
image

Не вижу пакета для моей системы (как я понимаю мне нужен файл zapret_70.20250323*.ipk)
image

также не вижу инструкцию
image

@9868-08
Copy link

9868-08 commented Apr 2, 2025

Подскажите, пожалуйста, а есть подходящий пакет

для всех платформ там есть. Инструкцию там же читайте.
для моей платформы - arm_cortex-a7_neon-vfpv4
image

Не вижу пакета для моей системы (как я понимаю мне нужен файл zapret_70.20250323*.ipk) image

также не вижу инструкцию image

Пакет был доступен в предыдущем релизе - zapret v70.20250213

@CAHbKA5567
Copy link

root@OpenWrt:~# opkg update
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_kmods
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/telephony/Packages.sig
Signature check passed.
root@OpenWrt:~# opkg install iptables-mod-extra iptables-mod-nfqueue iptables-mod-filter iptables-mod-ipopt iptables-mod-conntrack-extra ipset curl ip6tables-mod-nat gzip grep git-http
Installing iptables-mod-extra (1.8.10-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/packages/iptables-mod-extra_1.8.10-r1_aarch64_cortex-a53.ipk
Installing libxtables12 (1.8.10-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/packages/libxtables12_1.8.10-r1_aarch64_cortex-a53.ipk
Installing kmod-nf-ipt (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-nf-ipt_6.6.73-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-core (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-core_6.6.73-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-extra (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-extra_6.6.73-r1_aarch64_cortex-a53.ipk
Installing iptables-mod-nfqueue (1.8.10-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/packages/iptables-mod-nfqueue_1.8.10-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-nfqueue (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-nfqueue_6.6.73-r1_aarch64_cortex-a53.ipk
Installing iptables-mod-filter (1.8.10-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/packages/iptables-mod-filter_1.8.10-r1_aarch64_cortex-a53.ipk
Installing kmod-lib-textsearch (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-lib-textsearch_6.6.73-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-conntrack (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-conntrack_6.6.73-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-filter (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-filter_6.6.73-r1_aarch64_cortex-a53.ipk
Installing iptables-mod-ipopt (1.8.10-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/packages/iptables-mod-ipopt_1.8.10-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-ipopt (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-ipopt_6.6.73-r1_aarch64_cortex-a53.ipk
Installing iptables-mod-conntrack-extra (1.8.10-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/packages/iptables-mod-conntrack-extra_1.8.10-r1_aarch64_cortex-a53.ipk
Installing kmod-nf-conncount (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-nf-conncount_6.6.73-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-conntrack-extra (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-conntrack-extra_6.6.73-r1_aarch64_cortex-a53.ipk
Installing ipset (7.21-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/base/ipset_7.21-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-ipset (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-ipset_6.6.73-r1_aarch64_cortex-a53.ipk
Installing libipset13 (7.21-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/base/libipset13_7.21-r1_aarch64_cortex-a53.ipk
Package curl (8.10.1-r1) installed in root is up to date.
Installing ip6tables-mod-nat (1.8.10-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/packages/ip6tables-mod-nat_1.8.10-r1_aarch64_cortex-a53.ipk
Installing kmod-nf-nat6 (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-nf-nat6_6.6.73-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-nat (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-nat_6.6.73-r1_aarch64_cortex-a53.ipk
Installing kmod-nf-ipt6 (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-nf-ipt6_6.6.73-r1_aarch64_cortex-a53.ipk
Installing kmod-ip6tables (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ip6tables_6.6.73-r1_aarch64_cortex-a53.ipk
Installing kmod-ipt-nat6 (6.6.73-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/targets/mediatek/filogic/kmods/6.6.73-1-d649d775435da5a8637f7a955a80d331/kmod-ipt-nat6_6.6.73-r1_aarch64_cortex-a53.ipk
Package gzip (1.13-r1) installed in root is up to date.
Installing grep (3.11-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/packages/grep_3.11-r1_aarch64_cortex-a53.ipk
Installing libpcre2 (10.42-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/base/libpcre2_10.42-r1_aarch64_cortex-a53.ipk
Installing git-http (2.46.2-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/packages/git-http_2.46.2-r1_aarch64_cortex-a53.ipk
Installing libopenssl3 (3.0.16-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/base/libopenssl3_3.0.16-r1_aarch64_cortex-a53.ipk
Installing git (2.46.2-r1) to root...
Downloading https://downloads.openwrt.org/releases/24.10.0/packages/aarch64_cortex-a53/packages/git_2.46.2-r1_aarch64_cortex-a53.ipk
Configuring kmod-nf-ipt.
Configuring kmod-ipt-core.
Configuring kmod-ipt-nfqueue.
Configuring libopenssl3.
Configuring kmod-lib-textsearch.
Configuring libxtables12.
Configuring kmod-ipt-extra.
Configuring iptables-mod-extra.
Configuring kmod-ipt-conntrack.
Configuring kmod-ipt-filter.
Configuring libpcre2.
Configuring grep.
Configuring kmod-nf-nat6.
Configuring kmod-nf-conncount.
Configuring kmod-ipt-conntrack-extra.
Configuring iptables-mod-nfqueue.
Configuring kmod-nf-ipt6.
Configuring kmod-ip6tables.
Configuring kmod-ipt-ipopt.
Configuring iptables-mod-ipopt.
Configuring kmod-ipt-nat.
Configuring kmod-ipt-nat6.
Configuring ip6tables-mod-nat.
Configuring kmod-ipt-ipset.
Configuring libipset13.
Configuring ipset.
Configuring iptables-mod-filter.
Configuring iptables-mod-conntrack-extra.
Configuring git.
Configuring git-http.
root@OpenWrt:~# mkdir /opt
mkdir: can't create directory '/opt': File exists
root@OpenWrt:~# cd /tmp
root@OpenWrt:/tmp# git clone --depth 1 https://github.com/bol-van/zapret
Cloning into 'zapret'...
remote: Enumerating objects: 309, done.
remote: Counting objects: 100% (309/309), done.
remote: Compressing objects: 100% (259/259), done.
remote: Total 309 (delta 36), reused 184 (delta 24), pack-reused 0 (from 0)
Receiving objects: 100% (309/309), 515.13 KiB | 305.00 KiB/s, done.
Resolving deltas: 100% (36/36), done.
root@OpenWrt:/tmp# cd zapret/
root@OpenWrt:/tmp/zapret# ./install_easy.sh
* checking system
system is based on openwrt
package manager opkg
firewall fw4. flow offloading requires nftables.
* checking executables
find: /tmp/zapret/binaries: No such file or directory
build tools not found

@CAHbKA5567
Copy link

У меня вообще не устанавливается

@guglovich
Copy link

У меня вообще не устанавливается

попробуйте конкретно ipk пакеты под свою платформу

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment