net.ipv4.conf.all.forwardingとnet.ipv4.ip_forwardの違い

net.ipv4.conf.all.forwardingとnet.ipv4.ip_forwardの違い

~によるとhttps://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt

conf/all/*    is special, changes the settings for all interfaces
forwarding - BOOLEAN
    Enable IP forwarding on this interface.  This controls whether packets
    received _on_ this interface can be forwarded.
ip_forward - BOOLEAN
    0 - disabled (default)
    not 0 - enabled

    Forward Packets between interfaces.

    This variable is special, its change resets all configuration
    parameters to their default state (RFC1122 for hosts, RFC1812
    for routers)

したがって、すべてのインターフェイスでIPv4パケット転送を無効にすることは、net.ipv4.conf.all.forwarding=0すべてのインターフェイスでIPv4パケット転送を無効にすることと同じです。net.ipv4.ip_forward=0

net.ipv4.conf.all.forwardingカーネルパラメータとカーネルパラメータの違いを説明できる人はいますかnet.ipv4.ip_forward

ベストアンサー1

説明によれば、ip_forwardインターフェース間パケット転送の値のみが変更されるのではなく、他の構成も変更される。前述のように、他の設定はデフォルト値(ホストの場合はFC1122、ルーターの場合はRFC1812)に設定されています。

の場合、forwarding他の設定に影響を与えることなく、使用方法に応じて特定のインターフェイスまたはすべてのインターフェイスに設定されます。

たとえば、ipv4.conf.all.forwarding=1ipv4転送は他の設定に影響を与えずにすべてのインターフェイスに設定され、ipv4.ip_forward=1ipv4転送はすべてのインターフェイスに設定されますが、設定も変更されます。

おすすめ記事