Preface
Just like everything in Linux I'm sure there are a lot of ways to get an intended result with iptables. I'd like to limit answers to the following categories:
- What is the difference between the options?
- Which option is best (or are they the same)?
- Why do you prefer one over the other?
And please be clear what category you are speaking to. It's okay to state preferences, but don't imply that it is best.
e.g.
I prefer to put
--jumpas the first argument because I think it reads better to have the intent first and I like to vertically align like arguments of multiple commands.
Question
Is one of these better than the other?
iptables -I INPUT --jump ACCEPT --in-interface lo
iptables -I INPUT --jump ACCEPT --source localhost
Is one of these better than the other?
iptables -A INPUT --jump REJECT
iptables -P INPUT REJECT