Skip to content

Commit 7bafd0d

Browse files
committed
修改某些参数,提高系统性能
1 parent 88492ad commit 7bafd0d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

kernel_tuning_centos.sh

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ echo "0" > /proc/sys/net/ipv4/conf/default/secure_redirects
6161
echo "1" > /proc/sys/net/ipv4/conf/all/log_martians
6262
# Protect from ICMP attacks
6363
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
64+
65+
echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
6466
# Enable RFC-recommended source validation (should not be used on machines which are routers for very complicated networks)
6567
echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter
6668
echo "1" > /proc/sys/net/ipv4/conf/default/rp_filter
@@ -83,3 +85,5 @@ echo "20" > /proc/sys/vm/dirty_background_ratio
8385
#
8486
echo "25" > /proc/sys/vm/dirty_ratio
8587

88+
89+
echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter

kernel_tuning_ubuntu.sh

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
kernel_tuning() {
32
echo '
43
# Syncookies make SYN flood attacks ineffective
54
net.ipv4.tcp_syncookies = 1
@@ -69,6 +68,4 @@ root hard nofile 256000
6968
grep "session required pam_limits.so" /etc/pam.d/common-session >/dev/null || {
7069
echo 'session required pam_limits.so' >> /etc/pam.d/common-session
7170
}
72-
}
7371

74-
kernel_tuning;

0 commit comments

Comments
 (0)