Skip to content

Latest commit

 

History

History
108 lines (79 loc) · 3.49 KB

README-template.md

File metadata and controls

108 lines (79 loc) · 3.49 KB

net

Super lightweight network manager.

Usage

RTFM:

#shell "./net help"

The simplest usage is probably connecting to a wireless network:

$ net connect MyWirelessNetwork MySecretPassphrase
Connecting to MyWirelessNetwork
Sending DHCP request
Address acquired: 192.168.1.42

Configuration

The file ~/.net.conf holds a list of configured networks (in YAML). An example is included in .net.conf.example:

#include "config.example"

Using this config file you can connect to my-home-network using the command:

$ net my-home-network

Notice that the section common does not define a network but rather settings common to all network configurations (in this case using Google's DNS servers, randomizing the MAC address and hostname [<name> will be replaced by an actual name] and connecting to a VPN).

The ignored and vpn sections do not define networks either. The ignored section contains a list of interfaces to be ignored by e.g. net stop and the vpn section contains the OpenVPN configurations for each VPN.

Installing

Put net in your PATH.

Bash completion

Put _net_bash_completion in your path and add the line

_net_bash_completion

to ~/.bash_completion.

Dependencies

Dependency Debian package
/bin/ip iproute2
/sbin/ethtool ethtool
/sbin/iw iw
/sbin/udhcpc udhcpc
/sbin/wpa_cli wpasupplicant
/sbin/wpa_supplicant wpasupplicant
/usr/bin/chattr e2fsprogs
/usr/bin/expand coreutils
/usr/bin/cut coreutils
/usr/bin/pkill procps
/usr/sbin/openvpn openvpn
/usr/bin/wg https://www.wireguard.com/install/
Python package yaml python3-yaml / PyPI pyyaml

It is also a good idea to uninstall resolvconf, as it overwrites the DNS settings.

udhcpc is part of the busybox suite, and can be installed, and used, on non-Debian systems, which doesn't have a separate package, by:

  • Install busybox with udhcpc compiled in
  • Hard-link busybox as udhcpc
# ln /bin/busybox /usr/local/bin/udhcpc
common:
  udhcpc-config: /etc/udhcpc/default.script

Bootstrapping

net will run even without udhcpc or python3-yaml, with limited functionality. In the former case information acquired via DHCP may not be reflected on the system, and in the latter the configuration file will not be used. However it may be enough to get online in order to fulfill the dependencies (tested on Debian 11).

Contributors

If you want to contribute, feel free to make a pull request on Github, please read CONTRIBUTING and the license first.

This project was originally developed by br0ns and TethysSvensson.

For a complete list; check the log.