Search code examples
firewalliptables

Jumps in firewall rule sets


I have a general question regarding software-based firewalls. Specifically, I would like to know whether there are other firewalls than iptables which allow the specification of jumps inside of the rule set.

In iptables, users have the possibility to specify "jumps" inside of the rule set by targeting specific chains when a rule matches on a packet.

For example, in the following rule set

(1) iptables -A INPUT --src 1.2.3.4 -j ACCEPT
(2) iptables -A INPUT --src 1.2.3.5 -j ACCEPT
(3) iptables -A INPUT --src 1.2.3.6 -j ACCEPT
(4) iptables -A INPUT --src 8.8.8.8 -j NEXT_CHAIN
(5) iptables -A INPUT --src 2.2.2.2 -j ACCEPT
(6) iptables -A INPUT --src 2.2.2.3 -j ACCEPT

<NEXT_CHAIN starts here ...>

rule (4) redirects packet processing to another rule set named "NEXT_CHAIN". In other words, rules (5) and (6) are skipped (in some sense, if there is a match in NEXT_CHAIN). I think this is also possible in iptables' predecessor ipchains.

Do you know whether there are any other firewalls that provide a similar feature?


Solution

  • I did some research on other packet filtering systems, and I found out the following:

    • OpenBSD's pf can implement some sort of control using conditional anchors:

      EXAMPLE: anchor udp-only in on fxp0 inet proto udp

    • The OpenFlow switch provides direct jumps by using GOTO targets
    • NetBSD's ipfw provides the skipto action

    Each of these features allows to modify the control flow during packet classification and can be used to implement JUMP semantics.