[ubuntu-uk] IPTABLES

Chris Rowson christopherrowson at gmail.com
Fri Apr 18 11:51:19 BST 2008


Hi there folks,

Just a quicky. I've been mucking around with iptables for a while, but I'm
still a bit shaky with them. Would anyone mind checking this over for me
please?

I want to be able to accept incoming connections on port 22, accept any
connections which are a reply to a connection that I have initiated to an
outside TCP address, but other than that, I want to drop all other TCP
connections coming in.

Does this look right?

On a side note, I've added a symbolic link called S95firewall to this script
in /etc/rc2.d/, but it doesn't seem to run this script at startup? Any ideas
what I'm doing wrong?

Cheers

Chris

echo "Applying firewall rules"
iptables -F
iptables -A INPUT -p tcp -i eth0 --dport 22 -j ACCEPT
iptables -A INPUT -p tcp -i eth0 -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -i eth0 -j DROP
echo "Rules applied"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-uk/attachments/20080418/9f6dd21a/attachment.htm 


More information about the ubuntu-uk mailing list