Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | =================================== |
| 4 | Netfilter Conntrack Sysfs variables |
| 5 | =================================== |
| 6 | |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 7 | /proc/sys/net/netfilter/nf_conntrack_* Variables: |
Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 8 | ================================================= |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 9 | |
| 10 | nf_conntrack_acct - BOOLEAN |
Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 11 | - 0 - disabled (default) |
| 12 | - not 0 - enabled |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 13 | |
| 14 | Enable connection tracking flow accounting. 64-bit byte and packet |
| 15 | counters per flow are added. |
| 16 | |
Florian Westphal | 3183ab8 | 2016-06-22 13:26:10 +0200 | [diff] [blame] | 17 | nf_conntrack_buckets - INTEGER |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 18 | Size of hash table. If not specified as parameter during module |
| 19 | loading, the default size is calculated by dividing total memory |
Florian Westphal | d532bcd | 2021-08-26 15:54:19 +0200 | [diff] [blame] | 20 | by 16384 to determine the number of buckets. The hash table will |
| 21 | never have fewer than 1024 and never more than 262144 buckets. |
Florian Westphal | 3183ab8 | 2016-06-22 13:26:10 +0200 | [diff] [blame] | 22 | This sysctl is only writeable in the initial net namespace. |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 23 | |
| 24 | nf_conntrack_checksum - BOOLEAN |
Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 25 | - 0 - disabled |
| 26 | - not 0 - enabled (default) |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 27 | |
| 28 | Verify checksum of incoming packets. Packets with bad checksums are |
| 29 | in INVALID state. If this is enabled, such packets will not be |
| 30 | considered for connection tracking. |
| 31 | |
| 32 | nf_conntrack_count - INTEGER (read-only) |
| 33 | Number of currently allocated flow entries. |
| 34 | |
| 35 | nf_conntrack_events - BOOLEAN |
Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 36 | - 0 - disabled |
| 37 | - not 0 - enabled (default) |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 38 | |
| 39 | If this option is enabled, the connection tracking code will |
| 40 | provide userspace with connection tracking events via ctnetlink. |
| 41 | |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 42 | nf_conntrack_expect_max - INTEGER |
| 43 | Maximum size of expectation table. Default value is |
| 44 | nf_conntrack_buckets / 256. Minimum is 1. |
| 45 | |
| 46 | nf_conntrack_frag6_high_thresh - INTEGER |
| 47 | default 262144 |
| 48 | |
| 49 | Maximum memory used to reassemble IPv6 fragments. When |
| 50 | nf_conntrack_frag6_high_thresh bytes of memory is allocated for this |
| 51 | purpose, the fragment handler will toss packets until |
| 52 | nf_conntrack_frag6_low_thresh is reached. |
| 53 | |
| 54 | nf_conntrack_frag6_low_thresh - INTEGER |
| 55 | default 196608 |
| 56 | |
| 57 | See nf_conntrack_frag6_low_thresh |
| 58 | |
| 59 | nf_conntrack_frag6_timeout - INTEGER (seconds) |
| 60 | default 60 |
| 61 | |
| 62 | Time to keep an IPv6 fragment in memory. |
| 63 | |
| 64 | nf_conntrack_generic_timeout - INTEGER (seconds) |
| 65 | default 600 |
| 66 | |
| 67 | Default for generic timeout. This refers to layer 4 unknown/unsupported |
| 68 | protocols. |
| 69 | |
| 70 | nf_conntrack_helper - BOOLEAN |
Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 71 | - 0 - disabled (default) |
| 72 | - not 0 - enabled |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 73 | |
| 74 | Enable automatic conntrack helper assignment. |
Florian Westphal | 486dcf4 | 2016-11-10 14:24:40 +0100 | [diff] [blame] | 75 | If disabled it is required to set up iptables rules to assign |
| 76 | helpers to connections. See the CT target description in the |
| 77 | iptables-extensions(8) man page for further information. |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 78 | |
| 79 | nf_conntrack_icmp_timeout - INTEGER (seconds) |
| 80 | default 30 |
| 81 | |
| 82 | Default for ICMP timeout. |
| 83 | |
| 84 | nf_conntrack_icmpv6_timeout - INTEGER (seconds) |
| 85 | default 30 |
| 86 | |
| 87 | Default for ICMP6 timeout. |
| 88 | |
| 89 | nf_conntrack_log_invalid - INTEGER |
Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 90 | - 0 - disable (default) |
| 91 | - 1 - log ICMP packets |
| 92 | - 6 - log TCP packets |
| 93 | - 17 - log UDP packets |
| 94 | - 33 - log DCCP packets |
| 95 | - 41 - log ICMPv6 packets |
| 96 | - 136 - log UDPLITE packets |
| 97 | - 255 - log packets of any protocol |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 98 | |
| 99 | Log invalid packets of a type specified by value. |
| 100 | |
| 101 | nf_conntrack_max - INTEGER |
Florian Westphal | d532bcd | 2021-08-26 15:54:19 +0200 | [diff] [blame] | 102 | Maximum number of allowed connection tracking entries. This value is set |
| 103 | to nf_conntrack_buckets by default. |
| 104 | Note that connection tracking entries are added to the table twice -- once |
| 105 | for the original direction and once for the reply direction (i.e., with |
| 106 | the reversed address). This means that with default settings a maxed-out |
| 107 | table will have a average hash chain length of 2, not 1. |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 108 | |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 109 | nf_conntrack_tcp_be_liberal - BOOLEAN |
Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 110 | - 0 - disabled (default) |
| 111 | - not 0 - enabled |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 112 | |
| 113 | Be conservative in what you do, be liberal in what you accept from others. |
| 114 | If it's non-zero, we mark only out of window RST segments as INVALID. |
| 115 | |
Ali Abdallah | 1da4cd8 | 2021-05-27 09:19:06 +0200 | [diff] [blame] | 116 | nf_conntrack_tcp_ignore_invalid_rst - BOOLEAN |
| 117 | - 0 - disabled (default) |
| 118 | - 1 - enabled |
| 119 | |
| 120 | If it's 1, we don't mark out of window RST segments as INVALID. |
| 121 | |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 122 | nf_conntrack_tcp_loose - BOOLEAN |
Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 123 | - 0 - disabled |
| 124 | - not 0 - enabled (default) |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 125 | |
| 126 | If it is set to zero, we disable picking up already established |
| 127 | connections. |
| 128 | |
| 129 | nf_conntrack_tcp_max_retrans - INTEGER |
| 130 | default 3 |
| 131 | |
| 132 | Maximum number of packets that can be retransmitted without |
| 133 | received an (acceptable) ACK from the destination. If this number |
| 134 | is reached, a shorter timer will be started. |
| 135 | |
| 136 | nf_conntrack_tcp_timeout_close - INTEGER (seconds) |
| 137 | default 10 |
| 138 | |
| 139 | nf_conntrack_tcp_timeout_close_wait - INTEGER (seconds) |
| 140 | default 60 |
| 141 | |
| 142 | nf_conntrack_tcp_timeout_established - INTEGER (seconds) |
| 143 | default 432000 (5 days) |
| 144 | |
| 145 | nf_conntrack_tcp_timeout_fin_wait - INTEGER (seconds) |
| 146 | default 120 |
| 147 | |
| 148 | nf_conntrack_tcp_timeout_last_ack - INTEGER (seconds) |
| 149 | default 30 |
| 150 | |
| 151 | nf_conntrack_tcp_timeout_max_retrans - INTEGER (seconds) |
| 152 | default 300 |
| 153 | |
| 154 | nf_conntrack_tcp_timeout_syn_recv - INTEGER (seconds) |
| 155 | default 60 |
| 156 | |
| 157 | nf_conntrack_tcp_timeout_syn_sent - INTEGER (seconds) |
| 158 | default 120 |
| 159 | |
| 160 | nf_conntrack_tcp_timeout_time_wait - INTEGER (seconds) |
| 161 | default 120 |
| 162 | |
| 163 | nf_conntrack_tcp_timeout_unacknowledged - INTEGER (seconds) |
| 164 | default 300 |
| 165 | |
| 166 | nf_conntrack_timestamp - BOOLEAN |
Mauro Carvalho Chehab | 13df433 | 2020-04-30 18:04:07 +0200 | [diff] [blame] | 167 | - 0 - disabled (default) |
| 168 | - not 0 - enabled |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 169 | |
| 170 | Enable connection tracking flow timestamping. |
| 171 | |
| 172 | nf_conntrack_udp_timeout - INTEGER (seconds) |
| 173 | default 30 |
| 174 | |
Olivier Gayot | bb38ccc | 2018-06-04 12:07:37 +0200 | [diff] [blame] | 175 | nf_conntrack_udp_timeout_stream - INTEGER (seconds) |
Florian Westphal | 294304e | 2018-12-18 00:05:29 +0100 | [diff] [blame] | 176 | default 120 |
Jiri Pirko | c9f9e0e | 2013-01-17 23:05:08 +0000 | [diff] [blame] | 177 | |
| 178 | This extended timeout will be used in case there is an UDP stream |
| 179 | detected. |
Yafang Shao | a0badcc | 2018-12-18 21:14:07 +0800 | [diff] [blame] | 180 | |
| 181 | nf_conntrack_gre_timeout - INTEGER (seconds) |
| 182 | default 30 |
| 183 | |
| 184 | nf_conntrack_gre_timeout_stream - INTEGER (seconds) |
| 185 | default 180 |
| 186 | |
| 187 | This extended timeout will be used in case there is an GRE stream |
| 188 | detected. |
Oz Shlomo | 3078d96 | 2021-06-17 09:50:06 +0300 | [diff] [blame] | 189 | |
Ryoga Saito | 7a3f5b0 | 2021-08-17 08:39:37 +0000 | [diff] [blame] | 190 | nf_hooks_lwtunnel - BOOLEAN |
| 191 | - 0 - disabled (default) |
| 192 | - not 0 - enabled |
| 193 | |
| 194 | If this option is enabled, the lightweight tunnel netfilter hooks are |
| 195 | enabled. This option cannot be disabled once it is enabled. |
| 196 | |
Oz Shlomo | 3078d96 | 2021-06-17 09:50:06 +0300 | [diff] [blame] | 197 | nf_flowtable_tcp_timeout - INTEGER (seconds) |
| 198 | default 30 |
| 199 | |
| 200 | Control offload timeout for tcp connections. |
| 201 | TCP connections may be offloaded from nf conntrack to nf flow table. |
| 202 | Once aged, the connection is returned to nf conntrack with tcp pickup timeout. |
| 203 | |
Oz Shlomo | 3078d96 | 2021-06-17 09:50:06 +0300 | [diff] [blame] | 204 | nf_flowtable_udp_timeout - INTEGER (seconds) |
| 205 | default 30 |
| 206 | |
| 207 | Control offload timeout for udp connections. |
| 208 | UDP connections may be offloaded from nf conntrack to nf flow table. |
| 209 | Once aged, the connection is returned to nf conntrack with udp pickup timeout. |