I have edited ip forwarding in /etc/sysctl.conf yet when I issue a #service network restart I see it get set back to 0. Why is that?
Thanks, jlc
On Wed, May 28, 2008 at 10:39 AM, Joseph L. Casale JCasale@activenetwerx.com wrote:
I have edited ip forwarding in /etc/sysctl.conf yet when I issue a #service network restart I see it get set back to 0. Why is that?
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
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?
Thanks! jlc
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.
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?
I have seen the same thing. I think what is happening is that when you restart networking, it disables packet forwarding. When you start it, it will re-enable. After you start the network type: "/sbin/sysctl net.ipv4.ip_forward"
I expect that you will see "net.ipv4.ip_forward = 1"
Please confirm.
Barry