搬瓦工openvz shadowsocks优化加速

有很多朋友反应在搬瓦工这种openvz架构下按照ShadowSocks优化加速一文修改sysctl.conf会报如下错误,

 error: permission denied on key 'net.ipv4.tcp_max_syn_backlog'
 error: permission denied on key 'net.core.netdev_max_backlog'
 error: permission denied on key 'net.core.wmem_default'
 error: permission denied on key 'net.core.rmem_default'
 error: permission denied on key 'net.core.rmem_max'
 error: permission denied on key 'net.core.wmem_max'
 error: permission denied on key 'net.ipv4.tcp_timestamps'
 error: permission denied on key 'net.ipv4.tcp_synack_retries'
 error: permission denied on key 'net.ipv4.tcp_syn_retries'
 error: permission denied on key 'net.ipv4.tcp_tw_recycle'
 error: permission denied on key 'net.ipv4.tcp_tw_reuse'
 error: permission denied on key 'net.ipv4.tcp_mem'
 error: permission denied on key 'net.ipv4.tcp_max_orphans'
 error: permission denied on key 'net.ipv4.ip_local_port_range'

其实解决方案很简单,只要删除原来的sysctl并且新建一个软连接就行了。(注意,在删除前请备份/sbin/sysctl)

rm -f /sbin/sysctl
ln -s /bin/true /sbin/sysctl

有些朋友还喜欢添加net bridge相关命令在sysctl中并且得到下面的错误,

 error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
 error: "net.bridge.bridge-nf-call-iptables" is an unknown key
 error: "net.bridge.bridge-nf-call-arptables" is an unknown key

可以运行如下命令解决,

modprobe bridge
lsmod|grep bridge

如果继续得到如下错误,

FATAL: Module bridge not found.

还是用同样的方法新建软链接来解决。(注意,在删除前请备份/sbin/modprobe)

rm -f /sbin/modprobe 
ln -s /bin/true /sbin/modprobe
Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>