Deleting IPtables rules

Just wanted to add a section for deleting rules, but I need hexparrot to do it. Here is the addition:

ALL COMMANDS MUST BE RUN AS ROOT!

The beginning process to deleting a rule is to list the rules by Chain and number, execute “iptables -L --line-numbers” to get this info. An example should look similar to this:


Once you have this on screen, to delete the rule, execute “iptables -Dfollowed by a space, then the chain the rule is on (for instance, input), and the number. If I wanted to delete my 25565 TCP port from above, I would execute “iptables -D INPUT 7

It needs some cleaning up, but removing a rule is missing from that wiki page.

3 Likes

Nice to know as I did not but is this part command case sensitive: ‘D INPUT’?

Please explain why or why not, thanks!

tNt

Yes, the -D in iptables -D is case sensitive, using -d will tell you invalid arguments, as -d is not an option for iptables. As for the INPUT, it is case sensitive to the name of the chain your editing, as you may also use OUTPUT, or FORWARD as chains. Remember, the chain is the category your rules are in, in the image above, ALL of my rules are in INPUT because I don’t have any outbound rules.

Cheers! (i need 20 characters.)

@Docter_Redstone Thanks for the information! I went ahead and updated the wiki with your information and this should now be available for all!

I’m glad I’ve made a contribution to the community, though you could look this info up in a normal debian wiki, I figured some people might think only this is right.

Realistically, half the mineos wiki could be cleared out with non-Minecraft things people could find through simple googling, but it’s still a service for them to have a first place to check, to know what to look for and what things are called.

1 Like