Reputation: 785
I want to make ifconfig
parser and runner with Python
Beginning of this question, I want to use simple API like this.
import ifconfig
ifconfig.interfaces['eth0'].ip = '192.168.0.123' # run subprocess internally
But I don't know all linux-like OS.
So I choose using ifconfig
command. But I also don't know all linux-like OS support ifconfig
command.
Can I know what OS do not support ifconfig
basically and how to make it work? And they support same usage?
Upvotes: 0
Views: 120
Reputation: 3193
Maybe you are better off using ip
command instead. ip
is more generic and there are some distributions which don't include ifconfig
in their default configuration. For example ArchLinux
includes ifconfig
only because it might break some old scripts. Same for CentOS7 and RHEL7. It seems like ifconfig
will be outdated in a few years.
Take a look at wikipedia page for ifconfig it has good summery of the current use of ifconfig
among different systems.
So almost all Linux distributions include ifconfig
. But at least some straight forward distributions only for backward compatibility. ifconfig
support for other Unix like OS is quite good.
Upvotes: 1