来自:https://www.kernel.org/doc/html/latest/admin-guide/sysctl/user.html
sysctl 命令:
sysctl命令被用于在内核运行时动态地修改内核的运行参数,
可用的内核参数在目录/proc/sys中。它包含一些TCP/ip堆栈和
虚拟内存系统的高级选项, 这可以让有经验的管理员提高引人注目的系统性能。用sysctl可以读取设置超过五百个系统变量。
sysctl -a :查看所有可读变量
编辑此文件:/etc/sysctl.conf :内核参数设定文件,永久有效
sysctl :
-p:从配置文件“/etc/sysctl.conf”加载内核参数设置
sysctl -a :查看所有可读变量
Table : Subdirectories in /proc/sys/net
Directory Content Directory Content core 内核 General parameter appletalk Appletalk protocol unix unix 套接字 Unix domain sockets netrom NET/ROM 802 802 协议,物理层数据链路层 E802 protocol ax25 AX25 ethernet 以太网 Ethernet protocol rose X.25 PLP layer ipv4 IP version 4 x25 X.25 protocol bridge Bridging decnet DEC net ipv6 IP version 6 tipc TIPC
配置文件
[root@kube ipv4]# pwd /proc/sys/net/ipv4 [root@kube ipv4]# ls cipso_cache_bucket_size igmp_qrv ip_nonlocal_bind tcp_ecn tcp_mem tcp_synack_retries cipso_cache_enable inet_peer_maxttl ip_no_pmtu_disc tcp_fack tcp_min_tso_segs tcp_syncookies cipso_rbm_optfmt inet_peer_minttl neigh tcp_fastopen tcp_moderate_rcvbuf tcp_syn_retries cipso_rbm_strictvalid inet_peer_threshold ping_group_range tcp_fastopen_key tcp_mtu_probing tcp_thin_dupack conf ip_default_ttl route tcp_fin_timeout tcp_no_metrics_save tcp_thin_linear_timeouts fwmark_reflect ip_dynaddr tcp_abort_on_overflow tcp_frto tcp_notsent_lowat tcp_timestamps icmp_echo_ignore_all ip_early_demux tcp_adv_win_scale tcp_invalid_ratelimit tcp_orphan_retries tcp_tso_win_divisor icmp_echo_ignore_broadcasts ip_forward tcp_allowed_congestion_control tcp_keepalive_intvl tcp_reordering tcp_tw_recycle icmp_errors_use_inbound_ifaddr ip_forward_use_pmtu tcp_app_win tcp_keepalive_probes tcp_retrans_collapse tcp_tw_reuse icmp_ignore_bogus_error_responses ipfrag_high_thresh tcp_autocorking tcp_keepalive_time tcp_retries1 tcp_window_scaling icmp_msgs_burst ipfrag_low_thresh tcp_available_congestion_control tcp_limit_output_bytes tcp_retries2 tcp_wmem icmp_msgs_per_sec ipfrag_max_dist tcp_base_mss tcp_low_latency tcp_rfc1337 tcp_workaround_signed_windows icmp_ratelimit ipfrag_secret_interval tcp_challenge_ack_limit tcp_max_orphans tcp_rmem udp_mem icmp_ratemask ipfrag_time tcp_congestion_control tcp_max_ssthresh tcp_sack udp_rmem_min igmp_max_memberships ip_local_port_range tcp_dsack tcp_max_syn_backlog tcp_slow_start_after_idle udp_wmem_min igmp_max_msf ip_local_reserved_ports tcp_early_retrans tcp_max_tw_buckets tcp_stdurg xfrm4_gc_thresh [root@kube ipv4]#