Configuring network settings from Python / Django on a Linux / Ubuntu machine

I am working on a simple web interface for an embedded computer. The computer will ship with a default static IP address, which then needs to be updated with installation technology, which may not be tech / Linux compatible.

Basically I need to change the following system settings from a Django application.

  • IP Addres
  • Subnet
  • Default gateway
  • DNS Servers 1 & 2

I understand that I can just overwrite the configuration files on Linux, but I was wondering if there is a way for Python to do this.

+4
source share
1 answer

Take a look at pynetlinux on Github:

https://github.com/rlisagor/pynetlinux

This is a good starting point, and you can easily add the remaining functionality to yourself that I could imagine.

+9
source

Source: https://habr.com/ru/post/1347926/


All Articles