OpenBSD networking configuration shell
Author and Founder of the project: Chris Cappuccio
NSH is a CLI intended for OpenBSD-based network appliances. It replaces ifconfig, sysctl and route with its own simple command language, and encapsulates configuration for other daemons into one place, effectively replacing /etc/netstart and parts of /etc/rc for appliance-style usage.
bgpd, dhcpd, dhcpleased, dhcrelay, dvmrpd, eigrpd, ftp-proxy, ifstated, inetd, iked, ipsecctl, ldapd, ldpd, npppd, ntpd, ospfd, ospf6d, pf, rad, relayd, resolvd, ripd, sasyncd, slaacd, smtpd, snmpd, sshd, tftpd, tftp-proxy.
NSH is freely licensed, in the BSD style.
In conjunction with the OpenBSD kernel and the daemons you wish to control, you have a fully functioning network appliance type of system.
See https://github.com/yellowman/nsh/wiki/NSH-Manual-page or nsh.8 manual for detailed installation instructions and command set.
nsh manual is available on your system shell by simply typing the command:
man nshFor your convenience we have included handy manual page search for commonly used network functionality.
this feature is available in nsh by simply typing the command:
manual [searchterm]E.g. searching vlan functionality
manual vlanThe system also gives a list of searchable terms through double tab completion.
See the to-do list on https://github.com/users/yellowman/projects/1 for details on implementation status and future ideas.
See http://github.com/yellowman/nsh/ for current source code repository. See http://www.nmedia.net/nsh/ for example configurations and mailing list.
See https://www.youtube.com/watch?v=9T9-v5NLjXk for a BSDCAN 2024 Presentation on Supporting Business IT and network needs with OpenBSD and NSH By: Tom Smyth
See https://www.youtube.com/watch?v=WMKxIHaWaG0 for an EurobsdCon 2022 Presentation on NSH for network administrators By: Tom Smyth
Install OpenBSD on your system by running the following commands in your system shell
Install the OpenBSD port of nsh on your system (this will install the latest nsh release version)
pkg_add nsh pkg_add gitgit clone https://github.com/yellowman/nshcd nshmakemake installTo have nsh take over the configuration of a system a number of steps that need to be carried out such as
Backup configuration of system, daemons and network in /etc
Copy the configuration files to /var/run/example-configfilename.0 (the .0 file extension) implies running in the default rdomain / rtable (rdomain 0)
save the running config to /etc/nshrc
secure the /etc/nshrc file so that world cannot read, write or execute it .
configure the system to run nsh -i /etc/nshrc either adding a line to /etc/rc.local or using an rccctl script for nsh.
For the users convenience, the above steps (9-13) can be largely automated by running the rc.local-nsh-openbsd-integrate.sh script in your system shell and following on screen instructions.
cd nsh
cd scripts/shell
sh ./rc.local-nsh-openbsd-integrate.shcd /usr/local/share/exampes/nsh
cd scripts/shell
sh ./rc.local-nsh-openbsd-integrate.shonce configuration has been imported, restart the system and verify nsh config is running as expected.
Setting NSH as the default shell for a user
chsh -s /usr/local/bin/nshNo open issues yet, or sync has not completed.