Removing Pre-Routing NAT Rules in IPtables

To remove specific iptables rule from Pre-Routing chains, first display all Pre-Routing chains using a following iptables command:

iptables -t nat --line-numbers -L

This will display all Pre-Routing chains with relevant line numbers. To remove a specific Pre-Routing rule, you can use the corresponding line number. For example below command will remove Pre-Routing NAT chain with line number 1.

iptables -t nat -D PREROUTING 1

Leave a Reply

Your email address will not be published. Required fields are marked *