Giter Site home page Giter Site logo

alexharpin / conntrack-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vyos/conntrack-tools

0.0 2.0 0.0 1.86 MB

conntrack-tools i.e. conntrack and conntrackd

License: GNU General Public License v2.0

Shell 30.44% C 62.33% Groff 1.94% Lex 0.67% Yacc 4.62%

conntrack-tools's Introduction

= nfct: command line tool to interact with the Connection Tracking System =

This tool only supports the cttimeout infrastructure by now. However,
the plan is that it will replace `conntrack' with a syntax that looks
more similar to `ip' and `nftables' tools (in the long run!).

== cttimeout: fine-grain timeout tuning for the Connection Tracking System ==

The `nfct' command line tool allows you to define custom timeout
policies:

# nfct add timeout custom-tcp-policy1 inet tcp established 100

You can also retrieve the existing timeout policies with:

# nfct list timeout
.tcp-policy = {
        .l3proto = 2,
        .l4proto = 6,
        .policy = {
                .SYN_SENT = 120,
                .SYN_RECV = 60,
                .ESTABLISHED = 100,
                .FIN_WAIT = 120,
                .CLOSE_WAIT = 60,
                .LAST_ACK = 30,
                .TIME_WAIT = 120,
                .CLOSE = 10,
                .SYN_SENT2 = 120,
                .RETRANS = 300,
                .UNACKNOWLEDGED = 300,
        },
};

Then, you can use the timeout policy with iptables:

# iptables -I PREROUTING -t raw -s 1.1.1.1 -d 2.2.2.2 -p tcp \
	-j CT --timeout custom-tcp-policy1

You can define policies for other protocols as well, eg:

# nfct add timeout custom-udp-policy1 inet udp unreplied 10 replied 20

And attach them via iptables:

# iptables -I PREROUTING -t raw -s 1.1.1.1 -d 2.2.2.2 -p udp \
	-j CT --timeout custom-udp-policy1

== Compilation & Installation ==

This tool requires libmnl and libnetfilter_cttimeout. You also require
nfnetlink_cttimeout support in the Linux kernel.

If you obtain a working copy from git, you have to run:

$ autoreconf -fi # this is the lingo that replaces old autogen.sh scripts
$ ./configure --prefix=/usr
$ make
$ sudo make install

-o-
(c) 2012 by Pablo Neira Ayuso <[email protected]>

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.