OpenVZ Forum


Home » General » Support » sysctl.conf ip_forward = 1 changes after reboot
sysctl.conf ip_forward = 1 changes after reboot [message #15924] Thu, 16 August 2007 03:06 Go to next message
penguin is currently offline  penguin
Messages: 2
Registered: August 2007
Junior Member
I have set net.ipv4.ip_forward = 1 in my sysctl.conf file. After a reboot it changes back to 0.

I then need to run; echo 1 > /proc/sys/net/ipv4/ip_forward, to set it back to 1.

Any ideas what can be done to make the change permanent? I'm running CentOS 5 with APF firewall front for iptables.



Re: sysctl.conf ip_forward = 1 changes after reboot [message #15927 is a reply to message #15924] Thu, 16 August 2007 07:07 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
1) the straightforward and dull way is to put a command "echo 1 > /proc/sys/net/ipv4/ip_forward" into rc.local.

2) of course way 1 is bad. Let's try to understand what drops ip_forward to 0 in your system?
Could you please post the complete /etc/sysctl.conf and /etc/sysconfig/network ?
Could you grep /etc directory for "ip_forward"? Which scripts change this parameter and under what conditions?


If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: sysctl.conf ip_forward = 1 changes after reboot [message #15935 is a reply to message #15927] Thu, 16 August 2007 09:14 Go to previous messageGo to next message
khorenko is currently offline  khorenko
Messages: 533
Registered: January 2006
Location: Moscow, Russia
Senior Member
In particular we suspect APF because its scripts do change ip_forward under some conditions.

If your problem is solved - please, report it!
It's even more important than reporting the problem itself...
Re: sysctl.conf ip_forward = 1 changes after reboot [message #15938 is a reply to message #15924] Thu, 16 August 2007 10:49 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

penguin wrote on Thu, 16 August 2007 07:06

Any ideas what can be done to make the change permanent? I'm running CentOS 5 with APF firewall front for iptables.


It looks like your APF firewall is changing that. There is something in sysctl.rules that sets that to either 1 or 0 -- please check that file or APF docs about how to fix that for you.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: sysctl.conf ip_forward = 1 changes after reboot [message #15944 is a reply to message #15924] Thu, 16 August 2007 15:21 Go to previous messageGo to next message
penguin is currently offline  penguin
Messages: 2
Registered: August 2007
Junior Member
Thanks for the help guys. It did turn out to be the SYSCTL_ROUTE setting within the APF config.
Re: sysctl.conf ip_forward = 1 changes after reboot [message #15999 is a reply to message #15924] Fri, 17 August 2007 23:34 Go to previous message
nach is currently offline  nach
Messages: 1
Registered: August 2007
Junior Member
Can you tell me what you changed in APF to make it work? I've be wrapping my head around this for days. Just edit SYSCTL_ROUTE to 0?

[Updated on: Fri, 17 August 2007 23:35]

Report message to a moderator

Previous Topic: Pass environment variable via execve
Next Topic: *solved* howto install network in a newly created VE with ext IP?
Goto Forum:
  


Current Time: Mon Jul 07 04:28:36 GMT 2025

Total time taken to generate the page: 0.03004 seconds