Git Product home page Git Product logo

netfilter-samples's Introduction

Overview

Sample Netfilter rulesets and utilities can be found here.

These rulesets demonstrate usage for various setups and common tasks. The goal in each example is to supply a simple and efficient ruleset that can be extended upon as required.

Some useful Netfilter utilities are also provided.

Netfilter Utilities

The following utilities are found in the listed dirs; each has a further Readme with more information.

  • iptables-failsafe -- An improved way to load rules with automatic rollback in the event of failure (with benefits over using iptables-apply)

  • reset-rules -- A method to clear out currently loaded tables to the kernel-default for those tables. Note that restoring a "blank" ruleset is a cleaner solution, but that requires you have one ahead-of-time.

Netfilter Ruleset BNF

The netfilter-ruleset-bnf directory has a BNF description and documentation of the iptables-restore (also iptables-save) ruleset format.

Ruleset Samples

Please do not use these examples without reading through the ruleset and understanding the logic behind it; many of the intended features are included as comments to show usage. You (the reader) should make sure the completed ruleset operates as required for your particular environment.

Note that this is not intended as a "guide" to using netfilter. These are simplified basic rulesets that can provide a starting point and sample configuration for a variety of needs.

Ruleset layout

Each of the rules-* dirs includes targeted example rulesets. The rulesets themselves contain some comments inline, and may optionally include a separate readme document that details some specific features that are too verbose to be easily included in the ruleset comments.

Using Rulesets

The rulesets are all in iptables-save(8) syntax, which means they can be loaded through iptables-restore(8). Alteration may well be required for use in your environment, so verbatim use is not recommended. These are intended as learning guides to demonstrate a highly efficient netfilter structure while promoting modification.

Overview of ruleset dirs

  • rules-edge-router -- a basic edge/border router protecting a LAN
  • rules-host -- a basic ruleset for a single host

netfilter-samples's People

Contributors

queuingkoala avatar

Watchers

James Cloos avatar

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.