@@ -376,7 +376,12 @@ Will be rendered as follows::
376376
377377 package network
378378
379- config interface 'eth0' option ifname 'eth0' option ip6addr 'fdb4:5f35:e8fd::1/48' option ipaddr '10.27.251.1' option netmask '255.255.255.0' option proto 'static'
379+ config interface 'eth0'
380+ option ifname 'eth0'
381+ option ip6addr 'fdb4:5f35:e8fd::1/48'
382+ option ipaddr '10.27.251.1'
383+ option netmask '255.255.255.0'
384+ option proto 'static'
380385
381386DNS servers and search domains
382387~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -431,7 +436,22 @@ Will return the following UCI output::
431436
432437 package network
433438
434- config interface 'eth0' option dns '10.11.12.13 8.8.8.8' option dns_search 'openwisp.org netjson.org' option ifname 'eth0' option ipaddr '192.168.1.1' option netmask '255.255.255.0' option proto 'static' config interface 'eth1' option dns_search 'openwisp.org netjson.org' option ifname 'eth1' option proto 'dhcp' config interface 'eth1_31' option ifname 'eth1.31' option proto 'none'
439+ config interface 'eth0'
440+ option dns '10.11.12.13 8.8.8.8'
441+ option dns_search 'openwisp.org netjson.org'
442+ option ifname 'eth0'
443+ option ipaddr '192.168.1.1'
444+ option netmask '255.255.255.0'
445+ option proto 'static'
446+
447+ config interface 'eth1'
448+ option dns_search 'openwisp.org netjson.org'
449+ option ifname 'eth1'
450+ option proto 'dhcp'
451+
452+ config interface 'eth1_31'
453+ option ifname 'eth1.31'
454+ option proto 'none'
435455
436456DHCP ipv6 ethernet interface
437457~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1815,6 +1835,141 @@ Will be rendered as follows::
18151835 option sysfs ' tp-link:blue:wlan2g'
18161836 option trigger ' phy0tpt'
18171837
1838+ DDNS settings
1839+ ------------ -
1840+
1841+ The ddns settings reside in the `` ddns`` key of the * configuration dictionary* ,
1842+ which is a custom NetJSON extension not present in the original NetJSON RFC .
1843+
1844+ The `` ddns`` key must contain a dictionary, the allowed keys are:
1845+
1846+ + -------------------- -+ -------- -+
1847+ | key name | type |
1848+ + ==================== =+ ======== =+
1849+ | `` upd_privateip`` | boolean |
1850+ + -------------------- -+ -------- -+
1851+ | `` ddns_dateformat`` | string |
1852+ + -------------------- -+ -------- -+
1853+ | `` ddns_rundir`` | string |
1854+ + -------------------- -+ -------- -+
1855+ | `` ddns_logdir`` | string |
1856+ + -------------------- -+ -------- -+
1857+ | `` ddns_loglines`` | integer |
1858+ + -------------------- -+ -------- -+
1859+ | `` use_curl`` | boolean |
1860+ + -------------------- -+ -------- -+
1861+ | `` providers`` | list |
1862+ + -------------------- -+ -------- -+
1863+
1864+ The `` providers`` key itself contains a list of dictionaries, the allowed keys are:
1865+
1866+ + -------------------- -+ -------- -+
1867+ | key name | type |
1868+ + ==================== =+ ======== =+
1869+ | `` enabled`` | boolean |
1870+ + -------------------- -+ -------- -+
1871+ | `` interface`` | string |
1872+ + -------------------- -+ -------- -+
1873+ | `` ip_source`` | string |
1874+ + -------------------- -+ -------- -+
1875+ | `` lookup_host`` | string |
1876+ + -------------------- -+ -------- -+
1877+ | `` domain`` | string |
1878+ + -------------------- -+ -------- -+
1879+ | `` username`` | string |
1880+ + -------------------- -+ -------- -+
1881+ | `` password`` | string |
1882+ + -------------------- -+ -------- -+
1883+ | `` service_name`` | string |
1884+ + -------------------- -+ -------- -+
1885+ | `` update_url`` | string |
1886+ + -------------------- -+ -------- -+
1887+ | `` update_script`` | string |
1888+ + -------------------- -+ -------- -+
1889+ | `` ip_network`` | string |
1890+ + -------------------- -+ -------- -+
1891+ | `` ip_url`` | string |
1892+ + -------------------- -+ -------- -+
1893+ | `` ip_interface`` | string |
1894+ + -------------------- -+ -------- -+
1895+ | `` ip_script`` | string |
1896+ + -------------------- -+ -------- -+
1897+ | `` use_syslog`` | integer |
1898+ + -------------------- -+ -------- -+
1899+ | `` use_logfile`` | boolean |
1900+ + -------------------- -+ -------- -+
1901+
1902+ The required keys are:
1903+
1904+ * `` enabled``
1905+ * `` interface``
1906+ * `` ip_source``
1907+ * `` lookup_host``
1908+ * `` domain``
1909+ * `` username``
1910+ * `` password``
1911+
1912+ For the function and meaning of each key consult the relevant
1913+ `OpenWrt documentation about ddns directives < https:// openwrt.org/ docs/ guide- user/ base- system/ ddns> ` _.
1914+
1915+ DDNS settings example
1916+ ~~~~~~~~~~~~~~~~~~~~
1917+
1918+ The following * configuration dictionary* :
1919+
1920+ .. code- block:: python
1921+
1922+ {
1923+ " ddns" : {
1924+ " ddns_logdir" : " /var/log/ddns" ,
1925+ " ddns_rundir" : " /var/run/ddns" ,
1926+ " use_curl" : false,
1927+ " upd_privateip" : false,
1928+ " ddns_dateformat" : " %F %R" ,
1929+ " ddns_loglines" : 250 ,
1930+ " providers" : [
1931+ {
1932+ " enabled" : true,
1933+ " lookup_host" : " myhost.dyndns.org" ,
1934+ " service_name" : " dyndns.org" ,
1935+ " domain" : " myhost.dyndns.org" ,
1936+ " username" : " myuser" ,
1937+ " password" : " mypassword" ,
1938+ " use_logfile" : true,
1939+ " ip_source" : " interface" ,
1940+ " ip_interface" : " pppoe-xdsl" ,
1941+ " use_syslog" : 2 ,
1942+ " interface" : " xdsl"
1943+ }
1944+ ],
1945+ }
1946+ }
1947+
1948+ Will be rendered as follows::
1949+
1950+ package ddns
1951+
1952+ config ddns ' global'
1953+ option ddns_logdir ' /var/log/ddns'
1954+ option ddns_rundir ' /var/run/ddns'
1955+ option use_curl ' 0'
1956+ option upd_privateip ' 0'
1957+ option ddns_dateformat ' %F %R'
1958+ option ddns_loglines ' 250'
1959+
1960+ config service ' myhost_dyndns_org'
1961+ option enabled ' 1'
1962+ option lookup_host ' myhost.dyndns.org'
1963+ option service_name ' dyndns.org'
1964+ option domain ' myhost.dyndns.org'
1965+ option username ' myuser'
1966+ option password ' mypassword'
1967+ option use_logfile ' 1'
1968+ option ip_source ' interface'
1969+ option ip_interface ' pppoe-xdsl'
1970+ option use_syslog ' 2'
1971+ option interface ' xdsl'
1972+
18181973Including custom options
18191974------------------------
18201975
0 commit comments