简体   繁体   English

有没有可以配置网络接口IP地址的python包?

[英]Is there any python package that could configure IP address of network interface?

I am writing a server application which allow remote client to show/add/change/delete IP addresses of network interfaces of the machine where the host is running. 我正在编写一个服务器应用程序,允许远程客户端显示/添加/更改/删除运行主机的机器的网络接口的IP地址。

The OS is Linux(CentOS 5.2), so I could do that by simply parse and edit configure file. 操作系统是Linux(CentOS 5.2),所以我可以通过简单地解析和编辑配置文件来实现。 But is there any package that could simplify the job? 但是有没有可以简化工作的软件包?

And if there is none such package, if I open source my implementation, will that help other people? 如果没有这样的包,如果我开源我的实现,那会帮助其他人吗?

It looks like the open source project confparse should be able to easily do what you're looking for. 看起来开源项目confparse应该能够轻松地完成你正在寻找的东西。 In fact, one of their examples is parsing and modifying /etc/sysconfig/network-scripts/ifcfg-eth0 with ease. 事实上,他们的一个例子是轻松地解析和修改/etc/sysconfig/network-scripts/ifcfg-eth0

If you find this isn't what you need, I say that any efforts towards open sourcing software will inevitably help other people at some point, given that it is actually useful. 如果您发现这不是您所需要的,我说任何开源软件的努力都会在某些时候帮助其他人,因为它实际上是有用的。 ;) ;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 Python 中的 NIC(网络接口控制器)获取 IP 地址? - How can I get the IP address from a NIC (network interface controller) in Python? 如何使用Python boto判断AWS Elastic Network Interface(ENI)是否具有公共IP地址? - How to tell if AWS Elastic Network Interface (ENI) has a public IP address using Python boto? 在python中确定CONNECTED接口(linux)的IP地址 - Determine IP address of CONNECTED interface (linux) in python 如何在python中为接口分配IP地址? - How to assign IP address to interface in python? 使用 Python 检查来自 IP 地址的网络连接 - Check network connection from an IP address with Python 你如何获得给定网络接口的IP地址? - How do you get the IP address of a given network interface? 用 Python 获取连接接口的网络地址 - Get network address of connected interface with Python 如何在Linux中使用python更改wifi接口的IP地址? - How to change IP address of wifi interface using python in linux? 如何在 Python 中从此文本文件中获取接口名称和 IP 地址 - How to get interface name and IP address from this text file in Python Python:在 linux 中获取本地接口/IP 地址的默认网关 - Python: get default gateway for a local interface/ip address in linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM