Coder Social home page Coder Social logo

mihakralj / opnsense-cli Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 2.0 13.14 MB

OPNsense CLI is a command-line utility for FreeBSD, Linux, MacOS and Windows that empowers administrators and power users to manage, configure, and monitor OPNsense firewall systems.

License: Apache License 2.0

Go 97.46% Makefile 2.54%
firewall-configuration opnsense opnsense-firewall

opnsense-cli's Introduction

OPNsense Command Line Interface (CLI)

OPNsense CLI is a command-line utility for FreeBSD, Linux, MacOS and Windows that empowers administrators and power users to manage, configure, and monitor OPNsense firewall systems. The CLI provides an alternative method to browser-based GUI to interact with the firewall system.

Why this thing exists?

Usage

opnsense [flags] command [parameters]

Commands

  • show [<xpath>]: Displays config.xml or the Xpath segment in it
  • compare [<staging.xml>] [<config.xml>]: Compares two config files
  • set <xpath> [value] [(attribute)]: Adds a new branch, value and/or attribute
  • set <xpath> [value] [(attribute)] -d: Deletes branch, value and/or attribute
  • discard [<xpath>]: Discards a value (or all changes) in the 'staging.xml'
  • commit: Moves staging.xml to active 'config.xml'
  • export [<source.xml>] [<target.xml>]: Extracts a patch file
  • import [patch.xml]: Reads provided XML patch and injects it into 'staging.xml'
  • backup [<backup.xml>]: Lists available backup configs or displays a specific backup
  • restore [<backup.xml>]: Restores config.xml from a specific backup.xml. (alias: load)
  • save [<file.xml>]: Creates a new /conf/backup/file.xml
  • delete <backup.xml>: Deletes a specific backup.xml.
  • delete age [days]: Deletes all backups older than specified days
  • delete keep [count]: Keeps specified number of backups and deletes the rest
  • delete trim [count]: Deletes number of the oldest backups
  • sysinfo [<xpath>]: Retrieves system information from the firewall
  • run <service> <command>: Executes commands on OPNsense.

Flags

  • --target (-t): Sets the target OPNsense in the form of user@hostname[:port].
  • --no-color (-n): Disable ANSI color output
  • --force (-f): Removes checks and prompts before config.xml or configctl are touched.
  • --verbose (-v): Sets verbosity (1=error, 2=warning, 3=info, 4=note, 5=debug).
  • --no-color (-n): Removes ANSI colors from the printout.
  • --xml (-x): Displays results in XML format.
  • --json (-j): Displays results in JSON format.
  • --yaml (-y): Displays results in YAML format.

opnsense-cli's People

Contributors

mihakralj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

opnsense-cli's Issues

Thank you

No an issue, just want to say thank you.

This is exactly what I was looking for, thought I would have to write it myself

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.