Forum Moderators: bakedjake
I have just a small question. I have heard through people that you can write your own SSH scripts using IPTABLES! I was wondering if anyone would be able to post/email me a basic way of doing this...
I will ONLY be using GAIM, NWN (linux game), and Mozilla. NOTHING ELSE.
Any ideas on what script(s) to write and how to write them? This is my LAST (thank everything thats Holy- lol) struggle before partitioning Gentoo onto my HD.
Thanks in advance,
Iced
Well, I had heard on a few linux msg boards that people are able to create their own Firewalls using SSH and Ip Tables. I was wondering if anyone could create a generic (or thorough) one so I could learn how to do something like this.
Thanks,
Iced
I used to use a script, ie something along the lines of
ALLOWED="22 80 8080"
for i in $ALLOWED; do
iptables -A input -p tcp -M state --state NEW -t ACCEPT
done
iptables -A input -p tcp -M state --state NEW -t DROP
Then I figured out how Red Hat was doing it, and I moved to that.
/etc/sysconfig/iptables is a saved version of the firewall rules, generated by the iptables-save and iptables-restore commands. The format is pretty much the commands with the leading "iptables" stripped off, and organized by chain. The Red Hat sysv init script "iptables" has things like "iptables save" (to make your current rules permament).
If I want to make some changes, I either do it by hand then save, or cut and paste from /etc/sysconfig/iptables and reload my ruleset.
If you still want to go the script method, google for "iptables script", there are many examples.
Sean