ÎÒÃdz£³£ÔÚ Linux µÄ /proc/sys Ŀ¼ÏÂ,ÊÖ¶¯É趨һЩ kernel µÄ²ÎÊý»òÊÇÖ±½Ó echo Ìض¨µÄÖµ¸øÒ»¸ö procϵÄÐéÄâµµ°¸,ÙÂÀûijЩµµ°¸Ö®¿ªÆô,³£¼ûµÄÀýÈçÉ趨¿ª»úʱ×Ô¶¯Æô¶¯ IP Forwarding:
echo ¡°1¡± > /proc/sys/net/ipv4/ip_forward
Æäʵ,ÔÚ Linux ÎÒÃÇ»¹¿ÉÒÔÓà sysctl command ±ã¿ÉÒÔ¼òÒ×µÄÈ¥¼ìÊÓ¡¢É趨»ò×Ô¶¯ÅäÖà Ìض¨µÄ kernel É趨¡£ÎÒÃÇ¿ÉÒÔÔÚϵͳÌáʾ·ûºÅÏÂÊäÈ롸sysctl -a¡¹,ÕªÒªÈçºó:abi.defhandler_coff = 117440515
dev.raid.speed_limit_max = 100000
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.default.secure_redirects = 1
net.ipv4.conf.default.accept_redirects = 1
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.neigh.lo.delay_first_probe_time = 5
net.ipv4.neigh.lo.base_reachable_time = 30
net.ipv4.icmp_ratelimit = 100
net.ipv4.inet_peer_gc_mintime = 10
net.ipv4.igmp_max_memberships = 20
net.ipv4.ip_no_pmtu_disc = 0
net.core.no_cong_thresh = 20
net.core.netdev_max_backlog = 300
net.core.rmem_default = 65535
net.core.wmem_max = 65535
vm.kswapd = 512 32 8
vm.overcommit_memory = 0
vm.bdflush = 30 64 64 256 500 3000 60 0 0
vm.freepages = 351 702 1053
kernel.sem = 250 32000 32 128
kernel.panic = 0
kernel.domainname = (none)
kernel.hostname = pc02.shinewave.com.tw
kernel.version = #1 Tue Oct 30 20:11:04 EST 2001
kernel.osrelease = 2.4.9-13
kernel.ostype = Linux
fs.dentry-state = 1611 969 45 0 0 0
fs.file-nr = 1121 73 8192
fs.inode-state = 1333 523 0 0 0 0 0
´ÓÉÏÊöµÄÓï·¨ÎÒÃÇ´ó¸Å¿É¿´³ö sysctl µÄ±íʾ·¨ÄË°ÑĿ¼½á¹¹µÄ¡¸/¡¹ÒÔ¡¸.¡¹±íʾ,Ò»²ãÒ»²ãµÄÁ¬½áÏÂÈ¥¡£µ±È»ÒÔecho Ìض¨µÄÖµ¸øÒ»¸ö procϵÄÐéÄâµµ°¸Ò²ÊÇ¿ÉÒÔÓà sysctl¼ÓÒÔ±íʾ,ÀýÈç:
#sysctl -w net.ipv4.ip_forward =¡±1¡±
»òÊÇÖ±½ÓÔÚ /etc/sysctl.conf ÔöɾÐÞ¸ÄÌض¨µµ°¸µÄ 0,1ÖµÒà¿É:
# Enables packet forwarding
net.ipv4.ip_forward = 1
# Enables source route verification
net.ipv4.conf.default.rp_filter = 1
# Disables the magic-sysrq key
kernel.sysrq = 0
µ±È»Èç¹û¿¼ÂÇ reboot ºóÈÔÓÐЧ, Ö±½ÓÔÚ /etc/sysctl.conf ÔöɾÐÞ¸ÄÌض¨µµ°¸µÄ 0,1Öµ²Å¿Éʹ֮±£ÁôÉ趨(ÒÔRedHat ΪÀý,ÿ´Î¿ª»úϵͳÆô¶¯ºó, init »áÖ´ÐÐ /etc/rc.d/rc.sysinit,±ã»áʹÓà /etc/sysctl.conf µÄÔ¤ÉèֵȥִÐÐ sysctl)¡£
Ïà¹Ø²Î¿¼µµ°¸:
/sbin/sysctl
/etc/sysctl.conf
sysctl ¼°sysctl.conf manpage
/usr/src/linux-x.y.z/Documentation/sysctl/*
/usr/share/doc/kernel-doc-x.y.z/sysctl/* (RedHat)