I'm building a firewall rule that should drop all outgoing connection except telnet
out.
[ I know that I ultimately need to drop all input and allow some, but I need to filter output as well ( block all output except some ), this is the requirment plz stick to it.]
so I Google and followed the recommended setting like :
iptables --flush
iptables -P INPUT ACCEPT
iptables -P OUTPUT DROP
iptables -A OUTPUT -o eth0 -p tcp --dport 1234 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 1234 -m state --state ESTABLISHED,RELATED -j ACCEPT
PS: 1234
is my test port
I'm able to connect to telnet out
but as soon as I add
iptables -P INPUT DROP
I'm unable to connect even though I have the INPUT
rule to ACCEPT
the Established connection.
where am I going wrong ?
PS: I don't have kernel/iptables
LOGGING.
e.g., Drop drop INPUT AND OUTPUT
Also, fedora and redhat will drop both INPUT and OUTPUT to begin with that is the default firewall.