Как настроить ddns openwrt

Установка и настройка пакета ddns-scripts в OpenWrt

При регистрации в сервисе DynDNS пользователь получает доменное имя третьего уровня. Специальный клиент устанавливается на пользовательский компьютер, или уже установлен в другом сетевом устройстве, таком как веб-камера или роутер. Этот клиент постоянно отправляет информацию DNS-серверу сервиса DynDNS, тем самым сообщая о своём IP-адресе. Сервер службы DynDNS сохраняет последний IP пользователя, и при обращении к пользовательскому доменному имени, полученному при регистрации, перенаправляет запрос на этот IP.

Для получения удалённого доступа к своей сети из интернета, можно зарегистрировать домен на любом DynDNS сервисе и настроить роутер для работы с сервисом. В 2011 г. компания перестала регистрировать новые бесплатные аккаунты. Но можно получить 1 бесплатный например на https://www.dlinkddns.com/login.

Рассмотрим пример как установить пакет ddns-scripts на вашем устройстве под OpenWrt.

opkg update
opkg install ddns-scripts

Для того что бы его можно было настроить через веб интерфейс нужно установить пакет luci-app-ddns
opkg update
opkg install luci-app-ddns

Редактируем конфигурацию vi /etc/config/ddns

Инструкцию по установке прошивки OpenWrt множите найти у меня на блоге http://adatum.ru/2013/01/21/tplinl/

Правила перепечатки

Понравилась статья?
Лучшей наградой для меня будет ваш комментарий !

Источник

Настройка DDNS на OpenWrt

Привет! В этой статье описано как настроить DynDNS на устройстве с прошивкой OpenWrt через веб-интерфейс.

Первый шаг — подключиться к устройству по SSH. Для этого нужен любой терминальный клиент, например Putty. Если у вас его нет — то скачиваем и устанавливаем.

Открываем Putty, вводим IP адрес роутера, порт указываем 22 и нажимаем кнопку «Open»

Вводим имя пользователя для входа — root. Жмём «Enter» и вводим пароль, который вы задавали при первичной конфигурации.

Обновляем список пакетов командой:

Выполняем команду для установки сервиса динамических DNS:

Выполняем команду для возможности настройки DynDNS через веб-интерфейс

Перезагружаем роутер командой

После этого может появиться уведомление что устройство более не доступно. Закрываем Putty и открываем веб-интерфейс OpenWrt через любой браузер.

Переходим в Службы -> Dynamic DNS

Вводим любое имя и нажимаем добавить:

В качестве DynDNS провайдера я буду использовать бесплатный DuckDNS. Вы можете использовать любой другой провайдер, но настройка может немного отличаться.

Я зарегистрировался аккаунт на DuckDNS и зарегистрировал домен bugs-blog.duckdns.org. В дальнейшем мне понадобится пароль(токен) от аккаунта DuckDNS.

Перехожу в настройки «duckdns» на роутере и выставляю следующие параметры (скриншот ниже):

Также на вкладке «Timer Settings» можно изменить интервал проверки изменения IP. По умолчанию стоит 10 минут.

Послу установки всех параметров нажимаем «Сохранить и применить»

Источник

Настройка оборудования

Блог о модемах, роутерах и gpon ont терминалах.

Как настроить DynDNS на OpenWRT?!

Сервисами предоставления динамического DNS — Dynamic Network Services- уже пользуется множество людей. А с ростом количества видеорегистраторов и прочих приблуд, к которым надо иметь доступ из глобальной сети будет ещё больше. По праву самым популярным из них является DynDNS, хотя приведенная ниже инструкция подойдет и для многих других подобных сервисов — no-ip,changeip.com и т.п.

Последовательность действий. Первым делом Вам надо подключиться к консоли OpenWRT. Для этого надо подключиться к устройству по ssh. Если Вы уже настраивали до этого свой маршрутизатор самостоятельно, то у Вас уже должен быть установлен какой-нибудь терминальный клиент типа TeraTerm или Putty. Если нет — то скачиваем и устанавливаем, после чего подключаемся.

Имя пользователя для авторизации — root. Пароль Вы должны знать, так как он устанавливается пользователем ещё при базовой конфигурации. Первым делом обновляем список пакетов командой:

После чего ждем, пока он скачается и обновится:

После этого надо выполнить две вот такие команды:

opkg install ddns-scripts
opkg install luci-app-ddns

Первая служит для поддержки сервисов динамических DNS, а второй — модуль для настройки через веб-интерфейс Openwrt luCI.
После их установки заходим через веб-интерфейс в раздел «Services» => «Dynamic DNS»:

Ставим галочку «Enable». В списке «Service» выбираем один из поддерживаемых сервисов. В моем случае — это: dyndns.org.
В поле «Hostname» надо указать Ваше доменное имя, которое зарегистрировано на сервисе, а в поля «Username» и «Password» — соответственно имя пользователя и пароль, с которыми Вы там зарегистрированы.
Обратите внимание на поле «Source of IP address» — это выбор метода определения IP-адреса. В большинстве случаев самый оптимальный — «URL» и ниже — ссылка на онлайн-сервис проверки Вашего текущего ай-пи — checkip.dyndns.org.
Остальные параметры оставляем по умолчанию и нажимаем кнопку «Save & Apply».
После этого можно пробовать доступ из Интернета через доменное имя.

Примечание:
Вся текущая конфигурация сервиса находится в файле /etc/config/ddns. Если Вы — фанат консоли — можно настроить DynDNS на OpenWRT с её помощью.
Вот листинг файла с комментариями:

Источник

Как настроить ddns openwrt

Arduino в г. Харьков. Доставка

в любой город Украины

Читайте также:  Разветвитель rj45 не работает

(050) 6666-833 Леонид

(097) 96-77-668 Леонид

Работаем: понедельник — воскресенье

Все товары с активной кнопкой

КУПИТЬ есть в наличии.

Все цены актуальные.

  • Вы здесь:
  • Главная
  • Openwrt
  • dyndns на openwrt подключение в качестве wifi клиента.

dyndns на openwrt подключение в качестве wifi клиента.

У меня возникло желание иметь постоянный доступ к своей домашней сетке с любой точки мира. Домашний интернет я получаю по wifi через роутер друга к которому у меня нет полного доступа. На этом роутере динамический ip, а также настроен проброс портов под мои нужды. Вот и озадачился настройкой службы dyndns на своем dir-320 минуя роутер друга. Может кто-то скажет, что давно все разжевано, но не для моего случая. Итак приступим.

Устанавливаем службы dyndns

Заходим в web интерфейс и наблюдаем следующую вкладку, заполняем нужные нам поля.

Я настраивал определение интерфейса через URL, т.к. мои сетевые интерфейсы не выходят прямо в интернет и по ним я не могу определить внешний ip.

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

Путем копания в скриптах openwrt я понял, что запуск службы ddns в устройстве запускается скриптом /etc/hotplag.d/iface/25-ddns, который срабатывает в случае события ifup интерфейса. Для wan порта — это идеально, но для интернета по wifi в моем случае не работает,т.к. этот обновление ip происходит на роутере друга. Поэтому я начал искать решение.

Оказалось все довольно просто, хотя пришел я к этому не сразу, поначалу изобретал велосипед со скриптами и cron-ом.

Всего лишь надо указать нужный нам интерфейс в файле /etc/config/ddns

Я исправил wan, который я не использую на мой интерфейс wwan, который я присвоил wifi.

config ‘service’ ‘myddns’
option ‘interface’ ‘wwan’
option ‘service_name’ ‘dyndns.org’
option ‘force_interval’ ’72’
option ‘force_unit’ ‘hours’
option ‘check_interval’ ’10’
option ‘check_unit’ ‘minutes’
option ‘enabled’ ‘1’
option ‘domain’ ‘mysite.dyndns.org’
option ‘username’ ‘login_name’
option ‘password’ ‘dyndns’
option ‘ip_source’ ‘web’
option ‘ip_url’ ‘http://checkip.dyndns.org/’

Плохо что данная опция не выведена в веб интерфейс, было бы более прозрачно.

на всякий случай проверяем, появился ли скрипт ddns в процессах, потому как до проведения исправлений он просто не запускался

Источник

DDNS client configuration

The file /etc/config/ddns holds the configuration for ddns-scripts package.

Example

You find the newest version of full documented ddns.sample_config at GitHub.
Using all defaults the minimum settings are:

for IPv4 address

for IPv6 address

Supported since CC 15.05

Sections

Section «service»

You need to define a “service” section for every DDNS provider and Host you want to feed.
Same if you want to feed IPv4 — and IPv6 -address to your DDNS provider.
(Since CC 15.05)

Name
(old)
Name
(new)
Type Required Default Description
enabled boolean yes ‘0’ disable(0) / enable(1) this service section.
interface network name yes (none) The DDNS scripts use the Linux hotplug events system. When this specified network interface comes up, a related ifup hotplug event will cause DDNS script to start to monitor (and update) the external IP address of . Select the WAN interface that will have the external IP address to use in the DDNS registration.
use_ipv6 boolean no ‘0’ Including BB 14.07 no support of IPv6 protocol.
Since CC 15.05 decide if you want to update/send your current IPv4 (0) or IPv6 (1) address.
service_name string yes(*) (none) Which DDNS online service do you use?
Choose one from /usr/lib/ddns/services file.
Since CC 15.05 if option use_ipv6 is enabled(1) choose a service from /usr/lib/ddns/services_ipv6 file.
The latest versions can be downloaded from Github.com
(*) If your DDNS provider is not listed there, remove this option and use ‘option update_url ‘ or since CC 15.05 ‘option update_script ‘ instead.
update_url string yes(*) (none) Have a look at DDNS providers configuration help. Use the their URL here.
(*) Remove this option, if ‘option service_name ‘ is set.
update_script string no (none) Since CC 15.05 /path/to/update_script.sh
If your DDNS provider doesn’t work with ddns-scripts, because there are additional parameters or other special thinks to be done, then you could write your own script to send updates to your DDNS provider.
Have a look into update_sample.sh
Remove ‘option service_name ‘ and use either this option OR ‘option update_url ‘.
domain string yes (none) The DNS name / Hostname to update
(this name must already be registered with the DDNS provider)
If your DDNS provider don’t need this information being send for update, put it in anyway. ddns-scripts use it to compare local IP with registered IP .
Since DD ddns-scripts use ‘option lookup_host ‘ (see below) to detect your registered IP .
So this option can be used for special multihost update configurations supported by some providers.
username string yes(*) (none) Username of your DDNS providers account
Have a look at DDNS providers help, because some providers are using different information as “username” for DDNS updates (i.e. hostname).
Look at DDNS client for additional information.
(*)If your DDNS provider don’t need this information being send for update, put in an “X” instead.
password string yes(*) (none) Password of your DDNS providers account
Have a look at DDNS providers help, because some providers are using different information as “password” for DDNS updates (i.e. tokenid).
Look at DDNS client for additional information.
(*)If your DDNS provider don’t need this information being send for update, put in an “X” instead.
use_https boolean no ‘0’ disable(0) / enable(1) the use of HTTPS for secure communication with your DDNS provider.
Some providers having problems, when not sending updates via HTTPS .
You must NOT specify ‘http“s”:’, simply use ‘http:’ in update_url above, if used.
Needs “Wget” or “cURL” package being installed.
Look at DDNS client for additional information.
cacert string no(*) (none) /path/to/certificates directory or /path/to/certificate.crt file.
Package “ca-certificates” installs certificates to /etc/ssl/certs directory.
Look at DDNS client for additional information.
(*)required, if option use_https set to ‘1’ (enabled)
since CC 15.05 a value ‘IGNORE’ is supported.
This uses secure http for transfer, but do not verify the DDNS providers server certificate. (insecure)
ip_source string yes ‘network’ Defines the source to determine you local IP send to the DDNS provider.
Valid values are:
— ‘network’ uses/needs ‘option ip_network ‘
— ‘web’ uses/needs ‘option ip_url ‘
— ‘interface’ uses/needs ‘option ip_interface ‘
— ‘script’ uses/needs ‘option ip_script ‘
See details below.
ip_network string no(*) ‘wan’ Specify a network from your /etc/config/network file (e.g. “wan”) with the “ip_network” option. If you specify “wan”, you will send update with whatever the IP for your wan is.
(*)required, if option ip_source set to ‘network’
ip_url string no(*) (none) Detects the current local IP from specified webside that response with the IP address of calling host. If you are behind a firewall/NAT this is the best option since none of the local networks or interfaces will have the external IP .
The correct URL might depend on the DDNS provider being used. Check with the DDNS providers’s documentation to determine, if they offer this feature and, if so, what the correct URL is.
Sample: http://checkip.dyndns.org/ or http://checkipv6.dyndns.org/
(*)required, if value of option ip_source set to ‘web’
ip_interface string no(*) (none) Specify a locally installed physical (hardware) interfaces (e.g. ‘eth1’) to detect your current IP address, independent from network they configured to.
(*)required, if value of option ip_source set to ‘interface’
ip_script string no(*) (none) Useful, if you want to write your own script to detect your current local IP .
Put in full path ‘/path/to/script.sh’.
Have a look into getlocalip_sample.sh and Get IP from modem scripts collection
The script must be marked executable.
(*)required, if value of option ip_source set to ‘script’
check_interval number no ’10’ Defines the time interval to check if local IP has changed.
Accepted unit values: ‘seconds’ ‘minutes’ ‘hours’.
Checks below 5 minutes make no sense, because the DNS Servers in Internet needs about 5 minutes to sync.
either both options are set or not set.
check_unit string no ‘minutes’
force_interval number no ’72’ Force to send an update to service provider, if no IP change was detected. Consult DDNS providers documentation, if your DDNS entry might timeout.
Accepted unit values: ‘minutes’ ‘hours’ ‘days’
Minimum needs to be greater or equal check interval (see above).
either both options are set or not set.

since CC 15.05 a value ‘0’ is supported. This will stop script execution after one successful update.
force_unit string no ‘hours’
retry_interval number no ’60’ If error happen on detecting, sending or updating, the script will retry the relevant action.
Here you define the time to wait before retry is started.
Accepted unit values: ‘seconds’ ‘minutes’
either both options are set or not set.
retry_unit string no ‘seconds’
retry_count number no ‘0’ Since CC 15.05 Number of retries before the script terminates execution, when a communication error happen.
A setting of ‘0’ will retry infinite.
use_syslog boolean no ‘0’ Since BB 14.07 disable(0) / enable(1) logging events to syslog.
Since CC 15.05 Level of events logged to syslog:
0 == disable
1 == info, notice, warning, errors
2 == notice, warning, errors
3 == warning, errors
4 == errors
Critical errors forcing ddns-scripts to stop are always logged to syslog.
use_logfile boolean no ‘1’ Since CC 15.05 disable(0) / enable(1) logging to log file.
You find the file per default in /var/log/ddns/[sectionname].log
The path can be modified for all log files in section ‘ddns ‘ (see below)
dns_server string no (none) Since CC 15.05 Normally the current (in the internet) registered ip is detected using the local defined name lookup policies (i.e. /etc/resolve.conf etc.)
Specify here a DNS server to be used instead of the defaults.
You can use FQDN , hostname or IP address.
force_dnstcp boolean no ‘0’ Since CC 15.05 disable(0) / enable(1) DNS requests via TCP protocol.
By default every DNS call is made via UDP protocol. Some internet provider offer modems, caching UDP DNS requests. They redirect every request to external servers to local modem cache.
To force the usage of TCP for DNS requests enable this option.
Needs BIND host package to be installed.
proxy string no (none) Since CC 15.05 If a Proxy is need to access HTTP /HTTPS pages on the WEB, it can be configured here also for sending updates to the DDNS provider.
If you configured option use_https ‘1 ‘ above, you need to setup your HTTPS proxy here, otherwise your HTTP proxy.
You should not detect your current IP ( option ip_source ‘web ‘ above) because this request is also send via the configured proxy.
Syntax: [user:password@]proxy:port port is required !
IPv6 address must be in squared brackets ‘[…]’
force_ipversion boolean no ‘0’ Since CC 15.05 disable(0) / enable(1) this option.
Normally the system decide by various settings mostly compiled into the software, if it prefers IPv4 or IPv6 communication. Some DDNS providers update their DDNS record by using the IP address you send the update from.
Then you need to force the usage of the IP version you want to update or you want to force it for other reasons depending on your environment.
Needs Wget or cURL package and BIND host package to be installed !
bind_network string no (none) Since CC 15.05 Network to use for communication when detecting IP and sending updates.
Needs Wget or cURL package to be installed !
Wget will bind to the IP and cURL to physical interface of given network.
lookup_host string yes (none) Since DD Option domain (see above) is no longer used to get the registered ip. Configure here the host you like to get registered ip for. This is useful if updating multiple hosts in one configuration section.
rec_id string no (none) Since DD If this is set and the service is CloudFlare, updates the specified record (useful when there are multiple records for the same domain). Determined automatically when not set (but in case of multiple records for the same domain one will be arbitrarily chosen).
is_glue boolean no ‘0’ Since DD This option is mandatory if the ddns record is a glue record and the registered ip should be compared against the glue record. This option requires bind host and does only work if the dns_server option is used. The dns_server value has to be the dns server where the glue record is defined.

Section «ddns»

Supported since CC 15.05
It is NOT recommended for casual users to change this settings.
Only section name “global” is supported
This settings are used by ddns-scripts and corresponding luci-app-ddns .

Name
(old)
Name
(new)
Values Required Default Description
allow_local_ip upd_privateip boolean no ‘0’ disallow(0) / allow(1) to send Private/Special IP ‘s to the DDNS provider
blocked IPv4 : 0/8, 10/8, 100.64/10, 127/8, 169.254/16, 172.16/12, 192.168/16
blocked IPv6 : ::/32, f000::/4
date_format ddns_dateformat string no ‘%F %R’ set date format to use for display date in logfiles and LuCI WebUI.
For supported codes look here.
run_dir ddns_rundir string no ‘/var/run/ddns’ Set directory to use for ‘*.pid ‘ and ‘*.update ‘ files.
There are separate files for every running service section.
log_dir ddns_logdir string no ‘/var/log/ddns’ Set directory to use for ‘*.log ‘ files.
There are separate files for every running service section, if option use_logfile set to ‘1’ (enable) (see above).
log_lines ddns_loglines number no ‘250’ Set number of lines stored in .log file before auto truncated.
use_curl boolean no ‘0’ If Wget and cURL package are installed, Wget is used for communication by default.
Set to ‘1’ will use cURL instead.

Issues and known bugs

Wget 1.x does not work correctly when using multiple WAN interfaces (like with with mwan). Issue 8277

Reason: wget 1.x does not bind to an interface it can only change the IP address (bind-address)

Fix: use curl via use_curl

(Untested) wget2 (not released as of March 2021) has bind-interface support

Since somewhere June 2021 OpenDNS gives an error “badauth” when using Wget 1.x or uclient-fetch (the default for OpenWRT 21.02.0).

Reason: in order to work properly with OpenDNS, Wget 1.x requires the –auth-no-challenge option in its command line.

Fix: Install and use curl via use_curl = 1 option in the Global section

  • Last modified: 2021/09/06 17:12
  • by vgaetera

Self-registration in the wiki has been disabled.
If you want to contribute to the OpenWrt wiki, please post HERE in the forum or ask on IRC for access.

Except where otherwise noted, content on this wiki is licensed under the following license:
CC Attribution-Share Alike 4.0 International

Источник

Оцените статью