Hi Gurus,
Anyone here has a working firewall script for Apache Webserver that they can share? Or perhaps, comment on my script?
I have a script but doesn't allow my clients to access my webserver.
First here's my initial firewall entries:
IPADDR=`ifconfig eth0 | fgrep -i inet | cut -d : -f 2 | cut -d " " -f 1`
EXTERNAL_INTERFACE="eth0"
LOOPBACK_INTERFACE="lo"
LOCAL_INTERFACE_1="eth1" # Internal LAN interface
INTRANET="192.168.0.0/16" # Private IP Addr Range
PRIMARY_NAMESERVER="203.x.x.3"
SECONDARY_NAMESERVER="203.x.x.4"
LOOPBACK="127.0.0.0/8"
Now, here's my firewall rule for apache:
# ------------------------------------------------------------------
# HTTP client (80)
# ------------------------------------------------------------------
iptables -A INPUT -i $EXTERNAL_INTERFACE -p tcp ! --syn \
--source-port 80 \
-d $IPADDR --destination-port $UNPRIVPORTS -j ACCEPT
iptables -A OUTPUT -o $EXTERNAL_INTERFACE -p tcp \
-s $IPADDR --source-port $UNPRIVPORTS \
--destination-port 80 -j ACCEPT
I will appreciate any help.
Thanks alot!


Reply With Quote
Bookmarks