News for hackers. Stuff that matters.
Re:Nsh, a unified router style CLI for OpenBSD by RedShift1 on Saturday April 09, 2022 @03:11AM (#30965838)
I would love to have this for an entire OS, not just networking. The ability to capture the entire OS configuration in one file would be amazing. OS upgrade? Get new box, install, copy one config file, boom done. It would also make comparing configurations between hosts so much easier, for example when trying to find out why something works on one box and not on another.
Re:Nsh, a unified router style CLI for OpenBSD by traceroute66 on Saturday April 09, 2022 @03:41AM (#30965979)
> I would love to have this for an entire OS, not just networking.

To be honest with OpenBSD its not that difficult, and I don't see the point of a tool like NSH for OpenBSD because its so easy to back up and restore all the routing daemon configs.

For your OpenBSD router average setup (from memory, forgive me if I missed something):

     - Copy /etc/rc.conf.local
     - Copy config files for daemons referred to in /etc/rc.conf.local
     - Copy /etc/hostname.if files
     - Copy /etc/mygate (if not using dynamic routing)
     - Copy /etc/resolv.conf
     - Copy /etc/pf.conf
You can also git your /etc of course.

For Linux, really the answer is to use Salt or another config tool to get repeatable configs.

Re:Nsh, a unified router style CLI for OpenBSD by SpaceInvader on Saturday April 09, 2022 @05:19AM (#30966442)
Yes, I agree with that. Recently I've switched my FreeBSD router to OpenBSD, getting it running is trivial and for backups - just few files needs to be rsyncd to my backup machine and that's it.
Re:Nsh, a unified router style CLI for OpenBSD by addingnumbers on Saturday April 09, 2022 @11:20AM (#30968803)
> I don't see the point of a tool like NSH for OpenBSD

I think the point is getting rid of this risk:

> ... forgive me if I missed something

Re:Nsh, a unified router style CLI for OpenBSD by traceroute66 on Saturday April 09, 2022 @02:07PM (#30970422)
> I think the point is getting rid of this risk:

What risk ?

If I am (for example) running an OpenBSD firewall or OpenBSD BGP router then there's nothing to forget. It really is as simple as I said it was.

The "forgive me if I forget" was because I wrote my answer from memory instead of looking at my actual script.

There really is absolutely zero need for NSH or any tool like it on OpenBSD if you're just running a router/firewall.

Re:Nsh, a unified router style CLI for OpenBSD by jlgaddis on Saturday April 09, 2022 @04:42PM (#30971856)
> You can also git your /etc of course.

You can and you should, in my opinion.

However, you really want to use "etckeeper" [0] to do that (as opposed to "maintaining" /etc as a git repo, manually, yourself).

---

ETA:

Seriously, look over etckeeper's README file [1] and/or man page [2]. Next, go read a couple articles or blog posts that describe "How-To store /etc in a git repository on debian linux" [3]. Then, if you're a sado-masochist, go ahead and actually try it that way for a while. Finally, install etckeeper, spend two minutes setting it up (if your packaging tool didn't do that for you automatically), and almost instantly regain your sanity!

---

[0]: http://etckeeper.branchable.com

[1]: http://etckeeper.branchable.com/README/

[2]: https://man.archlinux.org/man/etckeeper.8

[3]: http://hyperprog.com/howto/etc-git.html

Re:Nsh, a unified router style CLI for OpenBSD by INTPenis on Saturday April 09, 2022 @12:07PM (#30969232)
Agreed, in fact I have all of those in Ansible. I've been using OpenBSD as a home router for over a decade.

When I saw the first paragraph of the Nsh Github Readme my initial thought was "why?".

Re:Nsh, a unified router style CLI for OpenBSD by gforce_de on Saturday April 09, 2022 @05:50AM (#30966569)
This is what OpenWRT with the (u)nified (c)onfiguration (i)nterface aims:

  uci show
This outputs text, which is your full config.

https://openwrt.org/docs/guide-user/base-system/uci

Re:Nsh, a unified router style CLI for OpenBSD by scns on Saturday April 09, 2022 @04:40AM (#30966266)
Check out NixOs, it does exaxctly that.
Re:Nsh, a unified router style CLI for OpenBSD by traceroute66 on Saturday April 09, 2022 @05:18AM (#30966438)
> Check out NixOs, it does exaxctly that.

Yeah, but with a whole shidoodle of extra abstraction and complexity that people have to learn and manage.

The subject has been discussed at length on HN multiple times and (IIRC) the consensus is generally the same, the disadvantages introduced by the complexity of NixOs outweigh its benefits.

I'll stick to old-fashioned distros for now.

Re:Nsh, a unified router style CLI for OpenBSD by avgcorrection on Saturday April 09, 2022 @05:56AM (#30966599)
Well, you can’t blame someone for replying to

> I would love to have this for an entire OS, not just networking. The ability to capture the entire OS configuration in one file would be amazing.

When you can do exactly that with NixOS.

In my experience it’s not hard to set up a basic configuration on NixOS. But it’s too hard to set up all of my development requirements on NixOS.

Re:Nsh, a unified router style CLI for OpenBSD by zdw on Saturday April 09, 2022 @12:32PM (#30969476)
The windows registry is somewhat like this - a huge extensible data structure containing all the config of a system. Not really portable though (or is it? been a while since I dug deep on a windows box)

Also NeXT/Apple .plist files worked like this.

And looking at modern "DevOps" tooling, we have YAML, or tools that transform YAML into templates and config loaded into other systems (Helm, some parts of Ansible, etc.)

Re:Nsh, a unified router style CLI for OpenBSD by adamcstephens on Saturday April 09, 2022 @09:06AM (#30967719)
vyos would be another, though is also networking focused.