ip-sysctl
Page based on Documentation/networking/ip-sysctl.txt.
Contents
/proc/sys/net/ipv4
ip_forward
BOOLEAN 0 - disabled (default)
Forward Packets between interfaces. This variable is special, its change resets all configuration parameters to their default state (RFC1122 for hosts, RFC1812 for routers)
ip_default_ttl
INTEGER default 64
IP Fragmentation
ipfrag_low_thresh
INTEGER
See ipfrag_high_thresh
ipfrag_secret_interval
INTEGER default: 600
Regeneration interval (in seconds) of the hash secret (or lifetime for the hash secret) for IP fragments.
ipfrag_max_dist
INTEGER default: 64
ipfrag_max_dist is a non-negative integer value which defines the maximum “disorder” which is allowed among fragments which share a common IP source address. Note that reordering of packets is not unusual, but if a large number of fragments arrive from a source IP address while a particular fragment queue remains incomplete, it probably indicates that one or more fragments belonging to that queue have been lost. When ipfrag_max_dist is positive, an additional check is done on fragments before they are added to a reassembly queue - if ipfrag_max_dist (or more) fragments have arrived from a particular IP address between additions to any IP fragment queue using that source address, it's presumed that one or more fragments in the queue are lost. The existing fragment queue will be dropped, and a new one started. An ipfrag_max_dist value of zero disables this check.
Using a very small value, e.g. 1 or 2, for ipfrag_max_dist can result in unnecessarily dropping fragment queues when normal reordering of packets occurs, which could lead to poor application performance. Using a very large value, e.g. 50000, increases the likelihood of incorrectly reassembling IP fragments that originate from different IP datagrams, which could result in data corruption.
INET peer storage
inet_peer_threshold
INTEGER
The approximate size of the
storage. Starting from this threshold entries will be thrown aggressively. This threshold also determines entries' time-to-live and time intervals between garbage collection passes. More entries, less time-to-live, less GC interval.
=TCP variables
See also tcp_max_syn_backlog for additional tuning for TCP sockets.
Possible values are:
0
increase cwnd once per acknowledgment (no ABC)
1
increase cwnd once per acknowledgment of full sized segment
2
allow increase cwnd by two if acknowledgment is of two segments to compensate for delayed acknowledgments.
tcp_abort_on_overflow
BOOLEAN
If listening service is too slow to accept new connections, reset them. Default state is FALSE. It means that if overflow occurred due to a burst, connection will recover. Enable this option _only_ if you are really sure that listening daemon cannot be tuned to accept connections faster. Enabling this option can harm clients of your server.
if tcp_adv_win_scale > 0
bytes/2^tcp_adv_win_scale
else
bytes-bytes/2^(-tcp_adv_win_scale)
tcp_available_congestion_control
STRING
Shows the available congestion control choices that are registered. More congestion control algorithms may be available as modules, but not loaded.
tcp_fin_timeout
INTEGER
Time to hold socket in state FIN-WAIT-2, if it was closed by our side. Peer can be broken and never close its side, or even died unexpectedly. Default value is 60sec. Usual value used in 2.2 was 180 seconds, you may restore it, but remember that if your machine is even underloaded WEB server, you risk to overflow memory with kilotons of dead sockets, FIN-WAIT-2 sockets are less dangerous than FIN-WAIT-1, because they eat maximum 1.5K of memory, but they tend to live longer. Cf. tcp_max_orphans.
tcp_keepalive_time
INTEGER (default 2hrs)
How often TCP sends out keepalive messages when keepalive is enabled.
after probes started.
tcp_low_latency
BOOLEAN (default 0)
If set, the TCP stack makes decisions that prefer lower latency as opposed to higher throughput. By default, this option is not set meaning that higher throughput is preferred. An example of an application where this default should be changed would be a Beowulf compute cluster.
tcp_max_orphans
INTEGER
Maximal number of TCP sockets not attached to any user file handle, held by system. If this number is exceeded orphaned connections are reset immediately and warning is printed. This limit exists only to prevent simple DoS attacks, you _must_ not rely on this or lower the limit artificially, but rather increase it (probably, after increasing installed memory), if network conditions require more than default value, and tune network services to linger and kill such states more aggressively. Let me to remind again: each orphan eats up to ~64K of unswappable memory.
tcp_max_syn_backlog
INTEGER (default 1024)
Maximal number of remembered connection requests, which are still did not receive an acknowledgment from connecting client. Default value is 1024 for systems with more than 128Mb of memory, and 128 for low memory machines. If server suffers of overload, try to increase this number.
tcp_max_tw_buckets
INTEGER
Maximal number of timewait sockets held by system simultaneously. If this number is exceeded time-wait socket is immediately destroyed and warning is printed. This limit exists only to prevent simple DoS attacks, you _must_ not lower the limit artificially,
but rather increase it (probably, after increasing installed memory), if network conditions require more than default value.
min
below this number of pages TCP is not bothered about its memory appetite.
pressure
when amount of memory allocated by TCP exceeds this number of pages, TCP moderates its memory consumption and enters memory pressure mode, which is exited when memory consumption falls under “min”.
max
number of pages allowed for queueing by all TCP sockets.
Defaults are calculated at boot time from amount of available memory.
tcp_orphan_retries
INTEGER
How may times to retry before killing TCP connection, closed by our side. Default value 7 corresponds to ~50sec-16min depending on RTO. If you machine is loaded WEB server, you should think about lowering this value, such sockets may consume significant resources. Cf. tcp_max_orphans.
tcp_retries1
INTEGER
How many times to retry before deciding that something is wrong and it is necessary to report this suspicion to network layer. Minimal
RFC value is 3, it is default, which corresponds to ~3sec-8min depending on RTO.
tcp_rfc1337
BOOLEAN (default 0)
If set, the TCP stack behaves conforming to RFC1337. If unset, we are not conforming to
RFC, but prevent TCP TIME_WAIT assassination.
min
Minimal size of receive buffer used by TCP sockets. It is guaranteed to each TCP socket, even under moderate memory pressure.
default
default size of receive buffer used by TCP sockets. This value overrides net.core.rmem_default used by other protocols. Default: 87380 bytes. This value results in window of 65535 with default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit less for default tcp_app_win. See below about these variables.
max
maximal size of receive buffer allowed for automatically selected receiver buffers for TCP socket. This value does not override net.core.rmem_max, “static” selection via SO_RCVBUF does not use this.
tcp_slow_start_after_idle
BOOLEAN (default 1)
If set, provide RFC2861 behavior and time out the congestion window after an idle period. An idle period is defined at the current RTO. If unset, the congestion window will not be timed out after an idle period.
Note, that syncookies is fallback facility. It MUST NOT be used to help highly loaded servers to stand against legal connection rate. If you see synflood warnings in your logs, but investigation shows that they occur because of overload with legal connections, you should tune another parameters until this warning disappear.
See: tcp_max_syn_backlog, tcp_synack_retries, tcp_abort_on_overflow.
syncookies seriously violate TCP protocol, do not allow to use TCP extensions, can result in serious degradation of some services (f.e. SMTP relaying), visible not by you, but your clients and relays, contacting you. While you see synflood warnings in logs not being really flooded, your server is seriously misconfigured.
min
Amount of memory reserved for send buffers for TCP socket. Each TCP socket has rights to use it due to fact of its birth.
default
Amount of memory allowed for send buffers for TCP socket by default. This value overrides net.core.wmem_default used by other protocols, it is usually lower than net.core.wmem_default.
max
Maximal amount of memory allowed for automatically selected send buffers for TCP socket. This value does not override net.core.wmem_max, “static” selection via SO_SNDBUF does not use this.
tcp_workaround_signed_windows
BOOLEAN (default 0)
If set, assume no receipt of a window scaling option means the remote TCP is broken and treats the window as a signed quantity. If unset, assume the remote TCP is not broken even if we do not receive a window scaling option from them.
CIPSOv4
cipso_cache_enable
BOOLEAN (default 1)
If set, enable additions to and lookups from the CIPSO label mapping cache. If unset, additions are ignored and lookups always result in a miss. However, regardless of the setting the cache is still invalidated when required when means you can safely toggle this on and off and the cache will always be “safe”.
cipso_rbm_structvalid
BOOLEAN (default 0)
If set, do a very strict check of the CIPSO option when ip_options_compile() is called. If unset, relax the checks done during ip_options_compile(). Either way is “safe” as errors are caught else where in the CIPSO processing code but setting this to 0 (False) should result in less work (i.e. it should be faster) but could cause problems with other implementations that require strict checking.
IP Variables
| 32768-61000|
icmp_echo_ignore_broadcasts
BOOLEAN (default 1)
If set non-zero, then the kernel will ignore all ICMP ECHO and TIMESTAMP requests sent to it via broadcast/multicast.
Significant bits: IHGFEDCBA9876543210
Default mask: 0000001100000011000 (6168)
Bit definitions (see include/linux/icmp.h):
0 Echo Reply
3 Destination Unreachable *
4 Source Quench *
5 Redirect
8 Echo Request
B Time Exceeded *
C Parameter Problem *
D Timestamp Request
E Timestamp Reply
F Info Request
G Info Reply
H Address Mask Request
I Address Mask Reply
* These are rate limited by default (see default mask above)
icmp_ignore_bogus_error_responses
BOOLEAN (default FALSE)
Some routers violate RFC1122 by sending bogus responses to broadcast frames. Such violations are normally logged via a kernel warning. If this is set to TRUE, the kernel will not give such warnings, which will avoid log file clutter.
icmp_errors_use_inbound_ifaddr
BOOLEAN (default 0)a
If zero, icmp error messages are sent with the primary address of the exiting interface. If non-zero, the message will be sent with the primary address of the interface that received the packet that caused the icmp error. This is the behaviour network many administrators will expect from a router. And it can make debugging complicated network layouts much easier.
Note that if no primary address exists for the interface selected, then the primary address of the first non-loopback interface that has one will be used regardless of this setting.
conf/interface
changes special settings per interface (where "interface" is the name of your network interface) **conf/all/** is special, changes the settings for all interfaces.
accept_redirects for the interface will be enabled if:
- both conf/{all,interface}/accept_redirects are TRUE in the case forwarding for the interface is enabled
or
- at least one of conf/{all,interface}/accept_redirects is TRUE in the case forwarding for the interface is disabled
accept_redirects for the interface will be disabled otherwise
default TRUE (host)
FALSE (router)
medium_id
INTEGER
Integer value used to differentiate the devices by the medium they are attached to. Two devices can have different id values when the broadcast packets are received only on one of them. The default value 0 means that the device is the only interface to its medium, value of -1 means that medium is not known.
Currently, it is used to change the proxy_arp behavior: the proxy_arp feature is enabled for packets forwarded between two devices attached to different media.
shared_media
BOOLEAN (default TRUE)
Send(router) or accept(host) RFC1620 shared media redirects. Overrides ip_secure_redirects. shared_media for the interface will be enabled if at least one of conf/{all,interface}/shared_media is set to TRUE, it will be disabled otherwise
secure_redirects
BOOLEAN (default TRUE)
Accept ICMP redirect messages only for gateways, listed in default gateway list. secure_redirects for the interface will be enabled if at least one of conf/{all,interface}/secure_redirects is set to TRUE, it will be disabled otherwise
send_redirects
BOOLEAN (default TRUE)
Send redirects, if router. send_redirects for the interface will be enabled if at least one of conf/{all,interface}/send_redirects is set to TRUE, it will be disabled otherwise.
Not Implemented Yet.
default TRUE (router) / FALSE (host)
1
do source validation by reversed path, as specified in RFC1812. Recommended option for single homed hosts and stub network routers. Could cause troubles for complicated (not loop free) networks running a slow unreliable protocol (sort of RIP), or using static routes.
0
No source validation.
conf/all/rp_filter must also be set to TRUE to do source validation on the interface. Default value is 0. Note that some distributions enable it in startup scripts.
1
Allows you to have multiple network interfaces on the same subnet, and have the ARPs for each interface be answered based on whether or not the kernel would route a packet from the ARP'd IP out that interface (therefore you must use source based routing for this to work). In other words it allows control of which cards (usually 1) will respond to an arp request.
0
(default) The kernel can respond to arp requests with addresses from other interfaces. This may seem wrong but it usually makes sense, because it increases the chance of successful communication. IP addresses are owned by the complete host on Linux, not by particular interfaces. Only for more complex setups like load-balancing, does this behaviour cause problems.
arp_filter for the interface will be enabled if at least one of conf/{all,interface}/arp_filter is set to TRUE,it will be disabled otherwise
0
(default) Use any local address, configured on any interface
1
Try to avoid local addresses that are not in the target's subnet for this interface. This mode is useful when target hosts reachable via this interface require the source IP address in ARP requests to be part of their logical network configured on the receiving interface. When we generate the request we will check all our subnets that include the target IP and will preserve the source address if it is from such subnet. If there is no such subnet we select source address according to the rules for level 2.
2
Always use the best local address for this target. In this mode we ignore the source address in the IP packet and try to select local address that we prefer for talks with the target host. Such local address is selected by looking for primary IP addresses on all our subnets on the outgoing interface that include the target IP address. If no suitable local address is found we select the first local address we have on the outgoing interface or on all other interfaces, with the hope we will receive reply for our request and even sometimes no matter the source IP address we announce.
The max value from conf/{all,interface}/arp_announce is used.
Increasing the restriction level gives more chance for receiving answer from the resolved target while decreasing the level announces more valid sender's information.
0
(default): reply for any local target IP address, configured on any interface
1
reply only if the target IP address is local address configured on the incoming interface
2
reply only if the target IP address is local address configured on the incoming interface and both with the sender's IP address are part from same subnet on this interface
3
do not reply for local addresses configured with scope host, only resolutions for global and link addresses are replied
4-7
reserved
8
do not reply for all local addresses
/proc/sys/net/ipv6/*
IPv6 has no global variables such as tcp_*. tcp_* settings under ipv4/ also
apply to IPv6 [XXX?].
TRUE
disable IPv4-mapped address feature
FALSE
enable IPv4-mapped address feature
Default: FALSE (as specified in RFC2553bis)
IPv6 Fragmentation
ip6frag_low_thresh
INTEGER
See ip6frag_high_thresh
conf/default
Change the interface-specific default settings.
conf/all
Change all the interface-specific settings.
This also sets all interfaces' Host/Router setting 'forwarding' to the specified value. See below for details. This referred to as global forwarding.
proxy_ndp
BOOLEAN
Do proxy ndp.
conf/interface/
Change special settings per interface.
The functional behaviour for certain settings is different depending on whether local forwarding is enabled or not.
accept_ra_rt_info_max_plen
INTEGER
Maximum prefix length of Route Information in RA.
Route Information w/ prefix larger than or equal to this variable shall be ignored.
Functional default: 0 if accept_ra_rtr_pref is enabled. -1 if accept_ra_rtr_pref is disabled.
By default, Host behaviour is assumed. This means: - IsRouter flag is not set in Neighbour Advertisements.
Router Solicitations are being sent when necessary.
If accept_ra is TRUE (default), accept Router Advertisements (and do autoconfiguration).
If accept_redirects is TRUE (default), accept Redirects.
If local forwarding is enabled, Router behaviour is assumed. This means exactly the reverse from the above: - IsRouter flag is set in Neighbour Advertisements.
Router Solicitations are not sent.
Router Advertisements are ignored.
Redirects are ignored.
⇐ 0
disable Privacy Extensions
== 1
enable Privacy Extensions, but prefer public addresses over temporary addresses.
> 1
enable Privacy Extensions and prefer temporary addresses over public addresses.
Default: 0 (for most devices), -1 (for point-to-point devices and loopback devices)
icmp
Limit the maximal rates for sending ICMPv6 packets.
/proc/sys/net/bridge
bridge-nf-call-arptables
BOOLEAN
bridge-nf-call-iptables
BOOLEAN
bridge-nf-call-ip6tables
BOOLEAN