IP Forwarding: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:


* [[Linux Network Concepts#Subjects|Linux Network Concepts]]
* [[Linux Network Concepts#Subjects|Linux Network Concepts]]
* [[Kernel_Runtime_Configuration#net.ipv4.ip_forward|Kernel Runtime Configuration]]


=Overview=
=Overview=
Line 21: Line 22:
  net.ipv4.ip_forward = 1
  net.ipv4.ip_forward = 1


Alternative:
Alternative (mentioned by [[Docker_Network_Operations#Enable_IP_Forwarding_from_Containers_on_the_Default_Bridge|Docker documentation]]):


  sysctl net.ipv4.conf.all.forwarding=1
  sysctl net.ipv4.conf.all.forwarding=1
<font color=red>What is the difference between net.ipv4.conf.all.forwarding and net.ipv4.ip_forward?</font>

Latest revision as of 17:36, 1 May 2018

External

Internal

Overview

"IP forwarding" is a synonym for "routing." It is called "kernel IP forwarding" because it is implemented in the Linux kernel.

A host that acts as a router has multiple network interfaces. If traffic comes in on one interface and its target subnet is serviced by another network interface, the kernel may forward the packet between interfaces, if it is configured to do so.

echo 1 > /proc/sys/net/ipv4/ip_forward

To enable IP forwarding at boot, add the following to /etc/sysctl.conf:

net.ipv4.ip_forward = 1

Alternative (mentioned by Docker documentation):

sysctl net.ipv4.conf.all.forwarding=1

What is the difference between net.ipv4.conf.all.forwarding and net.ipv4.ip_forward?