Posts Tagged ‘IPTables’

Example IPTables rules for a webserver

Just a quick and basic example IPTables ruleset to secure a web/mail server: # Allow outgoing traffic and disallow any passthroughs iptables -P INPUT DROP iptables -P OUTPUT ACCEPT iptables -P FORWARD DROP # Allow traffic already established to continue iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT

IPTables Examples

As it is a table of rules, the first rule has precedence. If the first rule dis-allows everything then nothing else afterwards will matter. * INIVIDUAL REJECTS FIRST * THEN OPEN IT UP * THEN BLOCK ALL List iptable rules: iptables -n -L (-n prevents slow reverse DNS lookup) Add rule to Reject all from […]

RedHat Enabled Passive FTP

// List the modules installed lsmod // Load the ip_conntrack_ftp module modprobe ip_conntrack_ftp Edit /etc/sysconfig/iptables-config to include: IPTABLES_MODULES=”ip_nat_ftp ip_conntrack_ftp”