[CentOS] /etc/sysctl.conf edit not permanent

John R Pierce pierce at hogranch.com
Thu May 29 00:31:37 UTC 2008


Joseph L. Casale wrote:
>> What exactly did you add to /etc/sysctl.conf?
>>
>> Do you have any errors when you run "sysctl -p" on the command line as root?
>>
>> Filipe
>>     
>
> Hi,
> I added the following to /etc/sysctl.conf:
> net.ipv4.ip_forward = 1
> sysctl -p does not show any errors.
>
> So after a #service network restart, I see this:
> Shutting down interface eth0:  [  OK  ]
> Shutting down loopback interface:  [  OK  ]
> Disabling IPv4 packet forwarding:  net.ipv4.ip_forward = 0
> [  OK  ]
> Bringing up loopback interface:  [  OK  ]
> Bringing up interface eth0:  [  OK  ]
> Bringing up interface eth1:
> Determining IP information for eth1... done.
>
> But a sysctl -p shows the right info after? Is this behavior normal?
>   

sysctl -p  reads the /etc/sysctl.conf file and sets whatever options are 
in there, so if you run that, its just putting back what you've said in 
sysctl.conf
It looks like ip_forward is being reset by /etc/init.d/network when you 
pass argument STOP or RESTART (with the network STOPPED, how can there 
be forwarding?)
it does look like /etc/init.d/network START reruns any sysctl.conf 
settings, so its probably turning it back on when the network is 
(re)started if you're setting it in there.






More information about the CentOS mailing list