Disable IP forwarding on linux server

Internet routing is also known as “IP forwarding”, to send a packet to the multiple network the IP forwarding forwarding is used therefore its always to better to disable the “IP forwarding” server wide. Refer to the following simple command to disable the “IP forwarding” but make sure that you have logged in to the server as a root user.

echo “0” >/proc/sys/net/ipv4/ip_forward

The above command restored the “zero” value in the following file.

/proc/sys/net/ipv4/ip_forward

You can also manually disable the IP forwarding by change the values

From
1

To
0

Note : 1 is used to enable and 0 is used to disable the IP forwarding


About Anant 386 Articles
Senior technical writer