• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : How to make iptable rules persist across reboots

By admin

Sometimes after a reboot, iptables rules are not available as they are not saved to be persistent. The post below describes steps to save iptables persistently.

Making iptable rules persistent

1. Add rules to the iptables according to your requirment.

2. Verify that all the rules are present using the command “iptables -L“.

# iptables -L

3. Save the iptables.

# service iptables save

4. Restart the service.

# service iptables restart

5. Making service permanently ON using chkconfig.

# chkconfig iptables on

Troubleshooting

If there is any error while restarting the service then follow this steps below.

1. Afrer saving the iptable rules, restore the SELinux context of iptables file.

# restorecon -Rv  /etc/sysconfig/iptables

2. Restart the iptables service.

# service iptables restart

3. Make the service on persistently using chkconfig.

# chkconfig iptables on

Filed Under: Linux

Some more articles you might also be interested in …

  1. SSSD Service Failing with “SSSD is already running” in CentOS/RHEL 7
  2. How to configure interface in “Promiscuous Mode” in CentOS/RHEL
  3. How To Check Swap Usage of Each Processes in Linux
  4. How to install packages using dnf in CentOS/RHEL 8
  5. How to Enable Debug Mode for Chronyd Service in CentOS/RHEL 8
  6. lvremove Command Fails With Error “LVM – Can’t remove open logical volume”
  7. CentOS / RHEL : How to log all LVM commands
  8. How To Configure Separate Override.conf For Multiple MySQL Instances Using Systemd
  9. How to identify the HBA cards/ports and WWN in Linux
  10. How to enable md5 Hashing in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary