== Linux ==
You can use [https://help.ubuntu.com/community/UFW UFW • Uncomplicated Firewall], the default firewall configuration tool for Ubuntu (disable disabled by default on Ubuntu). [http://gufw.tuxfamily.org GUFW] is a very nice and simple GUI for ufw.
If you chose GUFW, you have to click on the ''Unlock'' button after starting the GUI, then check ''Activate'' or push the ''Status'' slider to the ''On'' position. The default configuration (Incoming: Deny; Outgoing: Allow) is a good start for beginners, and contrary to what it claims, critical service messages will still be able to reach your machine, as well as incoming packets for which you established the connexion (it is a stateful firewall).
Since Windows XP, a firewall is included in Windows. However, until Windows XP SP2 it was disabled by default. An unconfigured Windows Firewall denies inbound connections and allows outbound connections.
There are more complete and free (i.e. gratis) solutions. You can find some of theme them on a [http://lifehacker.com/5061933/five-best-windows-firewalls rather old article of Lifehacker] or on Google.
Use <code>nmap</code> from another machine to test your firewall configuration.