Skip to content

Instantly share code, notes, and snippets.

@pwlin
Created March 14, 2015 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwlin/807aa650b099944788a7 to your computer and use it in GitHub Desktop.
Save pwlin/807aa650b099944788a7 to your computer and use it in GitHub Desktop.
ferm example
# -*- 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