Iptables
Iptables is a firewall, installed by default on all official Ubuntu distributions (Ubuntu, Kubuntu, Xubuntu). When you install Ubuntu, iptables is there, but it allows all traffic by default. Ubuntu 8.04 Comes with ufw - a program for managing the iptables firewall easily.
There is a wealth of information available about iptables, but much of it is fairly complex, and if you want to do a few basic things, this How To is for you.
Basic Commands
Typing
------------------------------------------------- sudo iptables -L lists your current rules in iptables. If you have just set up your server, you will have no rules, and you should see
-------------------------------------------------
Chain INPUT (policy ACCEPT)
-------------------------------------------------
target prot opt source destination
-------------------------------------------------
------------------------------------------------- Chain FORWARD (policy ACCEPT)
-------------------------------------------------
target prot opt source destination
-------------------------------------------------
------------------------------------------------- Chain OUTPUT (policy ACCEPT)
-------------------------------------------------
target prot opt source destination
Basic Iptables Options
Here are explanations for some of the iptables options you will see in this tutorial. Don't worry about understanding everything here now, but remember to come back and look at this list as you encounter new options later on. 1. -A - Append this rule to a rule chain. Valid chains for what we're doing are INPUT, FORWARD and OUTPUT, but we mostly deal with INPUT in this tutorial, which affects only incoming traffic. 2. -L - List the current filter rules. 3. -m conntrack - Allow