November 25, 2024, 06:23:32 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: ip_forward problem  (Read 5332 times)

Offline robmainella

  • New Member
  • Posts: 2
ip_forward problem
« on: November 04, 2004, 05:15:05 AM »
Hey everyone,

When I turn on ip_forward it turns off when I reboot.  How can I make it stay on when rebooting?

Thanks,
Rob

Offline dragoncity99

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 551
ip_forward problem
« Reply #1 on: November 05, 2004, 06:58:33 AM »
Just put the command in ur rc.local file under the directory /etc/rc.d/

If  u r a RedHat/Fedora Core 2 user u change do the following:

Change the configuration parameter to activate this in the file /etc/sysctl.conf. Remove the "#" from the line related to packet forwarding.

 

Before

 

# Disables packet forwarding
#net.ipv4.ip_forward=1

 

After

 

# Enables packet forwarding
net.ipv4.ip_forward=1

 

This will only enable it when you reboot at which time Linux will create a file in one of the subdirectories of the special RAM memory based /proc filesystem. To activate the feature immediately you have to create a single lined text file called /proc/sys/net/ipv4/ip_forward and it only contain the value "1". Here is how it's done:

 

[root@siaukia abc] echo 1 > /proc/sys/net/ipv4/ip_forward

This is a reference from www.linuxhomenetworking.com