Advertisement: Linux VPS for $4/month - based on OpenVZ, credit card accepted, automatic setup.
+ Post New Thread
Results 1 to 2 of 2

Thread: How to iptables save and restore

  1. #1
    Fli
    Fli is offline
    Administrator Fli's Avatar
    Join Date
    Mar 2013
    Posts
    2,550

    How to iptables save and restore



    When doing some changes in iptables, one can save before so one can restore if something go wrong.

    SAVE

    iptables-save > /root/working.iptables.rules

    RESTORE

    iptables-restore < /root/working.iptables.rules

    ----

    After rules are changed and one is happy with it, it needs to be saved to survive reboot. On CentOS, its done by command "service iptables save" or "iptables-save > /etc/sysconfig/iptables"

  2. #2
    Member alfread's Avatar
    Join Date
    Sep 2020
    Posts
    64


    Is this useful / helpfull? Yes | No
    The actual iptables rules are created and customized on the command line with the command iptables for IPv4 and ip6tables for IPv6. These can be saved in a file with the command iptables-save for IPv4. These files can be loaded again with the command iptables-restore for IPv4.

+ Post New Thread

Similar Threads

  1. How to restore softaculous backup manually
    By Fli in forum Control Panels
    Replies: 3
    Last Post: 04-17-2017, 07:53 AM
  2. Replies: 0
    Last Post: 02-03-2015, 12:47 PM
  3. Replies: 0
    Last Post: 11-30-2014, 09:23 PM
  4. How to restore WHM after IP change
    By Fli in forum Reseller Hosting
    Replies: 0
    Last Post: 11-30-2014, 07:59 PM
  5. Replies: 0
    Last Post: 04-27-2014, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam