Common iptables rules for Fedora 10

Fedora 10 ships with a default iptables ruleset installed that will reject all incoming traffic. Before you can use some services you must add rules to iptables so the services will work. Below is a list of common rules that users would use.

  • These examples assume you are making the firewall changes as a normal user with 'sudo' privileges

HTTP - Port 80

# sudo /sbin/iptables -I INPUT 1 -p tcp --dport http -j ACCEPT

HTTPS/SSL - Port 443

# sudo /sbin/iptables -I INPUT 1 -p tcp --dport https -j ACCEPT

SSH - Port 22

# sudo /sbin/iptables -I INPUT 1 -p tcp --dport ssh -j ACCEPT

FTP - Port 21

# sudo /sbin/iptables -I INPUT 1 -p tcp --dport ftp -j ACCEPT
# sudo /sbin/iptables -I INPUT 1 -p tcp --dport ftp-data -j ACCEPT

MySQL - Port 3306

# sudo /sbin/iptables -I INPUT 1 -p tcp --dport mysql -j ACCEPT

Save Your Rules

# sudo /sbin/service iptables save

--Kelly Koehn 15:50, 16 July 2009 (CDT)

© 2015 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER