Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|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.

share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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