ferm

Aus wiki.archlinux.de


ferm - ausgesprochen "firm", steht für "For Easy Rule Making".

Mit ferm kannst du Firewall-Regeln basierend auf iptables konfigurieren und beim Systemstart laden.

Installation

Das Programm ist als ferm in extra verfügbar, und kann von dort mittels Pacman installiert werden.

pacman -S ferm

Konfiguration

Die Konfigurationsdatei /etc/ferm.conf enthält bereits Firewall-Regeln für ein Desktop-System.

Weitere Beispiele findest du im Verzeichnis /usr/share/doc/ferm/examples/.

ferm Import

Bei geladenen Firewall-Regeln wird

# import-ferm > /etc/ferm.conf

diese übernehmen.

ferm Befehl

# ferm /etc/ferm.conf # Lädt die Firewall-Regeln in das netfilter framework des Kernels.

Überprüfen kannst du dies mittels

# iptables -L -v
# ip6tables -L -v

ferm Service

# systemctl enable --now ferm.service # Für den automatischen Start vormerken und direkt starten

ferm Beispiel

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;

        # ident connections are also allowed
        proto tcp dport auth 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;
}

domain ip6 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;

        # allow ICMP (for neighbor solicitation, like ARP for IPv4)
        proto ipv6-icmp ACCEPT;

        # ident connections are also allowed
        proto tcp dport auth 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;
}

Weblinks