GSoC @ OpenWISP: Raspbian backend for OpenWISP 2

Project Description:

from netjsonconfig import Raspbiano = Raspbian({
"interfaces": [
{
"name": "eth0",
"type": "ethernet",
"addresses": [
{
"address": "192.168.1.1",
"mask": 24,
"proto": "static",
"family": "ipv4"
},
{
"address": "fd87::1",
"mask": 128,
"proto": "static",
"family": "ipv6"
}
]
}
]
})
print(o.render())
# config: /etc/network/interfacesauto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
iface eth0 inet6 static
address fd87::1
netmask 128
>>> import tarfile
>>> from netjsonconfig import Raspbian
>>>
>>> o = Raspbian({
... "interfaces": [
... {
... "name": "eth0",
... "type": "ethernet",
... "addresses": [
... {
... "proto": "dhcp",
... "family": "ipv4"
... }
... ]
... }
... ]
... })
>>> o.write('dhcp-pi', path='/tmp/')

Future Work:

  1. Adding support for Backward Conversion (http://bit.ly/2wTbmxZ)
  2. SSH deployment of configurations to the device

Important Links:

A Final Word

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store