Чтобы удаленно подключиться к локальной сети интернет-центра Keenetic, начиная с версии KeeneticOS 3.3 стало возможно использовать туннель WireGuard VPN.
NOTE: Важно! Если вы планируете настроить Keenetic в качестве VPN-сервера, начать необходимо с проверки того, что он имеет публичный "белый" IP-адрес, а при использовании сервиса KeenDNS, что он работает в режиме "Прямой доступ", для которого также требуется публичный IP-адрес. При несоблюдении любого из этих условий подключение к такому серверу из Интернета будет невозможно.
Сначала необходимо выполнить настройку сервера WireGuard в Keenetic, которая показана в инструкции Настройка WireGuard VPN между двумя роутерами Keenetic, после переходите к настройке VPN-клиента.
Ниже приведем пример действий для подключения к VPN-серверу из операционной системы под управлением ОС Linux, на примере настройки подключения в терминале дистрибутива Ubuntu 18.04 LTS и в графической среде дистрибутива Linux Mint 19.3 LTS.
Чтобы установить соединение с WireGuard-сервером Keenetic, в компьютере на базе ОС Linux, потребуется установить пакет WireGuard, при помощи встроенного пакетного менеджера apt.
Варианты установки и настройки в терминале
1. Заходим в терминал и выполняем установку необходимых пакетов для подключения WireGuard- туннеля в терминале и для настройки подключения в Сетевых соединениях (Networkmanager GUI — программа для управления сетевыми соединениями): пакет приложения, модуль ядра, заголовочные файлы ядра.
[my@my-wrk-lnv ~]$ sudo apt install wireguard wireguard-dkms
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Будут установлены следующие дополнительные пакеты:
wireguard-tools
Следующие НОВЫЕ пакеты будут установлены:
wireguard wireguard-dkms wireguard-tools
Обновлено 0 пакетов, установлено 3 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
Необходимо скачать 0 B/344 kB архивов.
После данной операции объём занятого дискового пространства возрастёт на 2 045 kB.
Хотите продолжить? [Д/н]
Выбор ранее не выбранного пакета wireguard-dkms.
(Чтение базы данных … на данный момент установлено 427896 файлов и каталогов.)
Подготовка к распаковке …/wireguard-dkms_1.0.20201112-1~18.04.1_all.deb …
Распаковывается wireguard-dkms (1.0.20201112-1~18.04.1) …
Выбор ранее не выбранного пакета wireguard-tools.
Подготовка к распаковке …/wireguard-tools_1.0.20200513-1~18.04.2_amd64.deb …
Распаковывается wireguard-tools (1.0.20200513-1~18.04.2) …
Выбор ранее не выбранного пакета wireguard.
Подготовка к распаковке …/wireguard_1.0.20200513-1~18.04.2_all.deb …
Распаковывается wireguard (1.0.20200513-1~18.04.2) …
Настраивается пакет wireguard-dkms (1.0.20201112-1~18.04.1) …
Loading new wireguard-1.0.20201112 DKMS files...
Building for 5.4.0-91-generic
Building initial module for 5.4.0-91-generic
Secure Boot not enabled on this system.
Done.
wireguard:
Running module version sanity check.
Good news! Module version 1.0.20201112 for wireguard.ko
exactly matches what is already found in kernel 5.4.0-91-generic.
DKMS will not replace this module.
You may override by specifying --force.
depmod...
DKMS: install completed.
Настраивается пакет wireguard-tools (1.0.20200513-1~18.04.2) …
wg-quick.target is a disabled or a static unit not running, not starting it.
Настраивается пакет wireguard (1.0.20200513-1~18.04.2) …
Обрабатываются триггеры для man-db (2.8.3-2ubuntu0.1) …
2. Переходим к созданию приватного ключа Private Key и публичного ключа Public Key:
[my@my-wrk-lnv ~]$ cd /etc/wireguard/
[my@my-wrk-lnv wireguard]$ umask 077
[my@my-wrk-lnv wireguard]$ sudo -i
[sudo] пароль для my:
root@my-wrk-lnv:~# cd /etc/wireguard/
root@my-wrk-lnv:/etc/wireguard# wg genkey > private-key
root@my-wrk-lnv:/etc/wireguard# wg pubkey > public-key < private-key
root@my-wrk-lnv:~# exit
[my@my-wrk-lnv wireguard]$ sudo cat private-key AOSXWm+sXxRuu/Uo8lysE4PIwVZTRDD+YV6w3HicGHg=
[my@my-wrk-lnv wireguard]$ sudo cat public-key xxKBcZlhZlbjW7yFuhZ08l294HBAp2I/iM05YE8vs0Y=
[my@my-wrk-lnv wireguard]$ cd -
[my@my-wrk-lnv ~]$
NOTE: Важно! Если после ввода команды cd /etc/wireguard/ получаете вывод "Отказано в доступе", значит у вас нет root-прав на чтение данного каталога.
[my@my-wrk-lnv ~]$ cd /etc/wireguard/
bash: cd: /etc/wireguard/: Отказано в доступе
Меняем владельца, который сможет обращаться к каталогу без root-прав:
[my@my-wrk-lnv ~]$ sudo chown -R my /etc/wireguard/
[my@my-wrk-lnv ~]$ cd /etc/wireguard
[my@my-wrk-lnv wireguard]$
После настройки подключения можно вернуть владельца для доступа к каталогу по умолчанию:
[my@my-wrk-lnv wireguard]$ cd - /home/my
[my@my-wrk-lnv ~]$ sudo chown -R root /etc/wireguard/
3. Создадим файл конфигурации wg-client.conf:
[my@my-wrk-lnv wireguard]$ sudo touch wg-client.conf
[my@my-wrk-lnv wireguard]$ ls -1
private-key
public-key
wg-client.conf
4. Добавим настройку подключения в созданный файл конфигурации wg-client.conf, открыв файл в текстовом редакторе, например в nano:
[my@my-wrk-lnv wireguard]$ sudo nano wg-client.conf
[sudo] пароль для my:
[Interface]
PrivateKey = AOSXWm+sXxRuu/Uo8lysE4PIwVZTRDD+YV6w3HicGHg=
Address = 172.16.82.5/24
DNS =
[Peer]
PublicKey = 1YVx+x3C817V9YdhUtpUhzyDLVj5tnK2m//WjFGynm4=
AllowedIPs = 172.16.82.1/32, 192.168.22.0/24
Endpoint = wgwrkserver.dynns.com:16631
PersistentKeepalive = 5
Настройка [Interface] клиента:
В поле "PrivateKey" интерфейса клиента вводим созданный приватный ключ в пункте 2.
Напомним, что посмотреть ключ можно при помощи вывода команды cat:
[my@my-wrk-lnv wireguard]$ sudo cat private-key
AOSXWm+sXxRuu/Uo8lysE4PIwVZTRDD+YV6w3HicGHg=
В поле "Addresses" интерфейса клиента указываем IP-адрес, в формате IP/bitmask — 172.16.82.5/24 (это внутренний адрес туннеля). Можно использовать другую подсеть, при этом ее следует выбрать из частного диапазона адресов и избежать наложения с другими настроенными на данных устройствах подсетями.
NOTE: Важно! Если у вас настроен Доступ в Интернет через WireGuard-туннель, на стороне [Interface] клиента необходимо указать DNS-сервер в поле "DNS=".
В нашем примере указан адрес DNS-сервера от Google 8.8.8.8:
[Interface]
PrivateKey =AOSXWm+sXxRuu/Uo8lysE4PIwVZTRDD+YV6w3HicGHg=
Address = 172.16.82.5/24
DNS = 8.8.8.8
[Peer]
PublicKey = 1YVx+x3C817V9YdhUtpUhzyDLVj5tnK2m//WjFGynm4=
AllowedIPs = 172.16.82.1/32, 192.168.22.0/24
Endpoint = enpwgwrkserver.dynns.com:16631
PersistentKeepalive = 5
Настройка [Peer] сервера:
В поле "PublicKey" вставьте публичный ключ сервера, который можно скопировать в буфер обмена компьютера из настроек WireGuard в веб-интерфейсе роутера:
В поле "AllowedIPs" указываем разрешенные IP-адреса, в формате IP/bitmask — 172.16.82.1/32 (это внутренний адрес сервера) и 192.168.22.0/24 (адрес локального сегмента роутера Keenetic).
В поле "Endpoint" указываем публичный IP-адрес или доменное имя WireGuard-сервера, и порт прослушивания, на который будет устанавливать связь WireGuard-клиент.
В поле "PersistentKeepalive" указываем периодичность попыток проверки доступности удаленной стороны соединения. Обычно, достаточно 3-5-секундного интервала между проверками.
5. Настраиваем удаленное подключение на стороне ранее настроенного WireGuard-сервера.
Подключитесь к веб-конфигуратору роутера и перейдите в меню "Интернет" на страницу "Другие подключения". Нажмите на ранее созданное WireGuard-подключение ("WG-S") и добавьте "Настройки пира". Нажав на "Добавить пир" откроется поле настроек пира, в котором укажите название туннеля "wg-ubuntu-client".
В поле "Публичный ключ" вставляем ключ, который был создан в пункте 2.
Напоминаем, что посмотреть ключ можно при помощи вывода команды cat:
[my@my-wrk-lnv wireguard]$ sudo cat public-key
xxKBcZlhZlbjW7yFuhZ08l294HBAp2I/iM05YE8vs0Y=
В поле "Разрешенные подсети" указываем адрес, трафик с которого будет допущен до сервера в формате IP/bitmask — 172.16.82.5/32
В поле "Проверка активности" необходимо указать периодичность попыток проверки доступности удаленной стороны соединения. Обычно достаточно 10-15 секундного интервала между проверками. По умолчанию значение "Проверки активности" в настройках пира Keenetic указано 30 секунд.
Нажмите "Сохранить".
6. Создаем автоматическое WireGuard-подключение при загрузке ОС через систему инициализации Systemd, которая позволяет запускать и управлять демонами системы ОС Linux:
[my@my-wrk-lnv ~]$ sudo systemctl enable wg-quick@wg-client.service
Created symlink /etc/systemd/system/multi-user.target.wants/wg-quick@wg-client.service → /lib/systemd/system/wg-quick@.service.
NOTE: Важно! В имени сервиса ***.service - вводим имя конфигурации wg-client.conf
7. Запускаем WireGuard-подключение:
[my@my-wrk-lnv ~]$ sudo systemctl start wg-quick@wg-client.service
NOTE: Важно! Если сервис не стартует, необходимо проверить лог загрузки командой systemctl status wg-quick@wg-client.service или journalctl -xe:
[my@my-wrk-lnv ~]$ systemctl status wg-quick@wg-client.service
wg-quick@wg-client.service - WireGuard via wg-quick(8) for wg/client
Loaded: loaded (/lib/systemd/system/wg-quick@.service; indirect; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-04-22 19:55:59 MSK; 8s ago
Docs: man:wg-quick(8)
man:wg(8)
https://www.wireguard.com/
https://www.wireguard.com/quickstart/
https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
Process: 8734 ExecStart=/usr/bin/wg-quick up wg-client (code=exited, status=127)
Main PID: 8734 (code=exited, status=127)
апр 22 19:55:59 my@my-wrk-lnv wg-quick[8734]: [#] ip link add wg-client type wireguard
апр 22 19:55:59 my@my-wrk-lnv wg-quick[8734]: [#] wg setconf wg-client /dev/fd/63
апр 22 19:55:59 my@my-wrk-lnv wg-quick[8734]: [#] ip -4 address add 172.16.82.20/24 dev wg-client
апр 22 19:55:59 my@my-wrk-lnv wg-quick[8734]: [#] ip link set mtu 1420 up dev wg-client
апр 22 19:55:59 my@my-wrk-lnv wg-quick[8734]: [#] resolvconf -a wg-client -m 0 -x
апр 22 19:55:59 my@my-wrk-lnv wg-quick[8734]: /usr/bin/wg-quick: line 31: resolvconf: command not found
апр 22 19:55:59 my@my-wrk-lnv wg-quick[8734]: [#] ip link delete dev wg-client
апр 22 19:55:59 my@my-wrk-lnv systemd[1]: wg-quick@wg-client.service: Main process exited, code=exited, status=127/n/a
апр 22 19:55:59 my@my-wrk-lnv systemd[1]: wg-quick@wg-client.service: Failed with result 'exit-code'.
апр 22 19:55:59 my@my-wrk-lnv systemd[1]: Failed to start WireGuard via wg-quick(8) for wg/client.
Судя по ошибке в системе отсутствует установленный пакет resolvconf, необходимый для работы wg-quick, устанавливаем пакет:
[my@my-wrk-lnv ~]$ sudo apt install resolvconf
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Следующие НОВЫЕ пакеты будут установлены:
resolvconf
Обновлено 0 пакетов, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
Необходимо скачать 48,0 kB архивов.
После данной операции объём занятого дискового пространства возрастёт на 187 kB.
Пол:1 http://mirror.yandex.ru/ubuntu bionic-updates/universe amd64 resolvconf
all 1.79ubuntu10.18.04.3 [48,0 kB]
Получено 48,0 kB за 0с (440 kB/s)
Предварительная настройка пакетов ...
Выбор ранее не выбранного пакета resolvconf.
(Чтение базы данных … на данный момент установлено 395973 файла и каталога.)
Подготовка к распаковке …/resolvconf_1.79ubuntu10.18.04.3_all.deb …
Распаковывается resolvconf (1.79ubuntu10.18.04.3) …
Настраивается пакет resolvconf (1.79ubuntu10.18.04.3) …
Created symlink /etc/systemd/system/sysinit.target.wants/resolvconf.service → /lib/systemd/system/resolvconf.service.
Created symlink /etc/systemd/system/systemd-resolved.service.wants/resolvconf-pull-resolved.path → /lib/systemd/system/resolvconf-pull-resolved.path.
resolvconf-pull-resolved.service is a disabled or a static unit, not starting it.
resolvconf-pull-resolved.service is a disabled or a static unit, not starting it.
Обрабатываются триггеры для systemd (237-3ubuntu10.39) …
Обрабатываются триггеры для man-db (2.8.3-2ubuntu0.1) …
Обрабатываются триггеры для ureadahead (0.100.0-21) …
ureadahead will be reprofiled on next reboot
Обрабатываются триггеры для resolvconf (1.79ubuntu10.18.04.3) …
После установки пакета проверяем запуск сервиса. Проверяем подключение:
[my@my-wrk-lnv ~]$ sudo wg
interface: wg-client
public key: xxKBcZlhZlbjW7yFuhZ08l294HBAp2I/iM05YE8vs0Y=
private key: (hidden)
listening port: 45757
peer: 1YVx+x3C817V9YdhUtpUhzyDLVj5tnK2m//WjFGynm4=
endpoint: 193.0.174.159:16631
allowed ips: 172.16.82.1/32, 192.168.22.0/24
transfer: 0 B received, 148 B sent
persistent keepalive: every 5 seconds
Для проверки доступности сервера можно выполнить отправку ICMP-пакетов до IP-адреса:
[my@my-wrk-lnv ~]$ ping -c 10 -s 100 192.168.22.1
PING 192.168.22.1 (192.168.22.1) 100(128) bytes of data.
108 bytes from 192.168.22.1: icmp_seq=1 ttl=64 time=6.76 ms
108 bytes from 192.168.22.1: icmp_seq=2 ttl=64 time=6.70 ms
108 bytes from 192.168.22.1: icmp_seq=3 ttl=64 time=6.63 ms
108 bytes from 192.168.22.1: icmp_seq=4 ttl=64 time=6.84 ms
108 bytes from 192.168.22.1: icmp_seq=5 ttl=64 time=6.57 ms
108 bytes from 192.168.22.1: icmp_seq=6 ttl=64 time=6.24 ms
108 bytes from 192.168.22.1: icmp_seq=7 ttl=64 time=9.92 ms
108 bytes from 192.168.22.1: icmp_seq=8 ttl=64 time=9.75 ms
108 bytes from 192.168.22.1: icmp_seq=9 ttl=64 time=5.77 ms
108 bytes from 192.168.22.1: icmp_seq=10 ttl=64 time=7.03 ms
--- 192.168.22.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9014ms
rtt min/avg/max/mdev = 5.778/7.225/9.920/1.349 ms
8. Для отключения автоматического запуска WireGuard-подключения, при загрузке ОС через систему инициализации Systemd, потребуется ввести следующую команду:
[my@my-wrk-lnv ~]$ sudo systemctl disable wg-quick@wg-client.service
Removed /etc/systemd/system/multi-user.target.wants/wg-quick@wg-client.service
9. Для остановки WireGuard-подключения потребуется ввести следующую команду:
[my@my-wrk-lnv ~]$ sudo systemctl stop wg-quick@wg-client.service
Настройка завершена.
Вариант установки и настройки в Сетевых соединениях (Networkmanager)
Networkmanager GUI — графическая оболочка программы для управления сетевыми соединениями.
Краткая последовательность команд:
git clone https://github.com/max-moser/network-manager-wireguard
cd network-manager-wireguard
./autogen.sh --without-libnm-glib
./configure --without-libnm-glib --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/NetworkManager --localstatedir=/var
make
sudo make install
NOTE: Важно! Если установка плагина не завершается удачно или не хватает нужных пакетов для установки плагина, выполните:
sudo apt install wireguard git dh-autoreconf libglib2.0-dev intltool build-essential libgtk-3-dev libnma-dev libsecret-1-dev network-manager-dev resolvconf
Подробная последовательность команд:
1. Клонируем код плагина из репозитория Github:
[my@my-wrk-lnv ~]$ git clone https://github.com/max-moser/network-manager-wireguard
Клонирование в «network-manager-wireguard»…
remote: Enumerating objects: 534, done.
remote: Total 534 (delta 0), reused 0 (delta 0), pack-reused 534
Получение объектов: 100% (534/534), 748.39 KiB | 3.55 MiB/s, готово.
Определение изменений: 100% (317/317), готово.
2. Переходим в директорию network-manager-wireguard и компилируем плагин для графический настройки Wireguard-туннеля:
[my@my-wrk-lnv ~]$ cd network-manager-wireguard
[my@my-wrk-lnv network-manager-wireguard](master)$ ./autogen.sh --without-libnm-glib
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
configure.ac:19: installing './compile'
configure.ac:19: installing './config.guess'
configure.ac:19: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '1000' is supported by ustar format... yes
checking whether GID '1000' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking for gcc-ar... gcc-ar
checking for gcc-ranlib... gcc-ranlib
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... (cached) gcc-ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for glib-compile-resources... /usr/bin/glib-compile-resources
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for mode_t... yes
checking for pid_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for working memcmp... yes
checking for select... yes
checking for socket... yes
checking for uname... yes
checking for library containing dlopen... -ldl
checking whether NLS is requested... yes
checking for intltool >= 0.35... 0.51.0 found
checking for intltool-update... /usr/bin/intltool-update
checking for intltool-merge... /usr/bin/intltool-merge
checking for intltool-extract... /usr/bin/intltool-extract
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for perl... /usr/bin/perl
checking for perl >= 5.8.1... 5.26.1
checking for XML::Parser... ok
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... yes
checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... (cached) /usr/bin/msgfmt
checking for dcgettext... yes
checking if msgfmt accepts -c... yes
checking for gmsgfmt... (cached) /usr/bin/msgfmt
checking for xgettext... (cached) /usr/bin/xgettext
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for GTK... yes
checking for LIBNMA... yes
checking for LIBSECRET... yes
checking for LIBNM... yes
checking for more warnings... yes
checking whether -Wunknown-warning-option works as expected... not supported
checking whether "-Wextra" works as expected... yes
checking whether "-Wdeclaration-after-statement" works as expected... yes
checking whether "-Wfloat-equal" works as expected... yes
checking whether "-Wformat-nonliteral" works as expected... yes
checking whether "-Wformat-security" works as expected... yes
checking whether "-Wimplicit-fallthrough" works as expected... yes
checking whether "-Wimplicit-function-declaration" works as expected... yes
checking whether "-Winit-self" works as expected... yes
checking whether "-Wlogical-op" works as expected... yes
checking whether "-Wmissing-declarations" works as expected... yes
checking whether "-Wmissing-include-dirs" works as expected... yes
checking whether "-Wmissing-prototypes" works as expected... yes
checking whether "-Wpointer-arith" works as expected... yes
checking whether "-Wshadow" works as expected... yes
checking whether "-Wshift-negative-value" works as expected... yes
checking whether "-Wstrict-prototypes" works as expected... yes
checking whether "-Wundef" works as expected... yes
checking whether "-Wno-duplicate-decl-specifier" works as expected... yes
checking whether "-Wno-format-truncation" works as expected... yes
checking whether "-Wno-format-y2k" works as expected... yes
checking whether "-Wno-missing-field-initializers" works as expected... yes
checking whether "-Wno-pragmas" works as expected... yes
checking whether "-Wno-sign-compare" works as expected... yes
checking whether "-Wno-unused-but-set-variable" works as expected... yes
checking whether "-Wno-unused-parameter" works as expected... yes
checking whether -Wunknown-attributes works as expected... not supported
checking whether -Wtypedef-redefinition works as expected... not supported
checking whether -Warray-bounds works as expected... yes
checking whether -Wparentheses-equality works as expected... not supported
checking whether -Wunused-value works as expected... yes
checking whether -Wmissing-braces works as expected... no
checking if gcc supports flag -fdata-sections -ffunction-sections -Wl,--gc-sections in envvar CFLAGS... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing po/stamp-it commands
Build configuration:
--with-gnome=yes
--with-libnm-glib=no
--enable-absolute-paths=no
--enable-more-warnings=yes
--enable-lto=no
--enable-ld-gc=yes
[my@my-wrk-lnv network-manager-wireguard](master)$ ./configure --without-libnm-glib --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/NetworkManager --localstatedir=/var
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '1000' is supported by ustar format... yes
checking whether GID '1000' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking for gcc-ar... gcc-ar
checking for gcc-ranlib... gcc-ranlib
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... (cached) gcc-ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for glib-compile-resources... /usr/bin/glib-compile-resources
checking for ANSI C header files... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for mode_t... yes
checking for pid_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for working memcmp... yes
checking for select... yes
checking for socket... yes
checking for uname... yes
checking for library containing dlopen... -ldl
checking whether NLS is requested... yes
checking for intltool >= 0.35... 0.51.0 found
checking for intltool-update... /usr/bin/intltool-update
checking for intltool-merge... /usr/bin/intltool-merge
checking for intltool-extract... /usr/bin/intltool-extract
checking for xgettext... /usr/bin/xgettext
checking for msgmerge... /usr/bin/msgmerge
checking for msgfmt... /usr/bin/msgfmt
checking for gmsgfmt... /usr/bin/msgfmt
checking for perl... /usr/bin/perl
checking for perl >= 5.8.1... 5.26.1
checking for XML::Parser... ok
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... yes
checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... (cached) /usr/bin/msgfmt
checking for dcgettext... yes
checking if msgfmt accepts -c... yes
checking for gmsgfmt... (cached) /usr/bin/msgfmt
checking for xgettext... (cached) /usr/bin/xgettext
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for GTK... yes
checking for LIBNMA... yes
checking for LIBSECRET... yes
checking for LIBNM... yes
checking for more warnings... yes
checking whether -Wunknown-warning-option works as expected... not supported
checking whether "-Wextra" works as expected... yes
checking whether "-Wdeclaration-after-statement" works as expected... yes
checking whether "-Wfloat-equal" works as expected... yes
checking whether "-Wformat-nonliteral" works as expected... yes
checking whether "-Wformat-security" works as expected... yes
checking whether "-Wimplicit-fallthrough" works as expected... yes
checking whether "-Wimplicit-function-declaration" works as expected... yes
checking whether "-Winit-self" works as expected... yes
checking whether "-Wlogical-op" works as expected... yes
checking whether "-Wmissing-declarations" works as expected... yes
checking whether "-Wmissing-include-dirs" works as expected... yes
checking whether "-Wmissing-prototypes" works as expected... yes
checking whether "-Wpointer-arith" works as expected... yes
checking whether "-Wshadow" works as expected... yes
checking whether "-Wshift-negative-value" works as expected... yes
checking whether "-Wstrict-prototypes" works as expected... yes
checking whether "-Wundef" works as expected... yes
checking whether "-Wno-duplicate-decl-specifier" works as expected... yes
checking whether "-Wno-format-truncation" works as expected... yes
checking whether "-Wno-format-y2k" works as expected... yes
checking whether "-Wno-missing-field-initializers" works as expected... yes
checking whether "-Wno-pragmas" works as expected... yes
checking whether "-Wno-sign-compare" works as expected... yes
checking whether "-Wno-unused-but-set-variable" works as expected... yes
checking whether "-Wno-unused-parameter" works as expected... yes
checking whether -Wunknown-attributes works as expected... not supported
checking whether -Wtypedef-redefinition works as expected... not supported
checking whether -Warray-bounds works as expected... yes
checking whether -Wparentheses-equality works as expected... not supported
checking whether -Wunused-value works as expected... yes
checking whether -Wmissing-braces works as expected... no
checking if gcc supports flag -fdata-sections -ffunction-sections -Wl,--gc-sections in envvar CFLAGS... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating po/Makefile.in
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing po/stamp-it commands
Build configuration:
--with-gnome=yes
--with-libnm-glib=no
--enable-absolute-paths=no
--enable-more-warnings=yes
--enable-lto=no
--enable-ld-gc=yes
[my@my-wrk-lnv network-manager-wireguard](master)$ make
XMLLINT not set and xmllint not found in path; skipping xml preprocessing.
make all-recursive
make[1]: вход в каталог «/home/my/network-manager-wireguard»
XMLLINT not set and xmllint not found in path; skipping xml preprocessing.
Making all in .
make[2]: вход в каталог «/home/my/network-manager-wireguard»
XMLLINT not set and xmllint not found in path; skipping xml preprocessing.
CC shared/nm-utils/src_libnm_utils_la-nm-shared-utils.lo
In file included from ./shared/nm-default.h:49:0,
from shared/nm-utils/nm-shared-utils.c:22:
/usr/include/libnm/nm-version.h:155:30: warning: "NM_VERSION_1_10_14" is not defined, evaluates to 0 [-Wundef]
#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_10_14
^~~~~~~~~~~~~~~~~~
CC shared/src_libnm_utils_la-utils.lo
In file included from shared/nm-default.h:49:0,
from shared/utils.c:22:
/usr/include/libnm/nm-version.h:155:30: warning: "NM_VERSION_1_10_14" is not defined, evaluates to 0 [-Wundef]
#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_10_14
^~~~~~~~~~~~~~~~~~
CCLD auth-dialog/nm-wireguard-auth-dialog
ITMRG appdata/network-manager-wireguard.metainfo.xml
GEN nm-wireguard-service.name
make[2]: выход из каталога «/home/my/network-manager-wireguard»
Making all in po
make[2]: вход в каталог «/home/my/network-manager-wireguard/po»
MSGFMT de.gmo
MSGFMT en_GB.gmo
make[2]: выход из каталога «/home/my/network-manager-wireguard/po»
make[1]: выход из каталога «/home/my/network-manager-wireguard»
[my@my-wrk-lnv network-manager-wireguard](master)$ sudo make install
[sudo] пароль для my:
XMLLINT not set and xmllint not found in path; skipping xml preprocessing.
Making install in .
make[1]: вход в каталог «/home/my/network-manager-wireguard»
XMLLINT not set and xmllint not found in path; skipping xml preprocessing.
make[2]: вход в каталог «/home/my/network-manager-wireguard»
XMLLINT not set and xmllint not found in path; skipping xml preprocessing.
/bin/mkdir -p '/usr/lib/NetworkManager'
/bin/bash ./libtool --mode=install /usr/bin/install -c src/nm-wireguard-service auth-dialog/nm-wireguard-auth-dialog '/usr/lib/NetworkManager'
libtool: install: /usr/bin/install -c src/nm-wireguard-service /usr/lib/NetworkManager/nm-wireguard-service
libtool: install: /usr/bin/install -c auth-dialog/nm-wireguard-auth-dialog /usr/lib/NetworkManager/nm-wireguard-auth-dialog
/bin/mkdir -p '/usr/share/appdata'
/usr/bin/install -c -m 644 appdata/network-manager-wireguard.metainfo.xml '/usr/share/appdata'
/bin/mkdir -p '/etc/dbus-1/system.d'
/usr/bin/install -c -m 644 nm-wireguard-service.conf '/etc/dbus-1/system.d'
/bin/mkdir -p '/usr/lib/NetworkManager/VPN'
/usr/bin/install -c -m 644 nm-wireguard-service.name '/usr/lib/NetworkManager/VPN'
/bin/mkdir -p '/usr/lib/x86_64-linux-gnu/NetworkManager'
/bin/bash ./libtool --mode=install /usr/bin/install -c properties/libnm-vpn-plugin-wireguard.la properties/libnm-vpn-plugin-wireguard-editor.la '/usr/lib/x86_64-linux-gnu/NetworkManager'
libtool: install: /usr/bin/install -c properties/.libs/libnm-vpn-plugin-wireguard.so /usr/lib/x86_64-linux-gnu/NetworkManager/libnm-vpn-plugin-wireguard.so
libtool: install: /usr/bin/install -c properties/.libs/libnm-vpn-plugin-wireguard.lai /usr/lib/x86_64-linux-gnu/NetworkManager/libnm-vpn-plugin-wireguard.la
libtool: install: /usr/bin/install -c properties/.libs/libnm-vpn-plugin-wireguard-editor.so /usr/lib/x86_64-linux-gnu/NetworkManager/libnm-vpn-plugin-wireguard-editor.so
libtool: install: /usr/bin/install -c properties/.libs/libnm-vpn-plugin-wireguard-editor.lai /usr/lib/x86_64-linux-gnu/NetworkManager/libnm-vpn-plugin-wireguard-editor.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/lib/x86_64-linux-gnu/NetworkManager
done
installing de.gmo as /usr/share/locale/de/LC_MESSAGES/NetworkManager-wireguard.mo
installing en_GB.gmo as /usr/share/locale/en_GB/LC_MESSAGES/NetworkManager-wireguard.mo
make[1]: выход из каталога «/home/my/network-manager-wireguard/po»
3. Перезагружаем компьютер и проверяем доступность настройки Wireguard в панели Сетевые соединения:
Настройка подключения к Wireguard-серверу:
1. Генерируем приватный и публичные ключ, как описано в "Варианте установки и настройки в терминале" (2-й пункт настройки).
Если ключи ранее были сгенерированы в системе, то потребуется посмотреть их в терминале и скопировать в буфер обмена по очереди:
[my@my-wrk-lnv wireguard]$ sudo cat private-key
0CwJzxW0yOG4I9XWl9Wo9nzpxen2G0VlTAxD7XEBVmE=
[my@my-wrk-lnv wireguard]$ sudo cat public-key
M2LeCzN8mFLpa6Xz3BNHFgtNt8kY4wluiwt+NJFTgxk=
2. Копируем private-key и вставляем в настройки туннеля, в поле Private Key:
В поле Address (IPv4) интерфейса клиента указываем IP-адрес, в формате IP/bitmask — 172.16.82.8/24 (это внутренний адрес туннеля). Можно использовать другую подсеть, при этом её следует выбрать из частного диапазона адресов и избежать наложения с другими, настроенными на данных устройствах подсетями.
3. Копируем public-key и вставляем в настроенном ранее WireGuard-сервере, в поле Публичный ключ.
В поле "Разрешенные подсети" указываем адрес, трафик с которого будет допущен до сервера в формате IP/bitmask — 172.16.82.8/32
4. В поле "Public Key" вставьте публичный ключ сервера, который можно скопировать в буфер обмена компьютера из настроек WireGuard в веб-интерфейсе роутера:
В поле "Allowed IPs" указываем разрешенные IP-адреса, в формате IP/bitmask — 172.16.82.1/32 (это внутренний адрес сервера) и 192.168.22.0/24 (адрес локального сегмента роутера Keenetic).
В поле "Endpoint" указываем публичный IP-адрес или доменное имя WireGuard-сервера, и порт прослушивания, на который будет устанавливать связь WireGuard-клиент.
В поле "PersistentKeepalive" указываем периодичность попыток проверки доступности удаленной стороны соединения. Обычно, достаточно 3-5-секундного интервала между проверками.
5. Во вкладе Параметры IPv4 нажимаем Маршруты и добавляем маршрут до сети локального сегмента роутера Keenetic:
6. Подключаемся к Wireguard-серверу и если туннель установится удачно, будет сообщение:
Для проверки доступности сервера можно выполнить отправку ICMP-пакетов до IP-адреса локального сегмента роутера Keenetic:
[my@my-wrk-lnv ~]$ ping -c 10 -s 100 192.168.22.1
PING 192.168.22.1 (192.168.22.1) 100(128) bytes of data.
108 bytes from 192.168.22.1: icmp_seq=1 ttl=64 time=5.40 ms
108 bytes from 192.168.22.1: icmp_seq=2 ttl=64 time=6.60 ms
108 bytes from 192.168.22.1: icmp_seq=3 ttl=64 time=7.99 ms
108 bytes from 192.168.22.1: icmp_seq=4 ttl=64 time=7.04 ms
108 bytes from 192.168.22.1: icmp_seq=5 ttl=64 time=6.31 ms
108 bytes from 192.168.22.1: icmp_seq=6 ttl=64 time=7.42 ms
108 bytes from 192.168.22.1: icmp_seq=7 ttl=64 time=6.55 ms
108 bytes from 192.168.22.1: icmp_seq=8 ttl=64 time=7.14 ms
108 bytes from 192.168.22.1: icmp_seq=9 ttl=64 time=8.47 ms
108 bytes from 192.168.22.1: icmp_seq=10 ttl=64 time=7.52 ms
--- 192.168.22.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9015ms
rtt min/avg/max/mdev = 5.402/7.049/8.470/0.834 ms