RHEL : How to make iptable rules persist across reboots – The Geek Diary (2024)

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

You May Also Like

RHEL : How to make iptable rules persist across reboots – The Geek Diary (2024)
Top Articles
Latest Posts
Article information

Author: Dean Jakubowski Ret

Last Updated:

Views: 6226

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Dean Jakubowski Ret

Birthday: 1996-05-10

Address: Apt. 425 4346 Santiago Islands, Shariside, AK 38830-1874

Phone: +96313309894162

Job: Legacy Sales Designer

Hobby: Baseball, Wood carving, Candle making, Jigsaw puzzles, Lacemaking, Parkour, Drawing

Introduction: My name is Dean Jakubowski Ret, I am a enthusiastic, friendly, homely, handsome, zealous, brainy, elegant person who loves writing and wants to share my knowledge and understanding with you.