解决kvm虚拟机设置内核bridge参数报未知的key

时间:2022-02-26 21:32:22

安装kvm时我们需要设置bridge。当我们安装bridge-util后,会发现/etc/sysctl.conf中添加了与防火墙相关的参数。但是当我们执行sysctl -p时,报错说key未知。这是因为我们没有加载bridge模块,需要手工加载。解决过程如下:

[root@vm6 ~]# sysctl -p net.ipv4.ip_forward = 1 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 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 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296
[root@vm6 ~]# lsmod|grep bridge [root@vm6 ~]# modprobe bridge [root@vm6 ~]# lsmod|grep bridge bridge                 79950  0  stp                     2173  2 bridge,garp llc                     5642  3 bridge,garp,stp [root@vm6 ~]# sysctl -p           net.ipv4.ip_forward = 1 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296

本文出自 “技术成就梦想” 博客,请务必保留此出处http://hxl2009.blog.51cto.com/779549/1061514