📄 proc.txt
字号:
-------------------------------------------------------There are only two files in this subdirectory. They control the delays fordeleting and destroying socket descriptors.2.8 /proc/sys/net/ipv4 - IPV4 settings--------------------------------------IP version 4 is still the most used protocol in Unix networking. It will bereplaced by IP version 6 in the next couple of years, but for the moment it'sthe de facto standard for the internet and is used in most networkingenvironments around the world. Because of the importance of this protocol,we'll have a deeper look into the subtree controlling the behavior of the IPv4subsystem of the Linux kernel.Let's start with the entries in /proc/sys/net/ipv4.ICMP settings-------------icmp_echo_ignore_all and icmp_echo_ignore_broadcasts----------------------------------------------------Turn on (1) or off (0), if the kernel should ignore all ICMP ECHO requests, orjust those to broadcast and multicast addresses.Please note that if you accept ICMP echo requests with a broadcast/multi\-castdestination address your network may be used as an exploder for denial ofservice packet flooding attacks to other hosts.icmp_destunreach_rate, icmp_echoreply_rate, icmp_paramprob_rate and icmp_timeexeed_rate---------------------------------------------------------------------------------------Sets limits for sending ICMP packets to specific targets. A value of zerodisables all limiting. Any positive value sets the maximum package rate inhundredth of a second (on Intel systems).IP settings-----------ip_autoconfig-------------This file contains the number one if the host received its IP configuration byRARP, BOOTP, DHCP or a similar mechanism. Otherwise it is zero.ip_default_ttl--------------TTL (Time To Live) for IPv4 interfaces. This is simply the maximum number ofhops a packet may travel.ip_dynaddr----------Enable dynamic socket address rewriting on interface address change. This isuseful for dialup interface with changing IP addresses.ip_forward----------Enable or disable forwarding of IP packages between interfaces. Changing thisvalue resets all other parameters to their default values. They differ if thekernel is configured as host or router.ip_local_port_range-------------------Range of ports used by TCP and UDP to choose the local port. Contains twonumbers, the first number is the lowest port, the second number the highestlocal port. Default is 1024-4999. Should be changed to 32768-61000 forhigh-usage systems.ip_no_pmtu_disc---------------Global switch to turn path MTU discovery off. It can also be set on a persocket basis by the applications or on a per route basis.ip_masq_debug-------------Enable/disable debugging of IP masquerading.IP fragmentation settings-------------------------ipfrag_high_trash and ipfrag_low_trash--------------------------------------Maximum memory used to reassemble IP fragments. When ipfrag_high_thresh bytesof memory is allocated for this purpose, the fragment handler will tosspackets until ipfrag_low_thresh is reached.ipfrag_time-----------Time in seconds to keep an IP fragment in memory.TCP settings------------tcp_ecn-------This file controls the use of the ECN bit in the IPv4 headers, this is a newfeature about Explicit Congestion Notification, but some routers and firewallsblock trafic that has this bit set, so it could be necessary to echo 0 to/proc/sys/net/ipv4/tcp_ecn, if you want to talk to this sites. For more infoyou could read RFC2481.tcp_retrans_collapse--------------------Bug-to-bug compatibility with some broken printers. On retransmit, try to sendlarger packets to work around bugs in certain TCP stacks. Can be turned off bysetting it to zero.tcp_keepalive_probes--------------------Number of keep alive probes TCP sends out, until it decides that theconnection is broken.tcp_keepalive_time------------------How often TCP sends out keep alive messages, when keep alive is enabled. Thedefault is 2 hours.tcp_syn_retries---------------Number of times initial SYNs for a TCP connection attempt will beretransmitted. Should not be higher than 255. This is only the timeout foroutgoing connections, for incoming connections the number of retransmits isdefined by tcp_retries1.tcp_sack--------Enable select acknowledgments after RFC2018.tcp_timestamps--------------Enable timestamps as defined in RFC1323.tcp_stdurg----------Enable the strict RFC793 interpretation of the TCP urgent pointer field. Thedefault is to use the BSD compatible interpretation of the urgent pointerpointing to the first byte after the urgent data. The RFC793 interpretation isto have it point to the last byte of urgent data. Enabling this option maylead to interoperatibility problems. Disabled by default.tcp_syncookies--------------Only valid when the kernel was compiled with CONFIG_SYNCOOKIES. Send outsyncookies when the syn backlog queue of a socket overflows. This is to wardoff the common 'syn flood attack'. Disabled by default.Note that the concept of a socket backlog is abandoned. This means the peermay not receive reliable error messages from an over loaded server withsyncookies enabled.tcp_window_scaling------------------Enable window scaling as defined in RFC1323.tcp_fin_timeout---------------The length of time in seconds it takes to receive a final FIN before thesocket is always closed. This is strictly a violation of the TCPspecification, but required to prevent denial-of-service attacks.tcp_max_ka_probes-----------------Indicates how many keep alive probes are sent per slow timer run. Should notbe set too high to prevent bursts.tcp_max_syn_backlog-------------------Length of the per socket backlog queue. Since Linux 2.2 the backlog specifiedin listen(2) only specifies the length of the backlog queue of alreadyestablished sockets. When more connection requests arrive Linux starts to droppackets. When syncookies are enabled the packets are still answered and themaximum queue is effectively ignored.tcp_retries1------------Defines how often an answer to a TCP connection request is retransmittedbefore giving up.tcp_retries2------------Defines how often a TCP packet is retransmitted before giving up.Interface specific settings---------------------------In the directory /proc/sys/net/ipv4/conf you'll find one subdirectory for eachinterface the system knows about and one directory calls all. Changes in theall subdirectory affect all interfaces, whereas changes in the othersubdirectories affect only one interface. All directories have the sameentries:accept_redirects----------------This switch decides if the kernel accepts ICMP redirect messages or not. Thedefault is 'yes' if the kernel is configured for a regular host and 'no' for arouter configuration.accept_source_route-------------------Should source routed packages be accepted or declined. The default isdependent on the kernel configuration. It's 'yes' for routers and 'no' forhosts.bootp_relay~~~~~~~~~~~Accept packets with source address 0.b.c.d with destinations not to this hostas local ones. It is supposed that a BOOTP relay daemon will catch and forwardsuch packets.The default is 0, since this feature is not implemented yet (kernel version2.2.12).forwarding----------Enable or disable IP forwarding on this interface.log_martians------------Log packets with source addresses with no known route to kernel log.mc_forwarding-------------Do multicast routing. The kernel needs to be compiled with CONFIG_MROUTE and amulticast routing daemon is required.proxy_arp---------Does (1) or does not (0) perform proxy ARP.rp_filter---------Integer value determines if a source validation should be made. 1 means yes, 0means no. Disabled by default, but local/broadcast address spoofing is alwayson.If you set this to 1 on a router that is the only connection for a network tothe net, it will prevent spoofing attacks against your internal networks(external addresses can still be spoofed), without the need for additionalfirewall rules.secure_redirects----------------Accept ICMP redirect messages only for gateways, listed in default gatewaylist. Enabled by default.shared_media------------If it is not set the kernel does not assume that different subnets on thisdevice can communicate directly. Default setting is 'yes'.send_redirects--------------Determines whether to send ICMP redirects to other hosts.Routing settings----------------The directory /proc/sys/net/ipv4/route contains several file to controlrouting issues.error_burst and error_cost--------------------------These parameters are used to limit the warning messages written to the kernellog from the routing code. The higher the error_cost factor is, the fewermessages will be written. Error_burst controls when messages will be dropped.The default settings limit warning messages to one every five seconds.flush-----Writing to this file results in a flush of the routing cache.gc_elastic, gc_interval, gc_min_interval, gc_tresh, gc_timeout--------------------------------------------------------------Values to control the frequency and behavior of the garbage collectionalgorithm for the routing cache.max_size--------Maximum size of the routing cache. Old entries will be purged once the cachereached has this size.max_delay, min_delay--------------------Delays for flushing the routing cache.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -