4-3 Flashcards
to list the current iptables rules you use
iptables-L
to allow communication on a specific port. in this example using ssh port 22 you use
iptbles -A INPUT -p tcp –dport ssh -j ACCEPT
or prehaps you need to allow all incoming web/HTTP traffic
iptables -A INPUT -p tcp –dport 80 -j ACCEPT
logging dropped packets is also a good idea. the following command does that
iptables -I INPUT 5 -m limit –limit 5/min -j LOG –log prefix “iptables denied: “ –log-level 7
iptable flags / append this rule to the rule chain
A
iptable flags / lit the current filter rules
-L
iptable flags / the connection protocol used
-p
iptable flags / the destination port required for this rule. a single port may be given, or a range may be given as start:end
–dport
iptable flags / the maximum matchin rate, given as a number followed by “/second”, “/minute”, “/hour”, “/day” depending on how often you want the rule to match
–limit
iptable flags / define the list of states for the rule to match on
–ctstate
iptable flags / when logging, put this tect before the log message. use double quotes around the text use
–log-prefix
iptable flags / logusing the specified syslog level
–log-level
iptable flags / only match if the packet is coming in on the specifiedinterface
-i
iptable flags / verbose output
-v
iptable flags / source specification
-s