error: “net.bridge.bridge-nf-call-iptables” is an unknown key

CentOSでsysctl -pした時のエラー

CentOSでsysctl -pを実行してカーネルパラメータを読み込ませると、以下のエラーが出る場合があります。

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

上記エラーはネットワークのブリッジ接続に関するもので、CentOS標準インストール状態で出ています。サーバーでネットワークブリッジ接続を使われない場合は、modprobe bridgeでブリッジ接続を有効化しないほうが良いでしょう。エラーが気になるようでしたら、/etc/sysctl.confの記述を以下のようにコメントアウトすることで出なくなります。

# Disable netfilter on bridges.
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0

もちろんブリッジ接続に関する設定を無効にしてもネットワークはつながります。

sysctl -pでIPV6に関するエラーが出る場合

IPV6を無効にする設定を行った後に、sysctl -pをすると以下のエラーが出ることがあります。

error: "net.ipv6.conf.all.disable_ipv6" is an unknown key
error: "net.ipv6.conf.default.disable_ipv6" is an unknown key
error: "net.ipv6.conf.lo.disable_ipv6" is an unknown key

このようなエラーが発生する場合、/etc/modprobe.d/のconfの中に以下の記述がされている場合が多いです。

options ipv6 disable=1

modprobe.dでIPV6のモジュール自体を起動時に無効にしているので、カーネルパラメータでnet.ipv6が呼べなくなっているようです。IPV6を無効にする方法としては正しいのですが、エラーが気になる場合は、/etc/sysctl.confで以下の記述を行い、/etc/modprobe.d/の中では設定しないほうが良いでしょう。

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1