Firewall Configuration Example

May 1, 2008 Linux Security | Comments (0) admin @ 11:08 pm

Gateway FirewallLinux Firewall

Is connector between internal network and external network, In this case use connecting with Lease Line you need to have 2 network card for connect to external network (eth0) and connect to internal network (eth1 for LAN and have private ip such as 192.168.1.1) . Next, Create firewall file in /etc/rc.d/init.d/ by command :

#vi /etc/rc.d/init.d/firewall

Add firewall script as below, some services is disable if you need to use you can uncomment that service line for enable it to working.

#!/bin/sh
#chkconfig: 2345 60 95
#description: IPTABLES Firewall \
#CALL FUNCTION——————————-
. /etc/rc.d/init.d/functions
#CHECK NETWORK—————————-
. /etc/sysconfig/network
#CHECK NETWORK STATUS—————–
if [ ${NETWORKING} = "no" ]
then
exit 0
fi
if [ ! -x /sbin/iptables ]; then
exit 0
fi

#CREATE SCRIPT FOR PARAMETER BEHIND SERVICE—————————
case “$1″ in
start)
echo -n “Starting Firewall : ”
#————————————————————————

Read More…