Quote:
Originally Posted by NotionCommotion
First three lines allow ports 10,000, 443, and 80 using the TCP protocol. Why do these lines describe "out" and "destination if these are inputs?
|
Every rule can have a number of match criteria, such as the interface the packet is entering or exiting (the "in" and "out" matches) as well as the source and destination address, protocol type, and so on.
iptables -L -v produces a fixed set of columns for each row, including "in" and "out" (which is why using
iptables-save is a good idea). If your rule doesn't include an interface or a destination address match criteria, that's the same as saying "any interface" or "any destination address".
Quote:
Originally Posted by NotionCommotion
Line 4 means it will accept a response from a request.
|
That's correct. The ESTABLISHED state matches responses to previous requests and open TCP connections, while RELATED matches ICMP errors and secondary data streams (provided iptables knows how to interpret the protocol in question).
Quote:
Originally Posted by NotionCommotion
What does Line 5 mean?
|
It allows all incoming ICMP packets. "Ping" replies and error messages related to other traffic (like various "unreachable" messages) are already implicitly allowed by the RELATED state match, but this rule will also allow other packets, like incoming Echo Requests.
Quote:
Originally Posted by NotionCommotion
Line 6 means it will allow internal communication? Please elaborate.
|
Processes on the system itself may communicate using the loopback ("lo") interface. No external system can ever send packets to this interface, and packets from
lo can never go out on the wire, so blocking it with a firewall rule makes little sense (and may cause all sorts of breakage).
It's considered a "best practice" to have a rule allowing traffic to/from
lo at or very near the top of any firewall ruleset.
Quote:
Originally Posted by NotionCommotion
Line 7 allows port 22 using TCP protocol.
|
Correct, it allows incoming packets to the SSH daemon.
Quote:
Originally Posted by NotionCommotion
Line 8 means if you get here, reject everything.
|
Correct.