SetNet


<<Back home

WTF?

I have always hated bloated software, I have never been happy with any TUI (Text-based User Interface) tool for ethernet and wi-fi network configuration under GNU/Linux --let alone GUIs for network configuration-- and I have always ended up using a mixture of small shell scripts, simple (yet repetitive) commands, and a lot of swearing around.
So I decided to give it a try, and put together a simple tool for network configuration. The result is setnet, a 1300 SLOC shell script with a dialog UI to configure ethernet and wifi connections. At the moment, setnet is able to configure:

Moreover, setnet can be used for simple network diagnosis tasks, e.g., ping, DNS queries, printout of ARP and routing tables, etc.

setnet is meant to be a POSIX-compliant shell script, and has been tested with bash, busybox, dash, ksh, mksh, posh, yash, and zsh. It should still be considered beta software, so please use it AT YOUR OWN RISK.

Downloads

The current stable version is setnet.sh 0.4 (20180503).
Clone the latets sources from: https://git.katolaz.net/setnet
or get the deb package: Please read the ChangeLog for more information, or the man page

Previous versions

Dependencies

In order to run setset, you MUST satisfy this (relatively small) set of dependencies: Most of those tools might already be installed in your system anyway. In particular, setnet uses: In order to use the full set of functionalities provided by setnet, you MIGHT also need the following packages: Again, most of them should be already installed in your system anyway.

Usage

Be default, setnet is installed under /usr/sbin/setnet.sh. If invoked with "-h", it provides a list of supported options:
$ ./setnet.sh -h
Usage: setnet.sh [OPTION]
Options:
         -c cfg_file    Load configuration from cfg_file.
         -d trace_file  Set debugging mode and dump all dialog traces to trace_file
	 -v  Print version number and exit.
         -h  Show this help.
$

If the argument "-c" is specified, setnet will use the provided configuration file. Otherwise, it will look for its configuration file in one of the following locations:

  - /etc/setnetrc
  - ~/.setnetrc

in the given order. The following configuration variables should be defined in setnetrc:

root vs. mortal users

Networking is an amdinistration task, and as such should be performed by the host administrator, i.e., the user with UID 0 (normally called "root"). However, in many modern GNU/Linux systems it is customary to allow normal users to perform some administration tasks.

Be careful: allowing a regular user to act as root (using either sudo, or sup, or any other wizardry) is a potential security threat for your system. Do it at your own risk, and don't complain if anything goes wrong.
In particular, the current version of setnet has not been thoroughly tested against potential privilege escalation attacks.

There are at least two concrete possibilities to allow a regular user (in the following we call such user "fool") to configure network interfaces using setnet.

First approach: using sudo

If sudo is installed in your system, it is sufficient to add the following line:
  fool     ALL=NOPASSWD: /usr/sbin/setnet.sh
to the file /etc/sudoers, and the user "fool" will be able to run setnet.sh with effective UID 0 (i.e., as if it was root), by using the command:
[fool@host]$ sudo /usr/sbin/setnet.sh
and thus will be able to perform all the needed admin tasks to configure networking.

Second approach: using sup

If you are more paranoid about security, you should consider using sup, a small-is-beautiful tool for unix privilege escalation. Assuming that the UID of the user "fool" is 1000, it should be sufficient to add the directive:
{1000, -1, "setnet.sh", "/usr/sbin/setnet.sh", ""};
to your config.h before recompiling sup.

License

setnet is Free Software, and can be used and distributed under the terms of the GNU General Public License, either version 3 of the licence or, at your option, any later version.

Comments, suggestions, criticisms, and bug reports are welcome, and should be reported on the gitlab page of the project:

https://git.devuan.org/KatolaZ/setnet
(update 01/01/2021) Well, it looks like the page above does not exist any more. So if you have any comment, suggestion, criticism, or bug report, just send it to me via email.

setnet is also available on GitHub:

https://github.com/KatolaZ/setnet
but the GitHub repo is not updated frequently.

If you really want to contact me by email, the address to use is katolaz at freaknet dot org dot REMOVE dot DOTS.

HH

KatolaZ


DISCLAIMER: ALL THE SOFTWARE AVAILABLE FOR DOWNLOAD ON THIS PAGE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Last update: 2021-01-01