Are there any distribution-independent mechanisms for tasks like assigning static IP addresses, adding or deleting routes, etc and, then, also be able to persist the changes so made?

AFAIK, each Linux distro (Fedora, Ubuntu, etc) keeps its network settings in different file/dir structures, with maybe even different properties inside. While one can accomplish many things via commands like ifconfig, ip, route, etc from command-line I don't know how to persist/save their changes.


Perhaps the most direct way would be to put your configuration in a bash script, then run the script at login.

How you have the script run will be distro-dependent but the script itself can be used on any Linux distro.

| improve this answer | |
  • Don't know why I couldn't think of that! +1. – Harry May 26 '13 at 2:47

The netcf library is intended to provide API to configure network interfaces in a distribution-independent way, while still using the network configuration system provided by the distribution. Currently the upstream version of this library has backends for Red Hat, SUSE and Debian network configuration systems; there is also a Windows backend.

In addition to the C API, a command-line tool (ncftool) is available.

| improve this answer | |
  • I jumped at the existence of such a tool. However, when I issue ncftool list --all on Ubuntu 13.04, it is reporting only lo whereas ifconfig reports lo, eth0, and wlan0. So, not sure if there will other gotchas as well as I try to use this tool. Also, why don't distro- leads get together and make it available as a standard package and encourage its use? – Harry May 26 '13 at 2:45
  • Link is dead :( That sounded like an interesting program too. – YetAnotherRandomUser Dec 1 '18 at 1:02
  • @YetAnotherRandomUser Updated the link; there is still some activity in the git repo, but the last release was made on 2015-04-08. – Sergey Vlasov Dec 1 '18 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.