Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Network settings from Python/Django on a Linux/Ubuntu machine

I'm working on a simple web interface for an embedded computer. The computer will ship with a static default ip that will then need to be updated by the install tech who may not be tech/linux savvy.

Basicly I need to change the following system settings from a Django app.

  1. IP Addres
  2. Subnet
  3. Default Gateway
  4. DNS Servers 1&2

I realize that I can could just overwrite the config files in linux but I was wondering if there is a more "Python" way of doing it.

like image 530
Kerry Hatcher Avatar asked Jan 21 '23 00:01

Kerry Hatcher


1 Answers

Have a look at pynetlinux on Github:

https://github.com/rlisagor/pynetlinux

It is a good starting point and you can add the remaining functionality yourself quite easily I would imagine.

like image 117
AJ. Avatar answered Jan 22 '23 12:01

AJ.