Skip to main content

Saved iptables rules not found

Comments

11 comments

  • 24x7server
    Hi, Try below commands: # cp -ar /etc/sysconfig/iptables /etc/sysconfig/iptables_BK # iptables -A INPUT -p tcp -s x.x.x.x -j DROP # iptables-save >> /etc/sysconfig/iptables Note: Don't forget to back up correct IPtables file based on its appropriate location on your server..
    0
  • cPanelMichael
    Hello, You may also want to consider installing a plugin such as CSF for easier management of your IPtables firewall rules. Thank you.
    0
  • Musthafa
    Hi, Sorry for the late reply. I found out that the rules are being saved in /etc/sysconfig/iptables, but is not showing when I check with iptables -L -n command.
    0
  • cPanelMichael
    Hello, You may want to consider installing a third-party firewall management utility such as CSF if you are having trouble manually saving your system's iptables firewall rules: ConfigServer Security & Firewall (csf) Thank you.
    0
  • Musthafa
    Thank you for your reply!:)
    0
  • NixTree
    were the rules showing fine after running the command "service iptables save" ?
    0
  • Musthafa
    Yes, it shows when checking with the command iptables -L -n. After some time it goes nowhere, but still shows in the /etc/sysconfig/iptables directory.
    0
  • cPanelMichael
    Could you verify if installing CSF addresses the issue? Thank you.
    0
  • Musthafa
    Sorry, I can not install it right now. I am using Centos 5.11 which I think don't support csf, and right now I am not able to upgrade the OS. Thank you
    0
  • Musthafa
    There is an update, some rules are missing from iptables. I blocked a bad bot before two weeks with its IP subnet, now its again accessing my website and creating load. /etc/init.d/iptables save - thats all I need to do after applying the rule right?
    0
  • cPanelMichael
    /etc/init.d/iptables save - thats all I need to do after applying the rule right?

    Hello, Yes, that command will save your iptables rules on CentOS 5. Thank you.
    0

Please sign in to leave a comment.