Description :
Rules that allow packets to be filtered by the kernel are put in place by running the iptables command.
iptables [-t table] -[AD] chain rule-specification [options]
iptables [-t table] -I chain [rulenum] rule-specification [options]
iptables [-t table] -R chain rulenum rule-specification [options]
iptables [-t table] -D chain rulenum [options]
iptables [-t table] -[LFZ] [chain] [options]
iptables [-t table] -N chain
iptables [-t table] -X [chain]
iptables [-t table] -P chain target [options]
iptables [-t table] -E old-chain-name new-chain-name
to view the rules that are currently applied --------> iptables -L(it will list the rules)
rules to network packets that are either inbound (INPUT), outbound (OUTPUT), or being forwarded through your server (FORWARD)
some iptable rules
a server that will block every inbound connection
iptables -P INPUT DROP
it accepts all the output connections
iptables -P OUTPUT ACCEPT
it drops all the forwarding connections
iptables -P FORWARD DROP
it allows for internal host connectivity through local
iptables -A INPUT -i lo -j ACCEPT
it allows port 80 tcp requests that are inbound to also go through
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT

0 comments:
Post a Comment