| 1 |
.\" Copyright, the authors of the Linux man-pages project |
| 2 |
.\" |
| 3 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 4 |
.\" |
| 5 |
.TH proc_sys_net_ipv4 5 2025-12-25 "Linux man-pages 6.18" |
| 6 |
.SH NAME |
| 7 |
/proc/sys/net/ipv4/ |
| 8 |
\- |
| 9 |
IPv4 |
| 10 |
.SH DESCRIPTION |
| 11 |
The IP protocol |
| 12 |
supports a set of |
| 13 |
.I /proc |
| 14 |
interfaces to configure some global parameters. |
| 15 |
The parameters can be accessed by reading or writing files in the directory |
| 16 |
.IR /proc/sys/net/ipv4/ . |
| 17 |
.\" FIXME As at 2.6.12, 14 Jun 2005, the following are undocumented: |
| 18 |
.\" /proc/sys/net/ipv4/ip_queue_maxlen |
| 19 |
.\" /proc/sys/net/ipv4/ip_conntrack_max |
| 20 |
Interfaces described as |
| 21 |
.I Boolean |
| 22 |
take an integer value, with a nonzero value ("true") meaning that |
| 23 |
the corresponding option is enabled, and a zero value ("false") |
| 24 |
meaning that the option is disabled. |
| 25 |
.\" |
| 26 |
.TP |
| 27 |
.IR /proc/sys/net/ipv4/ip_always_defrag " (Boolean; since Linux 2.2.13)" |
| 28 |
[New with Linux 2.2.13; |
| 29 |
in earlier kernel versions this feature |
| 30 |
was controlled at compile time by the |
| 31 |
.B CONFIG_IP_ALWAYS_DEFRAG |
| 32 |
option; this option is not present in Linux 2.4.x and later] |
| 33 |
.IP |
| 34 |
When this boolean flag is enabled (not equal 0), incoming fragments |
| 35 |
(parts of IP packets |
| 36 |
that arose when some host between origin and destination decided |
| 37 |
that the packets were too large and cut them into pieces) will be |
| 38 |
reassembled (defragmented) before being processed, even if they are |
| 39 |
about to be forwarded. |
| 40 |
.IP |
| 41 |
Enable only if running |
| 42 |
either a firewall that is the sole link to your network |
| 43 |
or a transparent proxy; |
| 44 |
never ever use it for a normal router or host. |
| 45 |
Otherwise, |
| 46 |
fragmented communication can be disturbed |
| 47 |
if the fragments travel over different links. |
| 48 |
Defragmentation also has a large memory and CPU time cost. |
| 49 |
.IP |
| 50 |
This is automagically turned on |
| 51 |
when masquerading or transparent proxying are configured. |
| 52 |
.\" |
| 53 |
.TP |
| 54 |
.IR /proc/sys/net/ipv4/ip_autoconfig " (since Linux 2.2 to Linux 2.6.17)" |
| 55 |
.\" Precisely: since Linux 2.1.68 |
| 56 |
.\" FIXME document /proc/sys/net/ipv4/ip_autoconfig |
| 57 |
Not documented. |
| 58 |
.\" |
| 59 |
.TP |
| 60 |
.IR /proc/sys/net/ipv4/ip_default_ttl " (integer; default: 64; since Linux 2.2)" |
| 61 |
.\" Precisely: since Linux 2.1.15 |
| 62 |
Set the default time-to-live value of outgoing packets. |
| 63 |
This can be changed per socket with the |
| 64 |
.B IP_TTL |
| 65 |
option. |
| 66 |
.\" |
| 67 |
.TP |
| 68 |
.IR /proc/sys/net/ipv4/ip_dynaddr " (Boolean; default: disabled; since Linux 2.0.31)" |
| 69 |
Enable dynamic socket address and masquerading entry rewriting on interface |
| 70 |
address change. |
| 71 |
This is useful for dialup interface with changing IP addresses. |
| 72 |
0 means no rewriting, 1 turns it on and 2 enables verbose mode. |
| 73 |
.\" |
| 74 |
.TP |
| 75 |
.IR /proc/sys/net/ipv4/ip_forward " (Boolean; default: disabled; since Linux 1.2)" |
| 76 |
Enable IP forwarding with a boolean flag. |
| 77 |
IP forwarding can be also set on a per-interface basis. |
| 78 |
.\" |
| 79 |
.TP |
| 80 |
.IR /proc/sys/net/ipv4/ip_local_port_range " (since Linux 2.2)" |
| 81 |
.\" Precisely: since Linux 2.1.68 |
| 82 |
This file contains two integers that define the default local port range |
| 83 |
allocated to sockets that are not explicitly bound to a port number\[em]that |
| 84 |
is, the range used for |
| 85 |
.IR "ephemeral ports" . |
| 86 |
An ephemeral port is allocated to a socket in the following circumstances: |
| 87 |
.RS |
| 88 |
.IP \[bu] 3 |
| 89 |
the port number in a socket address is specified as 0 when calling |
| 90 |
.BR bind (2); |
| 91 |
.IP \[bu] |
| 92 |
.BR listen (2) |
| 93 |
is called on a stream socket that was not previously bound; |
| 94 |
.IP \[bu] |
| 95 |
.BR connect (2) |
| 96 |
was called on a socket that was not previously bound; |
| 97 |
.IP \[bu] |
| 98 |
.BR sendto (2) |
| 99 |
is called on a datagram socket that was not previously bound. |
| 100 |
.RE |
| 101 |
.IP |
| 102 |
Allocation of ephemeral ports starts with the first number in |
| 103 |
.I /proc/sys/net/ipv4/ip_local_port_range |
| 104 |
and ends with the second number. |
| 105 |
If the range of ephemeral ports is exhausted, |
| 106 |
then the relevant system call returns an error (but see BUGS). |
| 107 |
.IP |
| 108 |
Note that the port range in |
| 109 |
.I /proc/sys/net/ipv4/ip_local_port_range |
| 110 |
should not conflict with the ports used by masquerading |
| 111 |
(although the case is handled). |
| 112 |
Also, arbitrary choices may cause problems with some firewall packet |
| 113 |
filters that make assumptions about the local ports in use. |
| 114 |
The first number should be at least greater than 1024, |
| 115 |
or better, greater than 4096, to avoid clashes |
| 116 |
with well known ports and to minimize firewall problems. |
| 117 |
.\" |
| 118 |
.TP |
| 119 |
.IR /proc/sys/net/ipv4/ip_no_pmtu_disc " (Boolean; default: disabled; since Linux 2.2)" |
| 120 |
.\" Precisely: 2.1.15 |
| 121 |
If enabled, don't do Path MTU Discovery for TCP sockets by default. |
| 122 |
Path MTU discovery may fail if misconfigured firewalls (that drop |
| 123 |
all ICMP packets) or misconfigured interfaces (e.g., a point-to-point |
| 124 |
link where the both ends don't agree on the MTU) are on the path. |
| 125 |
It is better to fix the broken routers on the path than to turn off |
| 126 |
Path MTU Discovery globally, because not doing it incurs a high cost |
| 127 |
to the network. |
| 128 |
.\" |
| 129 |
.TP |
| 130 |
.IR /proc/sys/net/ipv4/ip_nonlocal_bind " (Boolean; default: disabled; since Linux 2.4)" |
| 131 |
.\" Precisely: patch-2.4.0-test10 |
| 132 |
If set, allows processes to |
| 133 |
.BR bind (2) |
| 134 |
to nonlocal IP addresses, |
| 135 |
which can be quite useful, but may break some applications. |
| 136 |
.\" |
| 137 |
.TP |
| 138 |
.IR /proc/sys/net/ipv4/ip6frag_time " (integer; default: 30)" |
| 139 |
Time in seconds to keep an IPv6 fragment in memory. |
| 140 |
.\" |
| 141 |
.TP |
| 142 |
.IR /proc/sys/net/ipv4/ip6frag_secret_interval " (integer; default: 600)" |
| 143 |
Regeneration interval (in seconds) of the hash secret (or lifetime |
| 144 |
for the hash secret) for IPv6 fragments. |
| 145 |
.TP |
| 146 |
.IR /proc/sys/net/ipv4/ipfrag_high_thresh " (integer)" |
| 147 |
.TQ |
| 148 |
.IR /proc/sys/net/ipv4/ipfrag_low_thresh " (integer)" |
| 149 |
If the amount of queued IP fragments reaches |
| 150 |
.IR /proc/sys/net/ipv4/ipfrag_high_thresh , |
| 151 |
the queue is pruned down to |
| 152 |
.IR /proc/sys/net/ipv4/ipfrag_low_thresh . |
| 153 |
Contains an integer with the number of bytes. |
| 154 |
.TP |
| 155 |
.IR /proc/sys/net/ipv4/neigh/ * |
| 156 |
See |
| 157 |
.BR arp (7). |
| 158 |
.\" FIXME Document the conf/*/* interfaces |
| 159 |
.\" |
| 160 |
.\" FIXME Document the route/* interfaces |
| 161 |
.SH SEE ALSO |
| 162 |
.BR proc (5), |
| 163 |
.BR proc_sys_net (5), |
| 164 |
.BR ip (7) |