Table des matières

Mon Motha's IPTables Firewall Configuration Reference Guide

(Version 2.3.8)

This is a detailed guide of the configuration options within {{https://web.archive.org/web/20041217084425im_/http://www.mplug.org/phpwiki/themes/Hawaiian/images/flower.png?nolink&|http}}MonMotha's IPTables script, a mature and easy to configure Linux 2.4 kernel Netfilter script that will do firewalling, routing, NAT, IP masquerading, and “Cable/DSL router”ing as CompUSA sales people call it.

This is a wiki page. Please feel free to comment where you think additional information might be useful to people configuring the script.


Notation Conventions Used


Main Configuration Section

IPTABLES=“/usr/local/sbin/iptables”

TCP_ALLOW=““

UDP_ALLOW=“68 6112 6119 4000”

INET_IFACE=“eth0”

LAN_IFACE=“eth1”

INTERNAL_LAN=“192.168.0.0/24 192.168.1.0/24”

MASQ_LAN=“192.168.0.0/24 192.168.1.0/24”

SNAT_LAN=”“

DROP=“TREJECT”

DENY_ALL=”“

DENY_HOSTWISE_TCP=“192.168.1.1>110”

DENY_HOSTWISE_UDP=“192.168.1.1>27015”

BLACKHOLE=”“

BLACKHOLE_DROP=“DROP”

ALLOW_HOSTWISE_TCP=“123.123.123.123>113”

ALLOW_HOSTWISE_UDP=“123.123.123.123>68”

TCP_FW=”“

UDP_FW=”“

MANGLE_TOS_OPTIMIZE=“TRUE”

DHCP_SERVER=“FALSE”

BAD_ICMP=“5 9 10 15 16 17 18”

ENABLE=“N”

Flood Parameters Configuration

?Syn Cookies ). This is intended to be a “last resort” kind of option (similar to the ”! ?Max Clients” option on Apache), only meant to keep the system from spiraling down into nothingness under the brunt of an insane synflood. Set this option very high.

Outbound filters

Experimental Options (please report your successes/failures)

MAC Address stuff is broken currently; see Mon Motha Known Bugs

?Syn Cookies on or off (TRUE/FALSE toggle). Recommended to TRUE, because this will protect you from SYN floods by posing a cryptographic challenge per every TCP connection to make illegitimate connections computationally expensive, thus rendering SYN floods mostly ineffective. Requires more CPU power on your firewall machine, though not noticably so unless you have an active server or you are synflooded.

Pre-Alpha and non-functional stuff - Don't bother unless you're working on it.

Additional information

LOCIP options for configuration directives

Many configuration directives allow a LOCIP option to be specified. This allows you to filter based on the destination IP. This is useful if the system running the firewall has multiple public IPs or you are running publicly routable IPs on your internal LAN and want to open ports to a single host only.

Outbound filtering

The script has very little support for outbound filters. This will be addressed in the later 2.5.x development series (not begun as of 23 June 2002).