Can Ubuntu be configured as a firewall server , if yes how ? , if no why ?
The built-in Ubuntu Firewall called
Here Is Basic Commands on
lists your current rules in iptables. If you have just set up your server, you will have no rules, and you should see
Please see the whole how to on help.ubuntu.com
A simple iptables script
I have network interfaces on eth0 and eth1, so this script has rules which cover both; if your interfaces have different names, you will need to edit the rules to cover that. This drops everything incoming, except for connections which were initially established by my outgoing packets (thanks Luke! - see comments); which means it's no good for servers.
I put this script in /opt/scripts/iptables.script and made it executable. Once you run it, you can find out whether it has worked by displaying your current iptables rules with:
I then created a simple init script to start/stop the firewall in
Then I symlinked this into my
Hope this help :)
I prefer ufw HELP it is a wrapper around iptables, and more easy to configure.