LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting firewall script & server (https://www.linuxquestions.org/questions/linux-networking-3/setting-firewall-script-and-server-90872/)

pautorras 09-09-2003 09:41 AM

Setting firewall script & server
 
I have two questions that are driving me crazy.
The first question is that I have a RH8.0 webserver with Apache, MySql and PHP and I wan't to run a firewall script to save me for hackers.
I've read a lot of scripts and tutorials and I note that all the configurations of those scripts are for a pc making the firewall job with normally 2 network cards, one connected to dsl and the other one connected in the local Lan.
The question is if it's possible to run the firewall in the same webserver and with one network card connected to dsl.
There are some examples that could help me?
Tanks.
The second is that I have the webserver configurated with Apache, MySql and PHP and when I start Mozilla to conect to my IP or my hostname the query is solved in กก40 seconds!!, don't you believe that is something wrong?
Now I don't have the connection to dsl, I'm connecting directly to my hostname without connection to internet.
Can this question be solved to be a little bit quickly?
Tanks.
Only a little clarify what is the difference about the "eth0" and "lo" when I type the ifconfig command to my terminal?
Tanks to all!

Pau (Barcelona - Spain).

david_ross 09-09-2003 02:19 PM

Welcome to LQ.

You can run the apache etc on the same machine as the router but there would be an extra layer of security if you went with a router and a webserver. In terms of firewalling I tend to go with something very simple like:
# Drop all connections by default
iptables -P INPUT -j DROP
# Allow conenctions to the webserver
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
# Allow conenctions vi ssh
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

If you want to set it up as a router too then there are plenty of tutorials on this site and others. If you want a dedicated router machine hten you are as well to use a dedicated distro that will run on an older machine such as IPCop or SmoothWall.

Let us know if you have problems or questions.


All times are GMT -5. The time now is 04:17 AM.