You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -13,6 +13,39 @@ The ``OpenWrt`` backend allows to generate OpenWRT compatible configurations.
13
13
and it is the default configuration system installed on `OpenWRT <http://openwrt.org>`_
14
14
and its fork `LEDE <https://www.lede-project.org/>`_.
15
15
16
+
.. important::
17
+
18
+
OpenWrt introduced a new syntax for defining interfaces in `OpenWrt 21 <https://openwrt.org/releases/21.02/notes-21.02.0#new_network_configuration_syntax_and_boardjson_change>`_.
19
+
By default, the netjsonconfig library generates configuration in the new syntax.
20
+
If you want to generate configuration in the legacy syntax (OpenWrt <=19), then
21
+
set ``dsa=False`` while instantiating object of ``netjsonconfig.OpenWrt`` class.
22
+
23
+
.. code-block:: python
24
+
25
+
>>>from netjsonconfig import OpenWrt
26
+
>>>
27
+
>>> o = OpenWrt(
28
+
...config= {
29
+
..."interfaces": [
30
+
... {
31
+
..."name": "eth0",
32
+
..."type": "ethernet",
33
+
..."addresses": [
34
+
... {
35
+
..."proto": "dhcp",
36
+
..."family": "ipv4"
37
+
... }
38
+
... ]
39
+
... }
40
+
... ]
41
+
... },
42
+
...dsa=False, # This will generate configuration in legacy syntax
43
+
... )
44
+
45
+
The examples present in this documentation only demonstrates configuration
46
+
in new syntax. Refer `older documentation versions <https://netjsonconfig.openwisp.org/en/1.0.0a-pre-dsa/backends/openwrt.html>`_
47
+
to check examples of old syntax.
48
+
16
49
Initialization
17
50
--------------
18
51
@@ -308,6 +341,39 @@ also supports the following custom options for every type of interface:
OpenWrt introduced a new syntax for defining interfaces in `OpenWrt 21 <https://openwrt.org/releases/21.02/notes-21.02.0#new_network_configuration_syntax_and_boardjson_change>`_.
347
+
By default, the netjsonconfig library generates configuration in the new syntax.
348
+
If you want to generate configuration in the legacy syntax (OpenWrt <=19), then
349
+
set ``dsa=False`` while instantiating object of ``netjsonconfig.OpenWrt`` class.
350
+
351
+
.. code-block:: python
352
+
353
+
>>>from netjsonconfig import OpenWrt
354
+
>>>
355
+
>>> o = OpenWrt(
356
+
...config= {
357
+
..."interfaces": [
358
+
... {
359
+
..."name": "eth0",
360
+
..."type": "ethernet",
361
+
..."addresses": [
362
+
... {
363
+
..."proto": "dhcp",
364
+
..."family": "ipv4"
365
+
... }
366
+
... ]
367
+
... }
368
+
... ]
369
+
... },
370
+
...dsa=False, # This will generate configuration in legacy syntax
371
+
... )
372
+
373
+
The examples present in this documentation only demonstrates configuration
374
+
in new syntax. Refer `older documentation versions <https://netjsonconfig.openwisp.org/en/1.0.0a-pre-dsa/backends/openwrt.html>`_
375
+
to check examples of old syntax.
376
+
311
377
In the following sections some examples of the most common use cases are shown.
312
378
313
379
Loopback interface example
@@ -530,18 +596,47 @@ Will be rendered as follows::
530
596
Bridge settings
531
597
---------------
532
598
533
-
Interfaces of type ``bridge`` can contain a few options that are specific for network bridges:
534
-
535
-
* ``bridge_members``: interfaces that are members of the bridge
536
-
* ``stp``: spanning tree protocol
599
+
Interfaces of type ``bridge`` contains options that are specific for network bridges.
537
600
538
601
The ``OpenWrt`` backend NetJSON extensions for bridge interfaces:
0 commit comments