GithubHelp home page GithubHelp logo

fw's Introduction

Description

The fw.sh script configures the linux system to run as:

  • router
  • NAT (NAT1: 1, multiple NAT1: n groups)
  • firewall
  • shaper (limiting bandwidth per computer or per group of computers),
  • DHCP server
  • provides statistics of client computer traffic to the LMS database

It is optimized for large networks (from several hundred to several thousand computers).

It downloads its configuration from files generated by a properly configured LMS instance (http://lms.org.pl) or directly from the LMS database.

You can also create configuration files manually, their syntax is simple.

For optimal performance when processing packets, fw.sh uses iptables and ipset. The fw.sh script uses algorithms to avoid, whenever possible, unnecessary reloading of iptables rules, using instead the substitution of ready-made ipset lists, and replacing only changed iptables rules.

For packet limiting, the tc module is used with the HTB queuing algorithm from the iproute2 packet and a well-thought-out configuration that allows for very high performance with a minimized load on the CPU.

fw.sh with the stats module reads the iptables packet counters cyclically and loads them into a file. LMS has scripts (e.g. lms-traffic) that allow you to parse such a file and upload data from it to the stats table of the LMS database, which allows you to generate traffic statistics for customers.

By default, the script downloads its configuration files by connecting via ssh to the remote machine on which they are created. For the ssh connection between the fw.sh router and the LMS server it is best to use a mechaznim using the RSA key pair. If the files are created locally on the same machine where the fw.sh script is running, the easiest way is to set lms_ip = "127.0.0.1" or set exec_cmd = "eval" and copy_cmd_url = "cp / opt / gateway"

It is recommended to use a minimum 4-core processor.

Project documentation is available on the wiki at https://github.com/darton/fw/wiki

Opis

Skrypt fw.sh konfiguruje system linux do pracy jako:

  • ruter
  • NAT (NAT1:1, wiele grup NAT1:n)
  • zapora
  • shaper (ograniczanie pasma per komputer lub per grupa komputerów),
  • serwer DHCP
  • dostarcza statystyk ruchu komputerów klientów do bazy danych LMS

Jest zoptymalizowany dla dużych sieci (od kilkuset do kilku tysięcy komputerów).

Pobiera swoją konfigurację z plików generowanych przez odpowiednio skonfigurowaną instancję LMS (http://lms.org.pl) lub wprost z bazy danych LMS-a.

Można też pliki konfiguracyjne stworzyć ręcznie, np w Excelu, ich składnia jest prosta.

W celu optymalnej wydajności przetwarzania pakietów fw.sh korzysta z iptables oraz ipset. Skrypt fw.sh korzysta z algorytmów pozwalających na unikanie, kiedy tylko to możliwe, niepotrzebnego przeładowania reguł iptables, wykorzystując w zamian podmiany gotowych list ipset, oraz podmiany tylko zmienionych reguł iptables.

Do limitowania pakietów wykorzystany jest moduł tc wraz z algorytmem kolejkowania HTB z pakietu iproute2 oraz odpowiednio przemyślana konfiguracja, która pozwala na bardzo dużą wydajność przy zminimalizowanym obciążeniu dla CPU.

fw.sh z modułem stats odczytuje cyklicznie stany liczników pakietów z iptables i ładuje je do pliku. LMS posiada skrypty (np lms-traffic), które pozwalają parsować taki plik i wrzucać z niego dane do tabeli stats bazy danych LMS, co pozwala na generowanie statystyk ruchu dla klientów.

Domyślnie skrypt pobiera swoje pliki konfiguracyjne łącząc się przez ssh ze zdalną maszyną, na której są tworzone. Dla połączenia przez ssh pomiędzy ruterem z fw.sh i serwerem z LMS najlepiej użyć mechaznimu z wykorzystaniem pary kluczy RSA. Jeśli pliki są tworzone lokalnie na tej samej maszynie, na której pracuje skrypt fw.sh najprościej jest ustawić lms_ip="127.0.0.1" lub ustawić exec_cmd="eval" oraz copy_cmd_url="cp /opt/gateway"

Zalecane jest używanie minimum 4 rdzeniowego procesora.

Dokumentacja do projektu znajduje się na wiki pod adresem https://github.com/darton/fw/wiki

fw's People

Contributors

darton avatar

Watchers

 avatar

fw's Issues

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.