LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Saving ipchains (https://www.linuxquestions.org/questions/linux-networking-3/saving-ipchains-2935/)

Shoki 05-30-2001 08:02 AM

I added some ipchains #ipchains -A .... but when I reboot they are gone. I need these to be loaded at startup how/where/what do I need to do to save these changes? Also I did a /sbin/route add -net ...and when I reboot that change is gone too. What do I need to do to save it? I am kind of new at this so I need some pretty explicit instructions as "you need to place these files in a location where they will be executed" isn't much help since I don't know much about Linux.
thanks,
jim

siddiqu 05-30-2001 08:36 AM

U can put all this command in /etc/rc.d/c.local with proper path.

Another methos to save ipchains refer IP Chains howto
siddqiu.T

unSpawn 05-30-2001 08:42 AM

First of all u have the command "history" which is a log of the last x commands executed. If it isnt cut off to the last say 10 commands, executing "history > history.log" (w/o quotes) will output it all to a file named history.log.
look up the valid IPChains rules and save em in another file, dont forget to dump the line numbers which are a part of the history command.

Now to add the chains uve got to find where it is started from which is usually from /etc/rc.d. look for an executable script called something like "rc.firewall" names differ per distro. Open it and add the lines u saved previously.
Execute the firewall script to see if it is working correct.

The routes can be found in (again different per distro I guess) /etc/sysconfig/static-routes, add em there.

siddiqu 05-30-2001 08:44 AM

U can put all the commands in rc.fw and call the program from rc.local
siddiqu.T

jharris 05-30-2001 12:32 PM

Quote:

Originally posted by siddiqu
U can put all this command in /etc/rc.d/c.local with proper path.

Another methos to save ipchains refer IP Chains howto
siddqiu.T

I have all my rules in /etc/rc.d/rc.masq that is executed at boot time. The HOWTO mentions using
Code:

ipchains-save > somefile
and
Code:

ipchains-restore < somefile
. Have a look at http://linuxdocs.org/HOWTOs/IPCHAINS-HOWTO-4.html#ss4.2 for more details. (scroll down a little to find the ipchains-save bit...)

HTH

Jamie..

Shoki 05-30-2001 01:24 PM

Thanks for all your help. I will look into your suggestions.
jim

Shoki 05-31-2001 02:01 PM

Well...I am not sure if I am doing something wrong or what. I am very new to Linux and I have been reading the howto's and trying to follow the suggestions but I am missing something. When I edited the rc.firewall file under the PPTP section(there were already ipchains there for the 192.168.1.x subnet) and rebooted the changes were there. However, when I did a ipchains -L forward, they did not show up under the listing.
Is there a reason that the ipchains that I added to the rc.firewall are not showing up when I do a ipchains -L forward?
thanks,
jim


All times are GMT -5. The time now is 06:56 AM.