为了优化旁路由的网络性能,我在sysctl.conf中配置了一些关于conntrack的配置,结果发现重启后竟然不生效。
谷歌了一下,原来是nf_conntrack开机不会自动加载,而是当首次使用的时候懒加载,所以开机时压根还没有这个内核模块,所以无法生效参数。(地址:https://serverfault.com/questions/161530/persisting-nf-conntrack-max-across-reboots)
解决方法就是在/etc/modules文件中,添加一行nf_conntrack即可:
1 2 3 4 5 6 |
(base) root@debian:/home/work# cat /etc/modules # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. nf_conntrack |
如果文章帮助您解决了工作难题,您可以帮我点击屏幕上的任意广告,或者赞助少量费用来支持我的持续创作,谢谢~
