Re: Linux Firewall
- From: Grant <bugsplatter@xxxxxxxxx>
- Date: Fri, 26 May 2006 08:18:15 +1000
On Thu, 25 May 2006 19:33:20 +0100, Mark <me4all@xxxxxxx> wrote:
On 23/05/06 14:47, Mark wrote:
Does the following firewall script make sense to you guys(it seems to
work)? Any suggestions and comments would be much appreciated.
BTW: Does anyone know how I need to set-up and configure the script so
that I don't have to run it manually everytime I start Suse?
I cannot answer for SuSE system, I'm on slackware ;)
What I do here is have rc.local startup a basic localnet-only
firewall, then pppoe startup calls the rc.firewall again with
parameters so the thing goes to full public access mode.
from my /etc/rc.d/rc.firewall script for a router/firewall box:
#!/bin/bash
echo -e "\nrc.firewall: '$1 $2 $3' version: 2006-05-25\c"
....
# This is a start/stop/restart script, though start, stop and default
# action switch the firewall to failsafe localnet mode.
case $1 in
restart )
# called from ip-up when ADSL connection established, parameters:
# $1 restart -- anything else switches firewall to local mode
# $2 <interface> -- example ppp0
# $3 <IP>, optional -- if specified the output will be SNAT to the
# supplied IP address, otherwise MASQUERADE is used
install_firewall_local_mode
if [ -z "$2" ]; then
echo -e "\nrc.firewall: warning: restart without \c"
echo -e "<interface>, local mode running."
exit 0
else
X_WORLD=$2 # eg. ppp0
fi
if [ -z "$3" ]; then
IP_WORLD="" # MASQUERADE
else
IP_WORLD=$3 # SNAT to supplied IP address
fi
install_firewall_world_mode
echo -e "\n\nrc.firewall: finish: world mode running."
;;
* )
# called from rc.inet2 during machine startup, start localnet only
# no firewall stop as we need failsafe localnet control
install_firewall_local_mode
echo -e "\n\nrc.firewall: finish: default local mode running."
;;
esac
Grant.
--
WinXP: Access Start->Turn Off Computer, then while holding Ctrl-Alt-Shift,
left click on Cancel. This terminates Windows Explorer...
.
- Follow-Ups:
- Re: Linux Firewall
- From: Moe Trin
- Re: Linux Firewall
- References:
- Linux Firewall
- From: Mark
- Re: Linux Firewall
- From: Mark
- Linux Firewall
- Prev by Date: Re: POP3 Authentication
- Next by Date: Re: POP3 Authentication
- Previous by thread: Re: Linux Firewall
- Next by thread: Re: Linux Firewall
- Index(es):
Relevant Pages
|
|