Code Monkey home page Code Monkey logo

linux-firewall's Introduction

Linux Firewall

Implementation of a simple Linux Firewall using Netfilter for packet manipulation. The source code is licensed under MIT license (see LICENSE) and you should use it (insert builded kernel module) ONLY at your OWN RISK.

User space application

Command line application that communicates with a given kernel module. The possible command line arguments are following:

  • argument -a RULE
  • add specific rule to the filtering logic
  • RULE: NUMBER ACTION PROTOCOL FROM address TO address src dst, where address is IP or ANY, src is optional (SRCPORT NUMBER) and dst is optional destination port (DSTPORT NUMBER).
  • argument -f FILTER-FILE
  • add all rules defined in the file FILTER-FILE to the filtering logic
  • argument -d RULE-ID
  • delete rule from the filtering logic
  • RULE-ID is a rule identificator
  • argument -p
  • print list of rules defined in the module

Kernel module

Implementation of the kernel modul for Linux in version compatible with kernel version 3.13.

Provided files

The repository contains files

  • pdsfw.c - kernel module
  • pdscli.c - user space application
  • lexer.l - lexical analyzer (flex) input
  • parser.y - parser (bison) input
  • Makefile

Using the make command it is possible to build user space application and kernel module. The kernel module can be loaded using command insmod pdsfw.ko (at your own risk !!!) and removed using command rmmod pdsfw. In case of unexpected problems (eg. failure due to lack of memory, ...), the state is written in log file which can be displayed using command dmesg.

References

linux-firewall's People

Contributors

jakubvojvoda avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

coresoft2

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.