0

I installed Debian 10 in VMWare. This Debian machine has to operate as gateway/router machine.

To enable ip forwarding between my LAN and WAN interface, I edited the value with nano in /proc/sys/net/ipv4/ip_forward from 0 to 1.

After rebooting the machine, the value is automatically restored to the value 0.

Does anyone know what is causing this and how i can permanently store the value to 1?

kzpm
  • 55
  • 4

1 Answers1

4

The /proc file system is a virtual file system, which gives access to information and settings in the running kernel. The values it presents aren’t preserved across reboots.

To set a /proc/sys at boot, you can use sysctl; it will load settings from /etc/sysctl.conf and related files. Write

net.ipv4.ip_forward = 1

to /etc/sysctl.conf in your case.

See How to set and understand fs.notify.max_user_watches for relevant links.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164