Security Consulting
  Unix Administration     Firewall     Intrusion Detection     Network Security     Hacking     MORE     HOME    

IP TABLES

IPTABLES is the successor of IP_CHAINS in Linux. In Version 2.4. of the kernel, iptables is used.

Protecting a standalone machine

Here is a little firewall-script that protects a single standing machine.

Local Redirect

To do local redirects, use the following:
    iptables -A PREROUTING --table nat --protocol tcp --dport 25 -j DNAT --to "IP"
    
This redirects all the traffic coming to that machine which is going to port 25 (although maybe not going directly to that machine's IP) to the special machine with "IP".

Coding Packet Stuff

iptables ... -j QUEUE 
can be used to pass packets to an application, such as your own perl code: http://www.intercode.com.au/jmorris/perlipq/.


CopyLeft (l) 2003 by Raffael Marty