Difference between revisions of "Tung iptables conf"
Line 4: | Line 4: | ||
<b><big>Introduction</big></b> | <b><big>Introduction</big></b> | ||
− | <font face="Georgia">In this page, you are going to create a firewall that allows | + | <font face="Georgia">In this page, you are going to create a firewall that allows outside world to access your web page in the server |
</font> | </font> | ||
Revision as of 23:41, 27 July 2011
Installing and Configuring Firewall
Introduction
In this page, you are going to create a firewall that allows outside world to access your web page in the server
Instruction
- Login as root user
- Clear up the rules in your iptables:
iptables -F
- Change the input chain default policy to drop:
iptables -P INPUT DROP
- Create a rule that allow outside to access http port only:
iptables -I INPUT -p tcp --dport http -j ACCEPT
- Change the input chain default policy to drop:
iptables -P OUTPUT DROP
- Create a rule that allow packets to output from http port only:
iptables -I OUTPUT -p tcp --sport http -j ACCEPT
- View your web page from other virtual machine. The web page should be displayed.
- Try to ssh and ping from virtual machine to your server. All connections should be blocked.
- Save your iptables rules:
service iptables save