Skip to content

Instantly share code, notes, and snippets.

@koos
Created July 8, 2009 12:22
Show Gist options
  • Save koos/142775 to your computer and use it in GitHub Desktop.
Save koos/142775 to your computer and use it in GitHub Desktop.
#
# -*- shell-script -*-
#
# Configuration file for ferm(1).
#
def $SERVER_TCP_PORTS = (http https ssh);
table filter {
chain INPUT {
policy DROP;
# connection tracking
mod state state INVALID DROP;
mod state state (ESTABLISHED RELATED) ACCEPT;
# allow local packages
interface lo ACCEPT;
# respond to ping, but limit that
proto icmp ACCEPT;
# allow IPsec
proto udp dport 500 ACCEPT;
proto (esp ah) ACCEPT;
# allow the defined tcp connections
#proto tcp dport ssh ACCEPT;
proto tcp dport $SERVER_TCP_PORTS ACCEPT;
}
chain OUTPUT {
policy ACCEPT;
# connection tracking
#mod state state INVALID DROP;
mod state state (ESTABLISHED RELATED) ACCEPT;
}
chain FORWARD {
policy DROP;
# connection tracking
mod state state INVALID DROP;
mod state state (ESTABLISHED RELATED) ACCEPT;
}
}
# IPv6:
#domain ip6 {
# table filter {
# chain INPUT {
# policy ACCEPT;
# # ...
# }
# # ...
# }
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment