Hi guys hope u can help out.
I have a linux RedHat Enterprise Desktop ver 5 machine at home.
It has just the one network card. It has apache running.
I also have a wirelss router that performs nat so that I can access the web server from any location.
Let's say my home network LAN IP range is 192.168.2.x/24, with Private IP 192.168.2.9 assigned to my apache linux box.
Let's say also I have dynamic dns enabled on my wireless router, and that I get assigned a dynamic IP from my provider of eg.203.44.6.78.
Also on the router I port forward port 80 to my apache linux server on private IP 192.168.2.9, so that I can access the apache web server when away from home.
What Id like help with is iptables. At the moment I have it switched off, but want to turn it on.
What I want to be able to do is the following:
1) Be able to connect to my web server (sitting on 203.44.6.78 (externally) / 192.168.2.9 (internally) remotely (as Im doing now).
2) Only be able to connect to my web server from 2 locations:
a) From home Lan range (192.168.2.x/24) eg.any home machine on this lan
and b) From public IP 144.3.6.78
3) Block access to my web server machine from any other location that is not listed in requirement 2)
4) From home lan range 192.168.2.x/24 and from public ip 144.3.6.78, I need to access the following ports on the home web server:
ports 22, 80, 443
a) Id like to know how to set up rules to restrict it just to these 3 ports on the web server
and
b) As an alternative to a), how to set up rules if I wanted to open up all ports on the web server for lan range 192.168.2.x/24 and from public ip 144.3.6.78.
Any help greatly appreciated.
Thank you.
Start Free Trial