[ale] rc.local

Jim Popovitch jimpop at yahoo.com
Tue May 30 11:47:43 EDT 2006


Terry Bailey wrote:
> 
> 
> 
> I have a project that uses IP tables.  If I type the following in by 
> hand everything works; however, if I place the line in 
> /etc/rc.d/rc.local it doesn' work.  
> 
> 
> */sbin/iptables -t nat -A PREROUTING -m tcp -p tcp --dport 80 -j DNAT 
> --to-destination 217.135.152.23:8080
> 
> 
> *It did not work for SUSE 10 because rc.local is not used,  so I 
> switched to Fedora and it still does not work.
> 
> 
> I have a small appliance where this does work with /etc/rc.d/rc.local.   
> Is it the case that this command must be placed in a file and the file 
> be called from rc.local?

rc.local is only supported on some distros.

a few things:

  1) Make sure the file is executable (chmod +x rc.local)

  2) Make sure any modules needed by iptables are loaded before rc.local 
is executed.

  3) Grep in /etc/rc.d/init.d/* for rc.local to see how it is loaded and
     at what point in the boot process.

  4) FWIW, rc.boot is the equivalent on Debian.

-Jim P.








More information about the Ale mailing list