Created
March 14, 2015 11:54
-
-
Save pwlin/807aa650b099944788a7 to your computer and use it in GitHub Desktop.
ferm example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- shell-script -*- | |
# | |
# Ferm example script | |
# | |
# Firewall configuration for a web server. | |
table filter { | |
chain INPUT { | |
policy DROP; | |
# connection tracking | |
mod state state INVALID DROP; | |
mod state state (ESTABLISHED RELATED) ACCEPT; | |
# allow local connections | |
interface lo ACCEPT; | |
# respond to ping | |
# proto icmp icmp-type echo-request ACCEPT; | |
# our services to the world | |
proto tcp dport ($SERVICES) ACCEPT; | |
# the rest is dropped by the above policy | |
} | |
# outgoing connections are not limited | |
chain OUTPUT policy ACCEPT; | |
# this is not a router | |
chain FORWARD policy DROP; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment