LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Tracking changes to the ip_forward variable (https://www.linuxquestions.org/questions/linux-networking-3/tracking-changes-to-the-ip_forward-variable-355551/)

gauge73 08-21-2005 01:55 PM

Tracking changes to the ip_forward variable
 
I am trying to change my firewall machine (RH9 running iptables) such that when it reboots it will still act as I want it to. Currently, after rebooting, the /proc/sys/net/ipv4/ip_forward file contains a 0. I added a line in my /etc/init.d/iptables script in the "start" function to echo a "1" to that file. However, when I reboot, I still see a zero in that file. I added another line in the script to touch a non-existant file as a test to be sure that the start function in the /etc/init.d/iptables script was actually being run at boot time. I then rebooted, still found the ip_forward file to contain a zero, but the file that was touched appeared. Therefore, the start function is being run and the 1 is being echoed to the ip_forward file, but it is being overwritten as a 0 later.

I could simply add a line in my /etc/rc.d/rc.local file to echo a 0 to that file, but I don't want to do that unless I have to. What I want to do at this point is to find out what is echoing the "0" into the ip_forward file after the start function in the iptables script. However, I'm not really sure what the best way to determine this is. In addition, I don't really have any likely culprits in mind to monitor. Can anyone advise me on how to go about hunting this problem down?

Thanks in advance. :)

win32sux 08-21-2005 02:51 PM

AFAIK iptables doesn't store kernel parameters, so you should set them somewhere else, like rc.local, for example... BTW, i'm not sure how to do the change tracking you are asking about, though... are you 100% sure the value is being "changed" and isn't simply coming-up with it's default as it's supposed to??

EDIT: the more kosher way of setting these kinda parameters on red hat is by using the sysctl.conf file... for more info about this:

http://www.google.com/linux?&q=sysctl.conf




All times are GMT -5. The time now is 11:08 PM.