How to delete iptables rules (Remove, Flush IP-Table Rules one Step)

Опубликовано: 16 Апрель 2020
на канале: Linux Teaching House
1,612
12

580K Subscriber . 520K Views

Welcome to the video - "How to delete iptables rules (Remove, Flush IP-Table Rules one Step)"
How to delete or remove and Flush IPtables Rules Centos /Redhat
using simple command
iptables -F

OR:

To delete or flush all IPTables rules on a Linux system, including CentOS, you can use the iptables command with the -F and -X options. Here are the steps:

Open a terminal window or log in to the server using SSH.

Type the following command to delete all the rules in the filter table:

sudo iptables -F

This will flush all the rules in the filter table.

Type the following command to delete all the user-defined chains:

sudo iptables -X

This will delete all the user-defined chains.

If you have any other tables such as nat or mangle with rules that you want to delete, you can use the same command with the table name. For example:

sudo iptables -t nat -F

This will flush all the rules in the nat table.

After deleting all the rules, you can verify that the rules have been deleted by listing the rules using the following command:

sudo iptables -L

This will list the current IPTables rules. If there are no rules, you will see a message saying "Chain INPUT (policy ACCEPT)".

That's it! You have successfully deleted or flushed all IPTables rules on your Linux system.

Centos 5, Centos 6, Centos 7 and Centos 8 This command applicable
Please Subscribe and click the notification bell so you never miss a video
Thank You For Watching


#LinuxTipsandTricks2020 #LinuxServer #LinuxTeachingHouse