iifname "lo" accept comment "!fw4: Accept traffic from loopback"
{% fw4.includes('chain-prepend', 'input') %}
- ct state vmap { established : accept, related : accept{% if (fw4.default_option("drop_invalid")): %}, invalid : drop{% endif %} } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
+{% if (fw4.default_option("drop_invalid")): %}
+ ct state invalid drop comment "!fw4: Drop flows with invalid conntrack state"
+{% endif %}
{% if (fw4.default_option("synflood_protect") && fw4.default_option("synflood_rate")): %}
tcp flags & (fin | syn | rst | ack) == syn jump syn_flood comment "!fw4: Rate limit TCP syn packets"
{% endif %}
meta l4proto { tcp, udp } flow offload @ft;
{% endif %}
{% fw4.includes('chain-prepend', 'forward') %}
- ct state vmap { established : accept, related : accept{% if (fw4.default_option("drop_invalid")): %}, invalid : drop{% endif %} } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
+{% if (fw4.default_option("drop_invalid")): %}
+ ct state invalid drop comment "!fw4: Drop flows with invalid conntrack state"
+{% endif %}
{% for (let rule in fw4.rules("forward")): %}
{%+ include("rule.uc", { fw4, zone: (rule.src?.zone?.log_limit ? rule.src.zone : rule.dest?.zone), rule }) %}
{% endfor %}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
{% fw4.includes('chain-prepend', 'output') %}
- ct state vmap { established : accept, related : accept{% if (fw4.default_option("drop_invalid")): %}, invalid : drop{% endif %} } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
+{% if (fw4.default_option("drop_invalid")): %}
+ ct state invalid drop comment "!fw4: Drop flows with invalid conntrack state"
+{% endif %}
{% for (let rule in fw4.rules("output")): %}
{%+ include("rule.uc", { fw4, zone: null, rule }) %}
{% endfor %}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
tcp flags & (fin | syn | rst | ack) == syn jump syn_flood comment "!fw4: Rate limit TCP syn packets"
iifname "br-lan" jump input_lan comment "!fw4: Handle lan IPv4/IPv6 input traffic"
iifname "pppoe-wan" jump input_wan comment "!fw4: Handle wan IPv4/IPv6 input traffic"
type filter hook forward priority filter; policy drop;
meta l4proto { tcp, udp } flow offload @ft;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "br-lan" jump forward_lan comment "!fw4: Handle lan IPv4/IPv6 forward traffic"
iifname "pppoe-wan" jump forward_wan comment "!fw4: Handle wan IPv4/IPv6 forward traffic"
jump handle_reject
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
meta l4proto tcp counter comment "!fw4: Test-Deprecated-Rule-Option"
oifname "br-lan" jump output_lan comment "!fw4: Handle lan IPv4/IPv6 output traffic"
oifname "pppoe-wan" jump output_wan comment "!fw4: Handle wan IPv4/IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "br-lan" jump input_lan comment "!fw4: Handle lan IPv4/IPv6 input traffic"
iifname "pppoe-wan" jump input_wan comment "!fw4: Handle wan IPv4/IPv6 input traffic"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "br-lan" jump forward_lan comment "!fw4: Handle lan IPv4/IPv6 forward traffic"
iifname "pppoe-wan" jump forward_wan comment "!fw4: Handle wan IPv4/IPv6 forward traffic"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "br-lan" jump output_lan comment "!fw4: Handle lan IPv4/IPv6 output traffic"
oifname "pppoe-wan" jump output_wan comment "!fw4: Handle wan IPv4/IPv6 output traffic"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "zone1" jump input_test1 comment "!fw4: Handle test1 IPv4/IPv6 input traffic"
iifname "zone2" jump input_test2 comment "!fw4: Handle test2 IPv4/IPv6 input traffic"
iifname "zone3" jump input_test3 comment "!fw4: Handle test3 IPv4/IPv6 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "zone1" jump forward_test1 comment "!fw4: Handle test1 IPv4/IPv6 forward traffic"
iifname "zone2" jump forward_test2 comment "!fw4: Handle test2 IPv4/IPv6 forward traffic"
iifname "zone3" jump forward_test3 comment "!fw4: Handle test3 IPv4/IPv6 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "zone1" jump output_test1 comment "!fw4: Handle test1 IPv4/IPv6 output traffic"
oifname "zone2" jump output_test2 comment "!fw4: Handle test2 IPv4/IPv6 output traffic"
oifname "zone3" jump output_test3 comment "!fw4: Handle test3 IPv4/IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "zone1" jump input_test1 comment "!fw4: Handle test1 IPv4/IPv6 input traffic"
iifname "zone2" jump input_test2 comment "!fw4: Handle test2 IPv4/IPv6 input traffic"
iifname "zone3" jump input_test3 comment "!fw4: Handle test3 IPv4/IPv6 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "zone1" jump forward_test1 comment "!fw4: Handle test1 IPv4/IPv6 forward traffic"
iifname "zone2" jump forward_test2 comment "!fw4: Handle test2 IPv4/IPv6 forward traffic"
iifname "zone3" jump forward_test3 comment "!fw4: Handle test3 IPv4/IPv6 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "zone1" jump output_test1 comment "!fw4: Handle test1 IPv4/IPv6 output traffic"
oifname "zone2" jump output_test2 comment "!fw4: Handle test2 IPv4/IPv6 output traffic"
oifname "zone3" jump output_test3 comment "!fw4: Handle test3 IPv4/IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "zone1" jump input_test1 comment "!fw4: Handle test1 IPv4/IPv6 input traffic"
iifname "zone2" jump input_test2 comment "!fw4: Handle test2 IPv4/IPv6 input traffic"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "zone1" jump forward_test1 comment "!fw4: Handle test1 IPv4/IPv6 forward traffic"
iifname "zone2" jump forward_test2 comment "!fw4: Handle test2 IPv4/IPv6 forward traffic"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "zone1" jump output_test1 comment "!fw4: Handle test1 IPv4/IPv6 output traffic"
oifname "zone2" jump output_test2 comment "!fw4: Handle test2 IPv4/IPv6 output traffic"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "zone1" jump input_test1 comment "!fw4: Handle test1 IPv4/IPv6 input traffic"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "zone1" jump forward_test1 comment "!fw4: Handle test1 IPv4/IPv6 forward traffic"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "zone1" jump output_test1 comment "!fw4: Handle test1 IPv4/IPv6 output traffic"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
jump input_test1 comment "!fw4: Handle test1 IPv4/IPv6 input traffic"
iifname "/never/" jump input_test2 comment "!fw4: Handle test2 IPv4/IPv6 input traffic"
iifname "test*" jump input_test3 comment "!fw4: Handle test3 IPv4/IPv6 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
jump forward_test1 comment "!fw4: Handle test1 IPv4/IPv6 forward traffic"
iifname "/never/" jump forward_test2 comment "!fw4: Handle test2 IPv4/IPv6 forward traffic"
iifname "test*" jump forward_test3 comment "!fw4: Handle test3 IPv4/IPv6 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
jump output_test1 comment "!fw4: Handle test1 IPv4/IPv6 output traffic"
oifname "/never/" jump output_test2 comment "!fw4: Handle test2 IPv4/IPv6 output traffic"
oifname "test*" jump output_test3 comment "!fw4: Handle test3 IPv4/IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
meta nfproto ipv6 ip6 saddr & ::ffff == ::1 ip6 saddr & ::ffff != ::2 jump input_test1 comment "!fw4: Handle test1 IPv6 input traffic"
meta nfproto ipv6 ip6 saddr != { ::7, ::8 } ip6 saddr & ::ffff == ::1 ip6 saddr & ::ffff != ::5 ip6 saddr & ::ffff != ::6 jump input_test2 comment "!fw4: Handle test2 IPv6 input traffic"
meta nfproto ipv6 ip6 saddr != { ::7, ::8 } ip6 saddr & ::ffff == ::2 ip6 saddr & ::ffff != ::5 ip6 saddr & ::ffff != ::6 jump input_test2 comment "!fw4: Handle test2 IPv6 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
meta nfproto ipv6 ip6 saddr & ::ffff == ::1 ip6 saddr & ::ffff != ::2 jump forward_test1 comment "!fw4: Handle test1 IPv6 forward traffic"
meta nfproto ipv6 ip6 saddr != { ::7, ::8 } ip6 saddr & ::ffff == ::1 ip6 saddr & ::ffff != ::5 ip6 saddr & ::ffff != ::6 jump forward_test2 comment "!fw4: Handle test2 IPv6 forward traffic"
meta nfproto ipv6 ip6 saddr != { ::7, ::8 } ip6 saddr & ::ffff == ::2 ip6 saddr & ::ffff != ::5 ip6 saddr & ::ffff != ::6 jump forward_test2 comment "!fw4: Handle test2 IPv6 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
meta nfproto ipv6 ip6 daddr & ::ffff == ::1 ip6 daddr & ::ffff != ::2 jump output_test1 comment "!fw4: Handle test1 IPv6 output traffic"
meta nfproto ipv6 ip6 daddr != { ::7, ::8 } ip6 daddr & ::ffff == ::1 ip6 daddr & ::ffff != ::5 ip6 daddr & ::ffff != ::6 jump output_test2 comment "!fw4: Handle test2 IPv6 output traffic"
meta nfproto ipv6 ip6 daddr != { ::7, ::8 } ip6 daddr & ::ffff == ::2 ip6 daddr & ::ffff != ::5 ip6 daddr & ::ffff != ::6 jump output_test2 comment "!fw4: Handle test2 IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
meta nfproto ipv4 ip saddr 10.0.0.0/8 jump input_test1 comment "!fw4: Handle test1 IPv4 input traffic"
meta nfproto ipv6 ip6 saddr 2001:db8:1234::/64 jump input_test2 comment "!fw4: Handle test2 IPv6 input traffic"
meta nfproto ipv6 ip6 saddr 2001:db8:1234::/64 jump input_test3 comment "!fw4: Handle test3 IPv6 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
meta nfproto ipv4 ip saddr 10.0.0.0/8 jump forward_test1 comment "!fw4: Handle test1 IPv4 forward traffic"
meta nfproto ipv6 ip6 saddr 2001:db8:1234::/64 jump forward_test2 comment "!fw4: Handle test2 IPv6 forward traffic"
meta nfproto ipv6 ip6 saddr 2001:db8:1234::/64 jump forward_test3 comment "!fw4: Handle test3 IPv6 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
meta nfproto ipv4 ip daddr 10.0.0.0/8 jump output_test1 comment "!fw4: Handle test1 IPv4 output traffic"
meta nfproto ipv6 ip6 daddr 2001:db8:1234::/64 jump output_test2 comment "!fw4: Handle test2 IPv6 output traffic"
meta nfproto ipv6 ip6 daddr 2001:db8:1234::/64 jump output_test3 comment "!fw4: Handle test3 IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "zone1" jump input_test1 comment "!fw4: Handle test1 IPv4/IPv6 input traffic"
iifname "zone2" jump input_test2 comment "!fw4: Handle test2 IPv4/IPv6 input traffic"
iifname "zone3" jump input_test3 comment "!fw4: Handle test3 IPv4/IPv6 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "zone1" jump forward_test1 comment "!fw4: Handle test1 IPv4/IPv6 forward traffic"
iifname "zone2" jump forward_test2 comment "!fw4: Handle test2 IPv4/IPv6 forward traffic"
iifname "zone3" jump forward_test3 comment "!fw4: Handle test3 IPv4/IPv6 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "zone1" jump output_test1 comment "!fw4: Handle test1 IPv4/IPv6 output traffic"
oifname "zone2" jump output_test2 comment "!fw4: Handle test2 IPv4/IPv6 output traffic"
oifname "zone3" jump output_test3 comment "!fw4: Handle test3 IPv4/IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
tcp dport 1007 counter log prefix "@rule[6]: " comment "!fw4: @rule[6]"
tcp dport 1008 counter comment "!fw4: @rule[7]"
tcp dport 1009 limit rate 5/minute log prefix "@rule[12]: "
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
tcp dport 1005 limit name "lan.log_limit" log prefix "@rule[4]: "
tcp dport 1005 counter comment "!fw4: @rule[4]"
tcp dport 1006 counter comment "!fw4: @rule[5]"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "br-lan" jump output_lan comment "!fw4: Handle lan IPv4/IPv6 output traffic"
meta nfproto ipv4 oifname "pppoe-wan" jump output_wan comment "!fw4: Handle wan IPv4 output traffic"
oifname "br-guest" jump output_guest comment "!fw4: Handle guest IPv4/IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
counter comment "!fw4: @rule[1]"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
counter comment "!fw4: @rule[3]"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
counter comment "!fw4: @rule[0]"
counter comment "!fw4: @rule[2]"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
}
chain output {
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
counter comment "!fw4: Implicitly enabled"
counter comment "!fw4: Explicitly enabled"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
}
chain output {
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
meta nfproto ipv4 ip dscp 0x0 counter comment "!fw4: DSCP match rule #1"
meta nfproto ipv6 ip6 dscp 0x0 counter comment "!fw4: DSCP match rule #1"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
}
chain output {
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
meta l4proto { "icmp", "ipv6-icmp" } counter comment "!fw4: ICMP rule #1"
meta nfproto ipv6 meta l4proto ipv6-icmp counter comment "!fw4: ICMP rule #2"
meta nfproto ipv6 meta l4proto ipv6-icmp counter comment "!fw4: ICMP rule #3"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname { "eth0", "eth1" } jump input_lan comment "!fw4: Handle lan IPv4/IPv6 input traffic"
iifname { "eth2", "eth3" } jump input_wan comment "!fw4: Handle wan IPv4/IPv6 input traffic"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname { "eth0", "eth1" } jump forward_lan comment "!fw4: Handle lan IPv4/IPv6 forward traffic"
iifname { "eth2", "eth3" } jump forward_wan comment "!fw4: Handle wan IPv4/IPv6 forward traffic"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname { "eth0", "eth1" } jump output_lan comment "!fw4: Handle lan IPv4/IPv6 output traffic"
oifname { "eth2", "eth3" } jump output_wan comment "!fw4: Handle wan IPv4/IPv6 output traffic"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "pppoe-wan" jump input_wan comment "!fw4: Handle wan IPv4/IPv6 input traffic"
iifname "br-lan" jump input_lan comment "!fw4: Handle lan IPv4/IPv6 input traffic"
iifname "br-guest" jump input_guest comment "!fw4: Handle guest IPv4/IPv6 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "pppoe-wan" jump forward_wan comment "!fw4: Handle wan IPv4/IPv6 forward traffic"
iifname "br-lan" jump forward_lan comment "!fw4: Handle lan IPv4/IPv6 forward traffic"
iifname "br-guest" jump forward_guest comment "!fw4: Handle guest IPv4/IPv6 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
ip6 saddr & ::ffff == ::1 ip6 daddr & ::ffff != ::2 counter comment "!fw4: Mask rule #1"
ip6 saddr != { ::7, ::8 } ip6 saddr & ::ffff == ::1 ip6 saddr & ::ffff != ::5 ip6 saddr & ::ffff != ::6 ip6 daddr != { ::15, ::16 } ip6 daddr & ::ffff == ::9 ip6 daddr & ::ffff != ::13 ip6 daddr & ::ffff != ::14 counter comment "!fw4: Mask rule #2"
ip6 saddr != { ::7, ::8 } ip6 saddr & ::ffff == ::1 ip6 saddr & ::ffff != ::5 ip6 saddr & ::ffff != ::6 ip6 daddr != { ::15, ::16 } ip6 daddr & ::ffff == ::10 ip6 daddr & ::ffff != ::13 ip6 daddr & ::ffff != ::14 counter comment "!fw4: Mask rule #2"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "pppoe-wan" jump input_wan comment "!fw4: Handle wan IPv4/IPv6 input traffic"
iifname "br-lan" jump input_lan comment "!fw4: Handle lan IPv4/IPv6 input traffic"
iifname "wwan0" jump input_noaddr comment "!fw4: Handle noaddr IPv4/IPv6 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "pppoe-wan" jump forward_wan comment "!fw4: Handle wan IPv4/IPv6 forward traffic"
iifname "br-lan" jump forward_lan comment "!fw4: Handle lan IPv4/IPv6 forward traffic"
iifname "wwan0" jump forward_noaddr comment "!fw4: Handle noaddr IPv4/IPv6 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "pppoe-wan" jump output_wan comment "!fw4: Handle wan IPv4/IPv6 output traffic"
oifname "br-lan" jump output_lan comment "!fw4: Handle lan IPv4/IPv6 output traffic"
oifname "wwan0" jump output_noaddr comment "!fw4: Handle noaddr IPv4/IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
meta nfproto ipv4 ip saddr 192.168.1.0/24 jump input_ipv4only comment "!fw4: Handle ipv4only IPv4 input traffic"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
meta nfproto ipv4 ip saddr 192.168.1.0/24 jump forward_ipv4only comment "!fw4: Handle ipv4only IPv4 forward traffic"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
meta nfproto ipv4 ip daddr 192.168.1.0/24 jump output_ipv4only comment "!fw4: Handle ipv4only IPv4 output traffic"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
}
chain output {
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
meta time >= "2022-05-30 21:51:23" counter accept comment "!fw4: Time rule #1"
meta time >= "2022-05-30 21:51:00" counter accept comment "!fw4: Time rule #2"
meta time >= "2022-05-30 21:00:00" counter accept comment "!fw4: Time rule #3"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "eth0" jump input_zone1 comment "!fw4: Handle zone1 IPv4/IPv6 input traffic"
iifname "lo" jump input_zone2 comment "!fw4: Handle zone2 IPv4/IPv6 input traffic"
meta nfproto ipv4 ip saddr 127.0.0.0/8 jump input_zone3 comment "!fw4: Handle zone3 IPv4 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "eth0" jump forward_zone1 comment "!fw4: Handle zone1 IPv4/IPv6 forward traffic"
iifname "lo" jump forward_zone2 comment "!fw4: Handle zone2 IPv4/IPv6 forward traffic"
meta nfproto ipv4 ip saddr 127.0.0.0/8 jump forward_zone3 comment "!fw4: Handle zone3 IPv4 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "eth0" jump output_zone1 comment "!fw4: Handle zone1 IPv4/IPv6 output traffic"
oifname "lo" jump output_zone2 comment "!fw4: Handle zone2 IPv4/IPv6 output traffic"
meta nfproto ipv4 ip daddr 127.0.0.0/8 jump output_zone3 comment "!fw4: Handle zone3 IPv4 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
}
chain output {
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
counter log prefix "@rule[0]: " comment "!fw4: @rule[0]"
counter log prefix "Explicit rule name: " comment "!fw4: Explicit rule name"
counter log prefix "Explicit prefix: " comment "!fw4: @rule[2]"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
}
chain output {
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
}
chain prerouting {
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "eth0" jump input_wanA comment "!fw4: Handle wanA IPv4/IPv6 input traffic"
iifname "eth1" jump input_wanB comment "!fw4: Handle wanB IPv4/IPv6 input traffic"
iifname "eth2" jump input_lan comment "!fw4: Handle lan IPv4/IPv6 input traffic"
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "eth0" jump forward_wanA comment "!fw4: Handle wanA IPv4/IPv6 forward traffic"
iifname "eth1" jump forward_wanB comment "!fw4: Handle wanB IPv4/IPv6 forward traffic"
iifname "eth2" jump forward_lan comment "!fw4: Handle lan IPv4/IPv6 forward traffic"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "eth0" jump output_wanA comment "!fw4: Handle wanA IPv4/IPv6 output traffic"
oifname "eth1" jump output_wanB comment "!fw4: Handle wanB IPv4/IPv6 output traffic"
oifname "eth2" jump output_lan comment "!fw4: Handle lan IPv4/IPv6 output traffic"
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
}
chain output {
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
}
chain prerouting {
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
meta nfproto ipv4 meta l4proto tcp ip saddr . tcp dport @test-set-1 counter comment "!fw4: Rule using test set #1"
meta nfproto ipv4 meta l4proto tcp ip saddr . tcp sport @test-set-2 counter comment "!fw4: Rule using test set #2, match direction should default to 'source'"
meta nfproto ipv4 meta l4proto tcp ip daddr . tcp sport @test-set-1 counter comment "!fw4: Rule using test set #1, overriding match direction"
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
}
chain prerouting {
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "eth0" jump input_test comment "!fw4: Handle test IPv4/IPv6 input traffic"
}
type filter hook forward priority filter; policy drop;
include "/usr/share/nftables.d/include-chain-start-forward.nft"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "eth0" jump forward_test comment "!fw4: Handle test IPv4/IPv6 forward traffic"
include "/usr/share/nftables.d/include-chain-end-forward.nft"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "eth0" jump output_test comment "!fw4: Handle test IPv4/IPv6 output traffic"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "eth0" jump input_test comment "!fw4: Handle test IPv4/IPv6 input traffic"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "eth0" jump forward_test comment "!fw4: Handle test IPv4/IPv6 forward traffic"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "eth0" jump output_test comment "!fw4: Handle test IPv4/IPv6 output traffic"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "eth0" jump input_test comment "!fw4: Handle test IPv4/IPv6 input traffic"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "eth0" jump forward_test comment "!fw4: Handle test IPv4/IPv6 forward traffic"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "eth0" jump output_test comment "!fw4: Handle test IPv4/IPv6 output traffic"
}
iifname "lo" accept comment "!fw4: Accept traffic from loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle inbound flows"
+ ct state established,related accept comment "!fw4: Allow inbound established and related flows"
iifname "eth0" jump input_test comment "!fw4: Handle test IPv4/IPv6 input traffic"
}
chain forward {
type filter hook forward priority filter; policy drop;
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle forwarded flows"
+ ct state established,related accept comment "!fw4: Allow forwarded established and related flows"
iifname "eth0" jump forward_test comment "!fw4: Handle test IPv4/IPv6 forward traffic"
}
oifname "lo" accept comment "!fw4: Accept traffic towards loopback"
- ct state vmap { established : accept, related : accept } comment "!fw4: Handle outbound flows"
+ ct state established,related accept comment "!fw4: Allow outbound established and related flows"
oifname "eth0" jump output_test comment "!fw4: Handle test IPv4/IPv6 output traffic"
}