Personal tools
You are here: Home log log_05 (10-23-05) tips for iptables
Navigation
Log in


Forgot your password?
 
Document Actions

(10-23-05) tips for iptables

(10-23-05) tips for iptables

(10-23-05) tips for iptables

http://www.netfilter.org/documentation/HOWTO//packet-filtering-HOWTO.html
  1. ip6tables is available for ipv6
  2. self-define a chain and let built-in chain use it instead.
    iptables -N in
    iptables -A in -j DROP
    ...(more rules for chain in)
    iptables -I INPUT -i $interface -j in
    
  3. define a function and let a chain jump to it as a target
    function drop_log {
            iptables -N drop_log || return
            iptables -m limit -A drop_log --limit 1/second -j LOG --log-prefix "DROP "
            iptables -A drop_log -j DROP
    }
    
    drop_log
    iptables -A FORWARD -j drop_log
    

  4. Extensions to iptables: new matches. To get help on an extension, use the option to load it (`-p', `-j' or `-m') followed by `-h' or `-help', eg: iptables -p tcp --help.
  5. limit module is used to restrict the rate of matches. eg:
    iptables -m limit -A reject_log --limit 1/second -j LOG --log-prefix "REJECT "
    
    Potentially, it could be used to limit speed. But i haven't found how.



Yu Huang 2006-03-25
« November 2009 »
Su Mo Tu We Th Fr Sa
1234567
891011121314
15161718192021
22232425262728
2930
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: