Synproxy: Difference between revisions
Jump to navigation
Jump to search
(Added intro and anonymous synproxy section.) |
(Link manpage example synproxy ruleset.) |
||
Line 61: | Line 61: | ||
Support for using ''synproxy'' named objects was added in [https://marc.info/?l=netfilter&m=157532146917292&w=2 nftables 0.9.3]. | Support for using ''synproxy'' named objects was added in [https://marc.info/?l=netfilter&m=157532146917292&w=2 nftables 0.9.3]. | ||
= See also = | |||
* [https://www.netfilter.org/projects/nftables/manpage.html nft manpage] Example ruleset for synproxy statement |
Revision as of 02:40, 8 April 2021
A netfilter synproxy intercepts new TCP connections and handles the initial 3-way handshake using syncookies instead of conntrack to establish the connection. Running synproxy on a listening server port thus prevents a SYN flood attack on that port from consuming limited conntrack resources.
Anonymous synproxy
An anonymous synproxy exists in the context of the single rule to which it is attached. The following ruleset configures an anonymous synproxy for port tcp/8888:
table ip anon_synproxy_demo {
chain PRE {
type filter hook prerouting priority raw; policy accept;
tcp dport 8888 tcp flags syn notrack
}
chain IN {
type filter hook input priority filter; policy accept;
tcp dport 8888 ct state invalid,untracked synproxy mss 1460 wscale 7 timestamp sack-perm
ct state invalid drop
}
}
Support for anonymous synproxy was added in nftables 0.9.2.
Named synproxy
table ip foo {
synproxy https-synproxy {
mss 1460
wscale 7
timestamp sack-perm
}
synproxy other-synproxy {
mss 1460
wscale 5
}
chain pre {
type filter hook prerouting priority raw; policy accept;
tcp dport 8888 tcp flags syn notrack
}
chain bar {
type filter hook forward priority filter; policy accept;
ct state invalid,untracked synproxy name ip saddr map {
192.168.1.0/24 : "https-synproxy",
192.168.2.0/24 : "other-synproxy",
}
}
}
Support for using synproxy named objects was added in nftables 0.9.3.
See also
- nft manpage Example ruleset for synproxy statement