Which file stores the configuration of sysctl -w net.inet.ip.forwarding=1

Hi, guys

I searched the Internet and found this command to enable the router function of a BSD. But it is an old method. Some threads said the configuration was stored in /etc/sysctl.conf, but I did not find this conf file on my BSD.

Tom
 
Don't set this. Use gateway_enable="YES" in rc.conf (it does the exact same thing).
 
Don't set this
So the reason for this: the function only persists until next reboot?

So we assume that I use sysctl -w net.inet.ip.forwarding=1 method, I have to create /etc/systcl.conf

What is tricky is that the new created systcl.conf file should not only contain configuration for IP forwarding, but also all other system settings? If not so, issue and error occurs?
 
Yes, unless you put it in /etc/sysctl.conf. But like I said, use gateway_enable instead.
 
Some threads said the configuration was stored in /etc/sysctl.conf, but I did not find this conf file on my BSD.
Do you even use FreeBSD? I can't help but wonder if you're not using a derivative. Because FreeBSD itself includes a default file in the base system with one option which allows you to hide other uid's.
 
Back
Top