Difference between revisions of "Tung httpd conf"

From CDOT Wiki
Jump to: navigation, search
(Created page with '<b><big><big>Installing and Configuring Firewall</big></big></b> <b><big>Introduction</big></b> <font face="Georgia">In this page, you are going to create a firewall that allow…')
 
Line 1: Line 1:
 
<b><big><big>Installing and Configuring Firewall</big></big></b>
 
<b><big><big>Installing and Configuring Firewall</big></big></b>
 +
  
 
<b><big>Introduction</big></b>
 
<b><big>Introduction</big></b>
Line 15: Line 16:
 
#Create a rule that allow packets to output from http port only: <b><code><font color=green > iptables -I OUTPUT -p tcp --sport http -j ACCEPT</font></code></b>
 
#Create a rule that allow packets to output from http port only: <b><code><font color=green > iptables -I OUTPUT -p tcp --sport http -j ACCEPT</font></code></b>
 
#View your web page from other virtual machine. The web page should be displayed.
 
#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.
+
#Try to <b>ssh</b> and <b>ping</b> from virtual machine to your server. All connections should be blocked.
 
#Save your iptables rules: <b><code><font color=green >service iptables save</font></code></b>
 
#Save your iptables rules: <b><code><font color=green >service iptables save</font></code></b>

Revision as of 18:25, 27 July 2011

Installing and Configuring Firewall


Introduction

In this page, you are going to create a firewall that allows only outside world view the web page in your server


Instruction

  1. Login as root user
  2. Clear up the rules in your iptables: iptables -F
  3. Change the input chain default policy to drop: iptables -P INPUT DROP
  4. Create a rule that allow outside to access http port only: iptables -I INPUT -p tcp --dport http -j ACCEPT
  5. Change the input chain default policy to drop: iptables -P OUTPUT DROP
  6. Create a rule that allow packets to output from http port only: iptables -I OUTPUT -p tcp --sport http -j ACCEPT
  7. View your web page from other virtual machine. The web page should be displayed.
  8. Try to ssh and ping from virtual machine to your server. All connections should be blocked.
  9. Save your iptables rules: service iptables save